Re: Nested Loop Left Join always shows rows=1

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Nested Loop Left Join always shows rows=1
Дата
Msg-id 1135.1228165780@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Nested Loop Left Join always shows rows=1  (Scara Maccai <m_lists@yahoo.it>)
Список pgsql-general
Scara Maccai <m_lists@yahoo.it> writes:
> I ran ANALYZE on both tables, but the plan shows rows=1 in the inner
> table results.

> If I change the "left outer join" into an "inner join" the bitmap index
> scan of the inner table of the nested loop shows a correct number of
> rows (not the exact same thing as "actual rows", but very close).

Yeah, this is a bug: it's effectively double-counting the selectivity of
the index clause.  The error isn't enormously critical, since the join
size estimate is right; but it could perhaps lead to choosing a plain
indexscan when a bitmap scan would be better.  I've applied a patch.

            regards, tom lane

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

Предыдущее
От: Maxim Boguk
Дата:
Сообщение: Re: Indexes on NULL's and order by ... limit N queries
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Indexes on NULL's and order by ... limit N queries