Re: Question about OID and TCID

Поиск
Список
Период
Сортировка
От Dmitriy Igrishin
Тема Re: Question about OID and TCID
Дата
Msg-id AANLkTimmE-8PqUhw-OByW8R36SYkTFuxfpBaY8VdRuNM@mail.gmail.com
обсуждение исходный текст
Ответ на Question about OID and TCID  (Zhipan Wang <wzhipan@soe.ucsc.edu>)
Список pgsql-general
Hey Zhipan,

2010/11/27 Zhipan Wang <wzhipan@soe.ucsc.edu>
Hi,

I want to access part of a table on the disk sequentially, i,e., when I get to a tuple in the table, I need to read several pages of data in the table starting from this tuple. I guess CTID could be translated to physical address on the disk to retrieve this tuple, right? If so, how do I use CTID to retrieve a particular tuple (or a page) in SQL? Can I use OID to do this equally efficiently?
Consider to use cursors to read sequentially by FETCH.
http://www.postgresql.org/docs/9.0/static/sql-fetch.html

Another question is: when I update a tuple in a table, this tuple will get a new CTID and it leaves a gap at the old CTID, and when I insert a new tuple, it's appended to the end of the table, so the gap is always there. Does this mean it actually inserts a new tuple and the out-dated tuple still occupies the space? How can I write the updated tuple back to its original position to utilize disk space more efficiently?
I believe that VACUUM works well on it.
http://www.postgresql.org/docs/9.0/static/sql-vacuum.html

Thanks!

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



--
// Dmitriy.


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

Предыдущее
От: Dave Page
Дата:
Сообщение: [ANNOUNCE] Just 2 days left to register for PGDay.EU 2010
Следующее
От: Guillaume Lelarge
Дата:
Сообщение: Re: Question about OID and TCID