Hi Tom,
Thanks for your feedback. I completely agree with you that a higher-level hook is better suited for this case. I have adjusted the PoC patch to this email.
Now it is located in the clauselist_selectivity_ext function, where we first check if the hook is defined. If so, we let the hook estimate the selectivity and return the result. With this one, I can also develop extensions to better estimate the selectivity.
I hope it makes more sense. Also please forgive me if I am understanding Postgres somehow wrong, as I am quite new to this community :)
Best regards,
Xiaozhe