Re: [Patch] optimizer - simplify $VAR1 IS NULL AND $VAR1 IS NOT NULL

2019-11-06 Thread Tom Lane
Andrew Gierth writes: > "Pierre" == Pierre Ducroquet writes: > Pierre> The attached patch handles both situations. When flattening and > Pierre> simplifying the AND clauses, a list of the NullChecks is built, > Pierre> and subsequent NullChecks are compared to the list. If opposite > Pierre>

Re: [Patch] optimizer - simplify $VAR1 IS NULL AND $VAR1 IS NOT NULL

2019-11-06 Thread Andrew Gierth
> "Pierre" == Pierre Ducroquet writes: Pierre> Hello Pierre> In several queries relying on views, I noticed that the Pierre> optimizer miss a quite simple to implement optimization. My Pierre> views contain several branches, with different paths that are Pierre> simplified by the

[Patch] optimizer - simplify $VAR1 IS NULL AND $VAR1 IS NOT NULL

2019-11-06 Thread Pierre Ducroquet
Hello In several queries relying on views, I noticed that the optimizer miss a quite simple to implement optimization. My views contain several branches, with different paths that are simplified by the caller of the view. This simplification is based on columns to be null or not. Today, even