Explain reports unexpected results with inheritance

Поиск
Список
Период
Сортировка
От pgsql-bugs@postgresql.org
Тема Explain reports unexpected results with inheritance
Дата
Msg-id 200102141821.f1EIL2w67836@hub.org
обсуждение исходный текст
Ответы Re: Explain reports unexpected results with inheritance  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
David Lynn (davidl@ayamba.com) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
Explain reports unexpected results with inheritance

Long Description
When tab2 inherits tab1, explain in psql will always report a "Seq Scan" on tab2 even if there are appropriate indexes.
Through additional testing, it appears that the index is actually being used based on relative cost numbers, but that
explainis just not reporting as such. 

Using 7.0.2.

Sample Code
DEV:menu# create table tab1 (col1 int4);
CREATE
DEV:menu# create table tab2 (col2 int4) inherits (tab1);
CREATE
DEV:menu# insert into tab2 (col1, col2) values (1,1);
INSERT 28995 1
DEV:menu# insert into tab2 (col1, col2) values (2,2);
INSERT 28996 1
DEV:menu# create index idx1 on tab2 (col2);
CREATE
DEV:menu# select * from tab2 where col2 = 2;
 col1 | col2
------+------
    2 |    2
(1 row)

DEV:menu# explain select * from tab2 where col2 = 2;
NOTICE:  QUERY PLAN:

Seq Scan on tab2  (cost=0.00..1.02 rows=1 width=8)

EXPLAIN


No file was uploaded with this report

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

Предыдущее
От: pgsql-bugs@postgresql.org
Дата:
Сообщение: Sequence increased before constraint check
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: Sequence increased before constraint check