Optimization of NestLoop join in the case of guaranteed empty innersubtree

Поиск
Список
Период
Сортировка
От Andrey Lepikhov
Тема Optimization of NestLoop join in the case of guaranteed empty innersubtree
Дата
Msg-id a373827a-260c-2b05-e7e6-32f4135ec093@postgrespro.ru
обсуждение исходный текст
Ответы Re: Optimization of NestLoop join in the case of guaranteed empty inner subtree  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
During NestLoop execution we have bad corner case: if outer subtree 
contains tuples the join node will scan inner subtree even if it does 
not return any tuples.

To reproduce the problem see 'problem.sql' in attachment:
Out of explain analyze see in 'problem_explain.txt'

As you can see, executor scan each of 1e5 outer tuples despite the fact 
that inner can't return any tuples.

Teodor Sigaev and I developed a patch to solve this problem. Result of 
explain analyze procedure can be found in the 'optimized_execution.txt'.

-- 
Andrey Lepikhov
Postgres Professional
https://postgrespro.com
The Russian Postgres Company

Вложения

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

Предыдущее
От: Ranier Vilela
Дата:
Сообщение: RE: [Proposal] Level4 Warnings show many shadow vars
Следующее
От: Julien Rouhaud
Дата:
Сообщение: Re: Collation versioning