Commit f84ff0c
committed
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.com1 parent d8678ab commit f84ff0c
2 files changed
+22
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2261 | 2261 | | |
2262 | 2262 | | |
2263 | 2263 | | |
| 2264 | + | |
2264 | 2265 | | |
2265 | 2266 | | |
2266 | 2267 | | |
| |||
2275 | 2276 | | |
2276 | 2277 | | |
2277 | 2278 | | |
| 2279 | + | |
| 2280 | + | |
| 2281 | + | |
| 2282 | + | |
| 2283 | + | |
| 2284 | + | |
| 2285 | + | |
| 2286 | + | |
| 2287 | + | |
| 2288 | + | |
| 2289 | + | |
| 2290 | + | |
| 2291 | + | |
2278 | 2292 | | |
2279 | 2293 | | |
2280 | 2294 | | |
2281 | 2295 | | |
2282 | | - | |
| 2296 | + | |
| 2297 | + | |
2283 | 2298 | | |
2284 | 2299 | | |
2285 | 2300 | | |
| |||
2289 | 2304 | | |
2290 | 2305 | | |
2291 | 2306 | | |
2292 | | - | |
| 2307 | + | |
| 2308 | + | |
2293 | 2309 | | |
2294 | 2310 | | |
2295 | 2311 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3183 | 3183 | | |
3184 | 3184 | | |
3185 | 3185 | | |
| 3186 | + | |
| 3187 | + | |
| 3188 | + | |
| 3189 | + | |
3186 | 3190 | | |
3187 | 3191 | | |
3188 | 3192 | | |
| |||
0 commit comments