forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitbc37473
Allow Incremental Sorts on GiST and SP-GiST indexes
Previously an "amcanorderbyop" index would only be used when the indexcould provide sorted results which satisfied all query_pathkeys. Herewe relax this so that we also allow these indexes to be considered by theplanner when they only provide partially sorted results. This allows theplanner to later consider making use of an Incremental Sort to satisfy theremaining pathkeys. This change is particularly useful for KNN-typequeries which contain a LIMIT clause and an additional ORDER BY clause fora non-indexed column.Author: Miroslav BendikReviewed-by: Richard Guo, David RowleyDiscussion:https://postgr.es/m/CAPoEpV0QYDtzjwamwWUBqyWpaCVbJV2d6qOD7Uy09bWn47PJtw%40mail.gmail.com1 parentdb660eb commitbc37473
File tree
3 files changed
+77
-25
lines changed- src
- backend/optimizer/path
- test/regress
- expected
- sql
3 files changed
+77
-25
lines changedLines changed: 28 additions & 25 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
974 | 974 |
| |
975 | 975 |
| |
976 | 976 |
| |
977 |
| - | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
978 | 983 |
| |
979 | 984 |
| |
980 | 985 |
| |
981 |
| - | |
| 986 | + | |
982 | 987 |
| |
983 | 988 |
| |
984 |
| - | |
| 989 | + | |
| 990 | + | |
985 | 991 |
| |
986 | 992 |
| |
987 | 993 |
| |
| |||
3051 | 3057 |
| |
3052 | 3058 |
| |
3053 | 3059 |
| |
3054 |
| - | |
3055 |
| - | |
3056 |
| - | |
3057 |
| - | |
3058 |
| - | |
3059 |
| - | |
3060 |
| - | |
3061 |
| - | |
3062 |
| - | |
3063 |
| - | |
| 3060 | + | |
| 3061 | + | |
| 3062 | + | |
| 3063 | + | |
| 3064 | + | |
| 3065 | + | |
| 3066 | + | |
| 3067 | + | |
| 3068 | + | |
| 3069 | + | |
| 3070 | + | |
| 3071 | + | |
3064 | 3072 |
| |
3065 | 3073 |
| |
3066 | 3074 |
| |
3067 | 3075 |
| |
3068 | 3076 |
| |
3069 | 3077 |
| |
3070 |
| - | |
3071 |
| - | |
3072 | 3078 |
| |
3073 | 3079 |
| |
3074 | 3080 |
| |
| |||
3084 | 3090 |
| |
3085 | 3091 |
| |
3086 | 3092 |
| |
3087 |
| - | |
3088 |
| - | |
3089 |
| - | |
3090 |
| - | |
3091 | 3093 |
| |
3092 | 3094 |
| |
3093 | 3095 |
| |
| |||
3133 | 3135 |
| |
3134 | 3136 |
| |
3135 | 3137 |
| |
3136 |
| - | |
3137 |
| - | |
| 3138 | + | |
| 3139 | + | |
3138 | 3140 |
| |
3139 | 3141 |
| |
3140 | 3142 |
| |
| |||
3144 | 3146 |
| |
3145 | 3147 |
| |
3146 | 3148 |
| |
3147 |
| - | |
| 3149 | + | |
| 3150 | + | |
| 3151 | + | |
| 3152 | + | |
| 3153 | + | |
3148 | 3154 |
| |
3149 | 3155 |
| |
3150 |
| - | |
3151 |
| - | |
3152 |
| - | |
3153 | 3156 |
| |
3154 | 3157 |
| |
3155 | 3158 |
| |
|
Lines changed: 33 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1660 | 1660 |
| |
1661 | 1661 |
| |
1662 | 1662 |
| |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
| 1666 | + | |
| 1667 | + | |
| 1668 | + | |
| 1669 | + | |
| 1670 | + | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
| 1680 | + | |
| 1681 | + | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
| 1688 | + | |
| 1689 | + | |
| 1690 | + | |
| 1691 | + | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
| 1695 | + |
Lines changed: 16 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
276 | 276 |
| |
277 | 277 |
| |
278 | 278 |
| |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + |
0 commit comments
Comments
(0)