Richard Guo <ri...@pivotal.io> wrote:
> 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;

Sorry, I'm quite busy currently. And thanks! That was a good read.

I might be wrong, but I think have_partkey_equi_join in joinrels.c should be 
aware of the const case. My naive approach would be keeping pointers to the 
first few constant clauses, which are referencing to a yet unmatched partition 
key, to keep the memory footprint feasible in manner similar to pk_has_clause. 
The question would be what to do, if there are a lot of const expressions on 
the part keys. One could palloc additional memory in that case, hoping that it 
will be quite rare. Or is there a different, better way to go about that?
Thank you for your feedback!

Regards
Arne

Reply via email to