diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2022-11-18 11:01:03 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2022-11-18 11:01:03 -0500 |
commit | f84ff0c6d4eb4e470e55f48103a7edd269d13c49 (patch) | |
tree | c4db00b725e37b42343ca04ae2c0ff5af8f7c712 /src/backend/commands/variable.c | |
parent | d8678aba2ee5969e6d2351c5361d488fc51c975f (diff) | |
download | postgresql-f84ff0c6d4eb4e470e55f48103a7edd269d13c49.tar.gz postgresql-f84ff0c6d4eb4e470e55f48103a7edd269d13c49.zip |
Don't read MCV stats needlessly in eqjoinsel().
eqjoinsel() currently makes use of MCV stats only when we have such
stats for both sides of the clause. As coded, though, it would
fetch those stats even when they're present for just one side.
This can be a bit expensive with high statistics targets, leading
to wasted effort in common cases such as joining a unique column
to a non-unique column. So it seems worth the trouble to do a quick
pre-check to confirm that both sides have MCVs before fetching either.
Also, tweak the API spec for get_attstatsslot() to document the
method we're using here.
David Geier, Tomas Vondra, Tom Lane
Discussion: https://postgr.es/m/b9846ca0-5f1c-9b26-5881-aad3f42b07f0@gmail.com
Diffstat (limited to 'src/backend/commands/variable.c')
0 files changed, 0 insertions, 0 deletions