Re: temp table indexes

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Andrew Bartley <abartley(at)evolvosystems(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: temp table indexes
Date: 2002-03-19 06:29:12
Message-ID: 26918.1016519352@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> Andrew Bartley wrote:
>> The testing I have already done, an index is by far better in this
>> circumstance.

> If it is a non-temp table with the same data and VACUUM ANALYZE, does it
> use an index?

The default stats values used in the absence of any VACUUM are supposed
to yield an index search. Temp-ness is irrelevant. For example:

regression=# create temp table foo (f1 int primary key);
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'foo_pkey' for table 'foo'
CREATE
regression=# explain select * from foo where f1 = 42;
INFO: QUERY PLAN:

Index Scan using foo_pkey on foo (cost=0.00..4.82 rows=1 width=4)
indxqual: (f1 = 42)

EXPLAIN

I'd be interested to see the details of Andrew's example where this
does not happen.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Enote 2002-03-19 07:00:50 is postgres IP address sensitive?
Previous Message Andrew Bartley 2002-03-19 06:01:37 Re: temp table indexes