On Thu, Aug 1, 2019 at 7:46 PM Arne Roland <[email protected]> wrote:
> Hello Richard,
>
> thanks for your quick reply.
>
>
> > We need to fix this.
>
>
> Do you have a better idea than just keeping the old quals - possibly just
> the ones that get eliminated - in a separate data structure? Is the push
> down of quals the only case of elimination of quals, only counting the ones
> which happen before the restrict lists are generated?
>
In you case, the restriction 'sl = sl' is just not generated for the
join, because it forms an EC with const, which is not considered when
generating join clauses.
Please refer to the code snippet below:
@@ -1164,8 +1164,8 @@ generate_join_implied_equalities(PlannerInfo *root,
List *sublist = NIL;
/* ECs containing consts do not need any further
enforcement */
if (ec->ec_has_const)
continue;
Thanks
Richard