Re: Getting all entries in a single block with ctid
От | Tomas Vondra |
---|---|
Тема | Re: Getting all entries in a single block with ctid |
Дата | |
Msg-id | be64327d326568a3be7fde1891ed34ff.squirrel@sq.gransy.com обсуждение исходный текст |
Ответ на | Re: Getting all entries in a single block with ctid (Tore Halvorsen <tore.halvorsen@gmail.com>) |
Ответы |
Re: Getting all entries in a single block with ctid
|
Список | pgsql-general |
On 16 Leden 2012, 15:28, Tore Halvorsen wrote: > On Mon, Jan 16, 2012 at 3:20 PM, Tomas Vondra <tv@fuzzy.cz> wrote: > [...] > >> >> WHERE ctid >= '(123,0)'::tid AND ctid < '(124,0)'::tid >> >> > Ah, forgot a point here - without doing a sequential scan. Hmmm, you could create an index on the ctid column, but that'd give you bitmap index scan and not tid scan (which is probably what you're looking for). The only other solution is to check all possible items on the page. There may be up to 291 items (although it depends on block size and architecture, see MaxHeapTuplesPerPage in access/htup.h). Something like this should work ctid = '(123,0)'::tid OR ctid = '(123,1)'::tid OR ctid = '(123,2)'::tid OR ... OR ctid = '(123,290)'::tid But maybe someone will recommend a better solution. Tomas
В списке pgsql-general по дате отправления: