forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitf84ff0c
committed
Don't read MCV stats needlessly in eqjoinsel().
eqjoinsel() currently makes use of MCV stats only when we have suchstats for both sides of the clause. As coded, though, it wouldfetch those stats even when they're present for just one side.This can be a bit expensive with high statistics targets, leadingto wasted effort in common cases such as joining a unique columnto a non-unique column. So it seems worth the trouble to do a quickpre-check to confirm that both sides have MCVs before fetching either.Also, tweak the API spec for get_attstatsslot() to document themethod we're using here.David Geier, Tomas Vondra, Tom LaneDiscussion:https://postgr.es/m/b9846ca0-5f1c-9b26-5881-aad3f42b07f0@gmail.com1 parentd8678ab commitf84ff0c
2 files changed
+22
-2
lines changedLines changed: 18 additions & 2 deletions
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 |
| |
|
Lines changed: 4 additions & 0 deletions
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
Comments
(0)