Re: Optimization of NestLoop join in the case of guaranteed empty inner subtree

2019-12-15 Thread Andrey Lepikhov
On 12/11/19 8:49 PM, Tom Lane wrote: Andrey Lepikhov writes: 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. So the first question about corner-case optimizations like this is al

Re: Optimization of NestLoop join in the case of guaranteed empty inner subtree

2019-12-11 Thread Tom Lane
Andrey Lepikhov writes: > 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. So the first question about corner-case optimizations like this is always "how much overhead does it add

Optimization of NestLoop join in the case of guaranteed empty inner subtree

2019-12-11 Thread Andrey Lepikhov
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, executo