forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commite4326fb
committed
Remove grotty use of disable_cost for TID scan plans.
Previously, the code charged disable_cost for CurrentOfExpr, and thensubtracted disable_cost from the cost of a TID path that usedCurrentOfExpr as the TID qual, effectively disabling all paths exceptthat one. Now, we instead suppress generation of the disabled pathsentirely, and generate only the one that the executor will actuallyunderstand.With this approach, we do not need to rely on disable_cost beinglarge enough to prevent the wrong path from being chosen, and wesave some CPU cycle by avoiding generating paths that we can'tactually use. In my opinion, the code is also easier to understandlike this.Patch by me. Review by Heikki Linnakangas.Discussion:http://postgr.es/m/591b3596-2ea0-4b8e-99c6-fad0ef2801f5@iki.fi1 parentc0348fd commite4326fb
File tree
4 files changed
+48
-35
lines changed- src
- backend/optimizer/path
- include/optimizer
4 files changed
+48
-35
lines changedLines changed: 11 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
772 | 772 |
| |
773 | 773 |
| |
774 | 774 |
| |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
775 | 786 |
| |
776 | 787 |
| |
777 | 788 |
| |
| |||
781 | 792 |
| |
782 | 793 |
| |
783 | 794 |
| |
784 |
| - | |
785 |
| - | |
786 |
| - | |
787 | 795 |
| |
788 | 796 |
| |
789 | 797 |
| |
|
Lines changed: 0 additions & 26 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1251 | 1251 |
| |
1252 | 1252 |
| |
1253 | 1253 |
| |
1254 |
| - | |
1255 | 1254 |
| |
1256 | 1255 |
| |
1257 | 1256 |
| |
| |||
1287 | 1286 |
| |
1288 | 1287 |
| |
1289 | 1288 |
| |
1290 |
| - | |
1291 | 1289 |
| |
1292 | 1290 |
| |
1293 | 1291 |
| |
| |||
1297 | 1295 |
| |
1298 | 1296 |
| |
1299 | 1297 |
| |
1300 |
| - | |
1301 |
| - | |
1302 |
| - | |
1303 |
| - | |
1304 |
| - | |
1305 |
| - | |
1306 |
| - | |
1307 |
| - | |
1308 |
| - | |
1309 |
| - | |
1310 |
| - | |
1311 |
| - | |
1312 |
| - | |
1313 |
| - | |
1314 |
| - | |
1315 |
| - | |
1316 | 1298 |
| |
1317 | 1299 |
| |
1318 | 1300 |
| |
| |||
1399 | 1381 |
| |
1400 | 1382 |
| |
1401 | 1383 |
| |
1402 |
| - | |
1403 |
| - | |
1404 |
| - | |
1405 | 1384 |
| |
1406 | 1385 |
| |
1407 | 1386 |
| |
| |||
4884 | 4863 |
| |
4885 | 4864 |
| |
4886 | 4865 |
| |
4887 |
| - | |
4888 |
| - | |
4889 |
| - | |
4890 |
| - | |
4891 |
| - | |
4892 | 4866 |
| |
4893 | 4867 |
| |
4894 | 4868 |
| |
|
Lines changed: 36 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
42 | 42 |
| |
43 | 43 |
| |
44 | 44 |
| |
| 45 | + | |
45 | 46 |
| |
46 | 47 |
| |
47 | 48 |
| |
| |||
277 | 278 |
| |
278 | 279 |
| |
279 | 280 |
| |
280 |
| - | |
| 281 | + | |
| 282 | + | |
281 | 283 |
| |
282 | 284 |
| |
283 | 285 |
| |
284 | 286 |
| |
285 | 287 |
| |
| 288 | + | |
| 289 | + | |
286 | 290 |
| |
287 | 291 |
| |
288 | 292 |
| |
| |||
305 | 309 |
| |
306 | 310 |
| |
307 | 311 |
| |
| 312 | + | |
308 | 313 |
| |
309 | 314 |
| |
310 |
| - | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
311 | 319 |
| |
312 | 320 |
| |
313 | 321 |
| |
| |||
353 | 361 |
| |
354 | 362 |
| |
355 | 363 |
| |
| 364 | + | |
| 365 | + | |
356 | 366 |
| |
| 367 | + | |
357 | 368 |
| |
358 | 369 |
| |
359 | 370 |
| |
| |||
483 | 494 |
| |
484 | 495 |
| |
485 | 496 |
| |
486 |
| - | |
| 497 | + | |
487 | 498 |
| |
488 | 499 |
| |
489 | 500 |
| |
490 | 501 |
| |
| 502 | + | |
491 | 503 |
| |
492 | 504 |
| |
493 | 505 |
| |
494 | 506 |
| |
| 507 | + | |
| 508 | + | |
| 509 | + | |
495 | 510 |
| |
496 |
| - | |
| 511 | + | |
| 512 | + | |
497 | 513 |
| |
498 |
| - | |
| 514 | + | |
499 | 515 |
| |
500 | 516 |
| |
501 | 517 |
| |
| |||
505 | 521 |
| |
506 | 522 |
| |
507 | 523 |
| |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
508 | 533 |
| |
509 | 534 |
| |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
510 | 539 |
| |
511 | 540 |
| |
512 | 541 |
| |
| |||
553 | 582 |
| |
554 | 583 |
| |
555 | 584 |
| |
| 585 | + | |
| 586 | + | |
556 | 587 |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
83 | 83 |
| |
84 | 84 |
| |
85 | 85 |
| |
86 |
| - | |
| 86 | + | |
87 | 87 |
| |
88 | 88 |
| |
89 | 89 |
| |
|
0 commit comments
Comments
(0)