Search Postgresql Archives

Re: Getting all entries in a single block with ctid

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 16 Leden 2012, 15:28, Tore Halvorsen wrote:
> On Mon, Jan 16, 2012 at 3:20 PM, Tomas Vondra <tv@xxxxxxxx> 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


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



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux