forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit0c444a7
committed
Simplify PathKey checking code
pathkeys_useful_for_ordering() contained some needless checks to return0 when either root->query_pathkeys or pathkeys lists were empty. This isalready handled by pathkeys_count_contained_in(), so let's have it do thework instead of having redundant checks.Similarly, in pathkeys_useful_for_grouping(), checking pathkeys is anempty list just before looping over it isn't required. Technically,neither is the list empty check for group_pathkeys, but I felt a bitmore work would have to be done to get the equivalent behavior if we'dleft it up to the foreach loop to call list_member_ptr().This was noticed by Andy while he was reviewing a patch to improve theUNION planner. Since that patch adds another function similar topathkeys_useful_for_ordering() and since I wasn't planning to copy theseredundant checks over to the new function, let's adjust the existingcode so that both functions will be consistent.Author: Andy FanDiscussion:https://postgr.es/m/87o7cti48f.fsf@163.com1 parent87027cb commit0c444a7
1 file changed
+0
-10
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2143 | 2143 |
| |
2144 | 2144 |
| |
2145 | 2145 |
| |
2146 |
| - | |
2147 |
| - | |
2148 |
| - | |
2149 |
| - | |
2150 |
| - | |
2151 |
| - | |
2152 | 2146 |
| |
2153 | 2147 |
| |
2154 | 2148 |
| |
| |||
2184 | 2178 |
| |
2185 | 2179 |
| |
2186 | 2180 |
| |
2187 |
| - | |
2188 |
| - | |
2189 |
| - | |
2190 |
| - | |
2191 | 2181 |
| |
2192 | 2182 |
| |
2193 | 2183 |
| |
|
0 commit comments
Comments
(0)