Re: ctid access is slow

Поиск
Список
Период
Сортировка
От Jeff Eckermann
Тема Re: ctid access is slow
Дата
Msg-id degd2r$1tv1$1@news.hub.org
обсуждение исходный текст
Ответ на ctid access is slow  ("Ilja Golshtein" <ilejn@yandex.ru>)
Ответы Re: ctid access is slow  ("Jim C. Nasby" <jnasby@pervasive.com>)
Список pgsql-general
""Ilja Golshtein"" <ilejn@yandex.ru> wrote in message
news:430B2C5D.000008.17678@mfront7.yandex.ru...
> Hello!
>
>>On Tue, Aug 23, 2005 at 09:15:42AM -0400, Robert Treat wrote:
>>> On Tuesday 23 August 2005 08:39, Ilja Golshtein wrote:
>>> >
>>> > select ctid from aaa where ctid in (select ctid from aaa limit 10);
>
>>Aside from that, ctid is of type tid, and its equality operator
>>isn't hashable.
>
> It is the piece of knowledge I failed to deduce exploring
> plans of queries ;(.
>
> So I have no better solution then creating indexed
> field of serial type, have I?
>
> The only thing I am curios is ctid good for
> anything from user point of view?

The ctid value can be useful in a multi user application, to check whether a
record has been changed by another user, before committing changes.
Whenever a record is updated the ctid value will be changed, so by storing
the ctid value when first fetching the record, that can be compared with the
current ctid value before doing the update.

>
> Thanks a lot.
>
> --
> Best regards
> Ilja Golshtein
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>



В списке pgsql-general по дате отправления:

Предыдущее
От: Robert Treat
Дата:
Сообщение: Re: ctid access is slow
Следующее
От: Mark Probert
Дата:
Сообщение: Re: [newbie] server startup