Re: What is an RT index?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Rada Chirkova" <chirkova(at)csc(dot)ncsu(dot)edu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: What is an RT index?
Date: 2003-10-27 23:38:06
Message-ID: 18009.1067297886@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Rada Chirkova" <chirkova(at)csc(dot)ncsu(dot)edu> writes:
> Hi, could you help me? I am reading documentation on RelOptInfo in version
> 7.3.4 and have come across "RT indexes" in the explanation. Could you tell
> me what they are?

"rangetable indexes", that is, the integer position numbers of different
relations' entries in the Query's rtable list.

> They seem to be some kind of unique identifiers of relations,

Unique only within the context of a given query. For example,

select * from a join b on (a.f1 = b.f2)

will create RTEs (range table entries, struct RangeTblEntry) for
a, b, and their join. Because the RTEs will be added to the rtable list
in that order, they will have RT indexes 1, 2, 3 respectively in this
query.

There are various places in the optimizer code that use "relid" to mean
the same thing as "RT index". Outside the optimizer, "relid" more often
means a relation's OID, which is not the same thing at all.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Allen Landsidel 2003-10-27 23:42:27 Re: SCSI vs. IDE performance test
Previous Message Robert Treat 2003-10-27 23:25:19 Re: Experience with PL/xx?