Chao Li <li.evan.c...@gmail.com> writes:
> With this patch, “isnull” now becomes true because of the change of strict 
> op. Then the outer null join key tuple must be stored in a tuplestore. When 
> an outer table contains a lot of null join key tuples, then the tuplestore 
> could bump to very large, in that case, it would be hard to say this patch 
> really benefits.

What's your point?  If we don't divert those tuples into the
tuplestore, then they will end up in the main hash table instead,
and the consequences of bloat there are far worse.

> Based on this patch, if we are doing a left join, and outer table is empty, 
> then all tuples from the inner table should be returned. In that case, we can 
> skip building a hash table, instead, we can put all inner table tuples into 
> hashtable.innerNullTupleStore. Building a tuplestore should be cheaper than 
> building a hash table, so this way makes a little bit more performance 
> improvement.

I think that would make the logic completely unintelligible.  Also,
a totally-empty input relation is not a common situation.  We try to
optimize such cases when it's simple to do so, but we shouldn't let
that drive the fundamental design.

                        regards, tom lane


Reply via email to