forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit75c4614
committed
Clean up planner confusion between ncolumns and nkeycolumns.
We're only going to consider key columns when creating indexquals,so there is no point in having the outer loops in indxpath.c iteratefurther than nkeycolumns.Doing so in match_pathkeys_to_index() is actually wrong, and would havecaused crashes by now, except that we have no index AMs supporting bothamcanorderbyop and amcaninclude.It's also wrong in relation_has_unique_index_for(). The effect there isto fail to prove uniqueness even when the index does prove it, if thereare extra columns.Also future-proof examine_variable() for the day when extra columns canbe expressions, and fix what's either a thinko or just an oversight inbtcostestimate(): we should consider the number of key columns, not thetotal, when deciding whether to derate correlation.None of these things seemed important enough to risk changing in ajust-before-wrap patch, but since we're past the release wrap window,time to fix 'em.Discussion:https://postgr.es/m/25526.1549847928@sss.pgh.pa.us1 parent8c67d29 commit75c4614
2 files changed
+18
-12
lines changedLines changed: 12 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
253 | 253 |
| |
254 | 254 |
| |
255 | 255 |
| |
256 |
| - | |
| 256 | + | |
257 | 257 |
| |
258 | 258 |
| |
259 | 259 |
| |
| |||
468 | 468 |
| |
469 | 469 |
| |
470 | 470 |
| |
471 |
| - | |
| 471 | + | |
472 | 472 |
| |
473 | 473 |
| |
474 | 474 |
| |
| |||
623 | 623 |
| |
624 | 624 |
| |
625 | 625 |
| |
626 |
| - | |
| 626 | + | |
627 | 627 |
| |
628 | 628 |
| |
629 | 629 |
| |
| |||
920 | 920 |
| |
921 | 921 |
| |
922 | 922 |
| |
923 |
| - | |
| 923 | + | |
924 | 924 |
| |
925 | 925 |
| |
926 | 926 |
| |
| |||
3237 | 3237 |
| |
3238 | 3238 |
| |
3239 | 3239 |
| |
3240 |
| - | |
3241 |
| - | |
3242 |
| - | |
| 3240 | + | |
| 3241 | + | |
| 3242 | + | |
| 3243 | + | |
3243 | 3244 |
| |
3244 |
| - | |
| 3245 | + | |
3245 | 3246 |
| |
3246 | 3247 |
| |
3247 | 3248 |
| |
| |||
3672 | 3673 |
| |
3673 | 3674 |
| |
3674 | 3675 |
| |
3675 |
| - | |
| 3676 | + | |
3676 | 3677 |
| |
3677 | 3678 |
| |
3678 | 3679 |
| |
| |||
3747 | 3748 |
| |
3748 | 3749 |
| |
3749 | 3750 |
| |
3750 |
| - | |
3751 |
| - | |
| 3751 | + | |
| 3752 | + | |
3752 | 3753 |
| |
3753 | 3754 |
| |
3754 | 3755 |
| |
|
Lines changed: 6 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4869 | 4869 |
| |
4870 | 4870 |
| |
4871 | 4871 |
| |
| 4872 | + | |
| 4873 | + | |
| 4874 | + | |
| 4875 | + | |
4872 | 4876 |
| |
4873 | 4877 |
| |
4874 | 4878 |
| |
| |||
4904 | 4908 |
| |
4905 | 4909 |
| |
4906 | 4910 |
| |
| 4911 | + | |
4907 | 4912 |
| |
4908 | 4913 |
| |
4909 | 4914 |
| |
| |||
7242 | 7247 |
| |
7243 | 7248 |
| |
7244 | 7249 |
| |
7245 |
| - | |
| 7250 | + | |
7246 | 7251 |
| |
7247 | 7252 |
| |
7248 | 7253 |
| |
|
0 commit comments
Comments
(0)