Re: Using oids for fast read-only access?

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Christopher Zach <zach(at)icg(dot)tu-graz(dot)ac(dot)at>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Using oids for fast read-only access?
Date: 2001-08-10 16:24:38
Message-ID: Pine.LNX.4.30.0108101821500.703-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Christopher Zach writes:

> 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).

And what makes you think oids have a more "constant" access time than
integers? The only thing you will save if you omit the id column is
space.

> 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).

No surprise if you haven't got an index on oid.

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

Oids aren't really any different than other (integer) types, only that
they are generated automatically.

--
Peter Eisentraut peter_e(at)gmx(dot)net http://funkturm.homeip.net/~peter

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2001-08-10 16:30:08 Re: PL/Perl on Solaris
Previous Message Alex Pilosov 2001-08-10 16:24:24 Re: PL/Perl on Solaris