Using oids for fast read-only access?

Поиск
Список
Период
Сортировка
От Christopher Zach
Тема Using oids for fast read-only access?
Дата
Msg-id 01081017094801.21947@fcggpc47.icg.tu-graz.ac.at
обсуждение исходный текст
Ответы Re: Using oids for fast read-only access?  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-general
I've implemented r-trees on top of PostgreSQL (since I need more control over
the r-tree than you can have with the r-tree index that comes with
PostgreSQL) and I would like to know whether there is an efficient way to
dereference the data in the leaves.

Currently the geometry database looks like this:

            Table "geometry"
 Attribute |       Type       | Modifier
-----------+------------------+----------
 id        | integer          |
 x1        | double precision |
 y1        | double precision |
 z1        | double precision |
 x2        | double precision |
 y2        | double precision |
 z2        | double precision |
Indices: geometry_index (on id)

The leaves in the corresponding rtree store id's.
After inserting the geometry, the data is read only, therefore I would like
to replace the id's in the rtree with oids (or anything that has a constant
time access).

The problem is that a "select * from geometry where oid=xxx" is a lot slower
than selecting objects by their id (since the former does a seq scan and the
later an index scan).

The PostgreSQL documentation doesn't say much about oids and their use,
therefore I need al little help...

best wishes,

Christopher Zach

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

Предыдущее
От: Travis Bauer
Дата:
Сообщение: PL/Perl on Solaris
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Re: Bug#108286: case sensitivity in column names