Re: temp table indexes

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: temp table indexes
Дата
Msg-id 26918.1016519352@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: temp table indexes  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-general
Bruce Momjian <pgman@candle.pha.pa.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

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: temp table indexes
Следующее
От: Jeff Davis
Дата:
Сообщение: Notify argument?