Is retrieval by OID a special case?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-sql(at)postgresql(dot)org
Subject: Is retrieval by OID a special case?
Date: 1998-07-09 18:58:39
Message-ID: 2817.900010719@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

(I'm just full of questions today...)

"EXPLAIN" claims that selecting on OID is done via brute force search:

tgl=> explain select * from markettransactionlog where oid = 176276;
NOTICE: QUERY PLAN:
Seq Scan on markettransactionlog (cost=1045.32 size=1 width=57)

but when you actually do it, it is far faster than an ordinary
sequential-scan retrieval.

I would imagine that retrieving by OID has to be special-cased somehow
(don't indexes use OIDs to refer to the tuples in the underlying
table?). Is EXPLAIN failing to describe this operation properly,
or is my understanding all wet?

regards, tom lane

Browse pgsql-sql by date

  From Date Subject
Next Message Lorenzo Huerta 1998-07-09 20:27:23 unique indices...
Previous Message Bruce Momjian 1998-07-09 18:13:29 Re: [SQL] Single vs. multiple indexes