> > > >> It actually deals with a more general form of this case, because the > >> clauses don't need to reference the same attribute - so for example this > >> would work too, assuming there is extended stats object on the columns > >> on each side: > >> > >> P(A.c = B.d | (A.e < 42) & (B.f < 42)) > > > > That'd be cool. > > > > Yeah, but the patch implementing this still needs more work. > > Thanks for that patch. That patch has been on my study list for a long time and it can fix the other real case I met some day ago. I spent one day studying it again yesterday just that the result does not deserve sharing at the current stage. As for the purpose here, if we have extended statistics, I believe it can work well. But requiring extended statistics for this feature does not look very reasonable to me. Do you think we can go further in direction for the issue here? and it would be super great that you can take a look at the commit 3 [1]. IIUC, It can solve the issue and is pretty straightforward.
[1] https://www.postgresql.org/message-id/CAKU4AWrdeQZ8xvf%3DDVhndUs%3DRGn8oVoSJvYK3Yj7uWq2%3Ddt%3DMg%40mail.gmail.com -- Best Regards Andy Fan