Re: BUG #16993: Query Planner does not use index for EXISTS-query on a large table with all equal foreign key values

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #16993: Query Planner does not use index for EXISTS-query on a large table with all equal foreign key values
Дата
Msg-id 4016383.1620225070@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #16993: Query Planner does not use index for EXISTS-query on a large table with all equal foreign key values  (PG Bug reporting form <noreply@postgresql.org>)
Список pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
> ... EXPLAIN ANALYZE shows the following query plan:

> Merge Join  (cost=179053.41..179054.24 rows=1 width=8) (actual
> time=2140.820..2140.822 rows=1 loops=1)

> [ but with ]  SET enable_seqscan = false:

> Nested Loop Semi Join  (cost=0.57..12.85 rows=1 width=8) (actual
> time=0.877..0.920 rows=1 loops=1)

Yeah, that seems *extremely* broken.  The planner correctly estimates
the second plan as much cheaper, so why did it fail to choose that one
without help?  Will look into this.

            regards, tom lane



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

Предыдущее
От: PG Bug reporting form
Дата:
Сообщение: BUG #16993: Query Planner does not use index for EXISTS-query on a large table with all equal foreign key values
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: ALTER CONSTRAINT on a partitioned FK isn't working