ctid ranges

From: Thomas Munro <munro(at)ip9(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: ctid ranges
Date: 2012-06-08 21:27:52
Message-ID: CADLWmXX1Ov8xp02DDjvZveM=h8OJCaH-HyoUUY0UF-CVVk2=vA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi

In 9.1.3, this is fast, handled with a tid scan using the physical address:

SELECT ... FROM ... WHERE ctid = ...;

This is slow, handled with a seq scan (as are various rephrasing with
<, <=, etc):

SELECT ... FROM ... WHERE ctid BETWEEN ... AND ...;

Is there a way to retrieve the rows in a physical range quickly?

(I realise this is a pretty odd thing to want to do... I was
experimenting with a crackpot idea for storing some data in a known
physical order and finding the beginning of ends ranges by binary
chop, instead of using a btree.)

Thanks
Thomas Munro

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2012-06-09 03:38:41 Re: Extension table data
Previous Message Chris Schnaufer 2012-06-08 21:17:06 Extending SQL C-language multidimension arrays