Commit 8fd3fdd
committed
Simplify the planner's new representation of indexable clauses a little.
In commit 1a8d5af, I thought it'd be a good idea to define
IndexClause.indexquals as NIL in the most common case where the given
clause (IndexClause.rinfo) is usable exactly as-is. It'd be more
consistent to define the indexquals in that case as being a one-element
list containing IndexClause.rinfo, but I thought saving the palloc
overhead for making such a list would be worthwhile.
In hindsight, that was a great example of "premature optimization is the
root of all evil": it's complicated everyplace that needs to deal with
the indexquals, requiring duplicative code to handle both the simple
case and the not-simple case. I'd initially found that tolerable but
it's getting less so as I mop up some areas that I'd not touched in
1a8d5af. In any case, two more pallocs during a planner run are
surely at the noise level (a conclusion confirmed by a bit of
microbenchmarking). So let's change this decision before it becomes
set in stone, and insist that IndexClause.indexquals always be a valid
list of the actual index quals for the clause.
Discussion: https://postgr.es/m/24586.1550106354@sss.pgh.pa.us1 parent 86eea78 commit 8fd3fdd
File tree
4 files changed
+61
-115
lines changed- src
- backend
- optimizer
- path
- plan
- utils/adt
- include/nodes
4 files changed
+61
-115
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2435 | 2435 | | |
2436 | 2436 | | |
2437 | 2437 | | |
2438 | | - | |
| 2438 | + | |
2439 | 2439 | | |
2440 | 2440 | | |
2441 | 2441 | | |
| |||
2599 | 2599 | | |
2600 | 2600 | | |
2601 | 2601 | | |
2602 | | - | |
| 2602 | + | |
2603 | 2603 | | |
2604 | 2604 | | |
2605 | 2605 | | |
| |||
2819 | 2819 | | |
2820 | 2820 | | |
2821 | 2821 | | |
2822 | | - | |
| 2822 | + | |
2823 | 2823 | | |
2824 | 2824 | | |
2825 | 2825 | | |
| |||
3078 | 3078 | | |
3079 | 3079 | | |
3080 | 3080 | | |
3081 | | - | |
| 3081 | + | |
3082 | 3082 | | |
3083 | 3083 | | |
3084 | 3084 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3075 | 3075 | | |
3076 | 3076 | | |
3077 | 3077 | | |
3078 | | - | |
3079 | | - | |
3080 | | - | |
3081 | | - | |
3082 | | - | |
| 3078 | + | |
| 3079 | + | |
3083 | 3080 | | |
3084 | 3081 | | |
3085 | 3082 | | |
| |||
4491 | 4488 | | |
4492 | 4489 | | |
4493 | 4490 | | |
| 4491 | + | |
4494 | 4492 | | |
4495 | | - | |
| 4493 | + | |
4496 | 4494 | | |
4497 | | - | |
4498 | | - | |
| 4495 | + | |
| 4496 | + | |
4499 | 4497 | | |
4500 | 4498 | | |
4501 | 4499 | | |
4502 | 4500 | | |
4503 | 4501 | | |
4504 | 4502 | | |
4505 | | - | |
4506 | | - | |
4507 | | - | |
4508 | | - | |
4509 | | - | |
4510 | | - | |
4511 | | - | |
4512 | | - | |
4513 | | - | |
4514 | | - | |
4515 | | - | |
4516 | | - | |
4517 | | - | |
4518 | | - | |
4519 | | - | |
4520 | | - | |
4521 | 4503 | | |
4522 | 4504 | | |
4523 | 4505 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
200 | | - | |
201 | | - | |
202 | 200 | | |
203 | 201 | | |
204 | 202 | | |
| |||
5263 | 5261 | | |
5264 | 5262 | | |
5265 | 5263 | | |
| 5264 | + | |
5266 | 5265 | | |
5267 | | - | |
| 5266 | + | |
5268 | 5267 | | |
5269 | | - | |
5270 | | - | |
5271 | | - | |
5272 | | - | |
5273 | | - | |
5274 | | - | |
5275 | | - | |
| 5268 | + | |
| 5269 | + | |
| 5270 | + | |
5276 | 5271 | | |
5277 | 5272 | | |
5278 | 5273 | | |
| |||
5282 | 5277 | | |
5283 | 5278 | | |
5284 | 5279 | | |
5285 | | - | |
5286 | 5280 | | |
5287 | 5281 | | |
5288 | 5282 | | |
5289 | 5283 | | |
5290 | 5284 | | |
5291 | 5285 | | |
5292 | | - | |
| 5286 | + | |
5293 | 5287 | | |
5294 | | - | |
5295 | | - | |
5296 | | - | |
5297 | | - | |
5298 | | - | |
5299 | | - | |
5300 | | - | |
| 5288 | + | |
5301 | 5289 | | |
5302 | | - | |
5303 | | - | |
| 5290 | + | |
| 5291 | + | |
| 5292 | + | |
5304 | 5293 | | |
5305 | | - | |
5306 | | - | |
5307 | | - | |
| 5294 | + | |
| 5295 | + | |
| 5296 | + | |
5308 | 5297 | | |
5309 | | - | |
5310 | | - | |
| 5298 | + | |
| 5299 | + | |
| 5300 | + | |
| 5301 | + | |
5311 | 5302 | | |
5312 | | - | |
5313 | | - | |
5314 | | - | |
5315 | | - | |
5316 | | - | |
5317 | | - | |
5318 | | - | |
5319 | | - | |
5320 | | - | |
5321 | | - | |
5322 | | - | |
5323 | | - | |
5324 | | - | |
5325 | | - | |
5326 | | - | |
5327 | | - | |
5328 | | - | |
| 5303 | + | |
| 5304 | + | |
| 5305 | + | |
5329 | 5306 | | |
5330 | | - | |
5331 | | - | |
5332 | | - | |
5333 | | - | |
5334 | | - | |
5335 | | - | |
5336 | | - | |
5337 | | - | |
| 5307 | + | |
| 5308 | + | |
| 5309 | + | |
| 5310 | + | |
| 5311 | + | |
| 5312 | + | |
5338 | 5313 | | |
5339 | | - | |
5340 | | - | |
5341 | | - | |
5342 | | - | |
5343 | | - | |
5344 | | - | |
| 5314 | + | |
| 5315 | + | |
| 5316 | + | |
| 5317 | + | |
| 5318 | + | |
| 5319 | + | |
| 5320 | + | |
| 5321 | + | |
| 5322 | + | |
| 5323 | + | |
| 5324 | + | |
| 5325 | + | |
| 5326 | + | |
5345 | 5327 | | |
5346 | | - | |
5347 | | - | |
5348 | | - | |
5349 | | - | |
5350 | | - | |
5351 | | - | |
5352 | | - | |
5353 | | - | |
5354 | | - | |
5355 | | - | |
5356 | | - | |
5357 | | - | |
| 5328 | + | |
5358 | 5329 | | |
5359 | | - | |
5360 | | - | |
5361 | 5330 | | |
| 5331 | + | |
5362 | 5332 | | |
5363 | 5333 | | |
5364 | 5334 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1185 | 1185 | | |
1186 | 1186 | | |
1187 | 1187 | | |
1188 | | - | |
1189 | | - | |
1190 | | - | |
1191 | | - | |
1192 | | - | |
1193 | | - | |
1194 | | - | |
1195 | | - | |
1196 | | - | |
1197 | | - | |
1198 | | - | |
1199 | | - | |
1200 | | - | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
1201 | 1195 | | |
1202 | 1196 | | |
1203 | 1197 | | |
1204 | 1198 | | |
1205 | 1199 | | |
1206 | | - | |
1207 | | - | |
| 1200 | + | |
| 1201 | + | |
1208 | 1202 | | |
1209 | 1203 | | |
1210 | 1204 | | |
| |||
1214 | 1208 | | |
1215 | 1209 | | |
1216 | 1210 | | |
1217 | | - | |
| 1211 | + | |
1218 | 1212 | | |
1219 | 1213 | | |
1220 | 1214 | | |
| |||
0 commit comments