forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit7c70996
committed
Allow bitmap scans to operate as index-only scans when possible.
If we don't have to return any columns from heap tuples, and there'sno need to recheck qual conditions, and the heap page is all-visible,then we can skip fetching the heap page altogether.Skip prefetching pages too, when possible, on the assumption that therecheck flag will remain the same from one page to the next. While thatassumption is hardly bulletproof, it seems like a good bet most of thetime, and better than prefetching pages we don't need.This commit installs the executor infrastructure, but doesn't changeany planner cost estimates, thus possibly causing bitmap scans tonot be chosen in cases where this change renders them the best choice.I (tgl) am not entirely convinced that we need to account for thisbehavior in the planner, because I think typically the bitmap scan wouldget chosen anyway if it's the best bet. In any case the submitted patchtook way too many shortcuts, resulting in too many clearly-bad choices,to be committable.Alexander Kuzmenkov, reviewed by Alexey Chernyshov, and whacked aroundrather heavily by me.Discussion:https://postgr.es/m/239a8955-c0fc-f506-026d-c837e86c827b@postgrespro.ru1 parentec7ce54 commit7c70996
File tree
5 files changed
+150
-40
lines changed- src
- backend
- executor
- optimizer/plan
- include/nodes
- test/regress
- expected
- sql
5 files changed
+150
-40
lines changedLines changed: 126 additions & 39 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
39 | 39 |
| |
40 | 40 |
| |
41 | 41 |
| |
| 42 | + | |
42 | 43 |
| |
43 | 44 |
| |
44 | 45 |
| |
| |||
225 | 226 |
| |
226 | 227 |
| |
227 | 228 |
| |
228 |
| - | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
229 | 232 |
| |
230 |
| - | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
231 | 254 |
| |
232 | 255 |
| |
233 | 256 |
| |
| |||
289 | 312 |
| |
290 | 313 |
| |
291 | 314 |
| |
292 |
| - | |
293 |
| - | |
294 |
| - | |
295 |
| - | |
296 |
| - | |
297 |
| - | |
298 |
| - | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
299 | 331 |
| |
300 |
| - | |
301 |
| - | |
302 |
| - | |
303 |
| - | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
304 | 336 |
| |
305 |
| - | |
| 337 | + | |
306 | 338 |
| |
307 |
| - | |
308 |
| - | |
309 |
| - | |
310 |
| - | |
311 |
| - | |
312 |
| - | |
313 |
| - | |
314 |
| - | |
315 |
| - | |
316 |
| - | |
317 |
| - | |
318 |
| - | |
319 |
| - | |
320 |
| - | |
321 |
| - | |
322 |
| - | |
323 |
| - | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
324 | 347 |
| |
325 |
| - | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
326 | 353 |
| |
327 |
| - | |
328 |
| - | |
329 |
| - | |
330 |
| - | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
331 | 364 |
| |
332 | 365 |
| |
333 | 366 |
| |
| |||
582 | 615 |
| |
583 | 616 |
| |
584 | 617 |
| |
| 618 | + | |
585 | 619 |
| |
586 | 620 |
| |
587 | 621 |
| |
| |||
591 | 625 |
| |
592 | 626 |
| |
593 | 627 |
| |
594 |
| - | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
595 | 648 |
| |
596 | 649 |
| |
597 | 650 |
| |
| |||
608 | 661 |
| |
609 | 662 |
| |
610 | 663 |
| |
| 664 | + | |
611 | 665 |
| |
612 | 666 |
| |
613 | 667 |
| |
| |||
633 | 687 |
| |
634 | 688 |
| |
635 | 689 |
| |
636 |
| - | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
637 | 699 |
| |
638 | 700 |
| |
639 | 701 |
| |
| |||
687 | 749 |
| |
688 | 750 |
| |
689 | 751 |
| |
| 752 | + | |
690 | 753 |
| |
691 | 754 |
| |
692 | 755 |
| |
| |||
697 | 760 |
| |
698 | 761 |
| |
699 | 762 |
| |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
700 | 767 |
| |
701 | 768 |
| |
702 | 769 |
| |
703 | 770 |
| |
704 | 771 |
| |
705 | 772 |
| |
706 | 773 |
| |
| 774 | + | |
| 775 | + | |
707 | 776 |
| |
708 | 777 |
| |
709 | 778 |
| |
| |||
748 | 817 |
| |
749 | 818 |
| |
750 | 819 |
| |
751 |
| - | |
| 820 | + | |
752 | 821 |
| |
753 | 822 |
| |
754 | 823 |
| |
| |||
760 | 829 |
| |
761 | 830 |
| |
762 | 831 |
| |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
763 | 836 |
| |
764 | 837 |
| |
765 | 838 |
| |
| |||
805 | 878 |
| |
806 | 879 |
| |
807 | 880 |
| |
| 881 | + | |
| 882 | + | |
| 883 | + | |
808 | 884 |
| |
809 | 885 |
| |
810 | 886 |
| |
| |||
815 | 891 |
| |
816 | 892 |
| |
817 | 893 |
| |
| 894 | + | |
818 | 895 |
| |
819 | 896 |
| |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
820 | 907 |
| |
821 | 908 |
| |
822 | 909 |
| |
|
Lines changed: 9 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
807 | 807 |
| |
808 | 808 |
| |
809 | 809 |
| |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
810 | 819 |
| |
811 | 820 |
| |
812 | 821 |
| |
|
Lines changed: 9 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
507 | 507 |
| |
508 | 508 |
| |
509 | 509 |
| |
510 |
| - | |
| 510 | + | |
511 | 511 |
| |
512 | 512 |
| |
513 | 513 |
| |
| |||
1331 | 1331 |
| |
1332 | 1332 |
| |
1333 | 1333 |
| |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
1334 | 1338 |
| |
1335 | 1339 |
| |
1336 | 1340 |
| |
| |||
1351 | 1355 |
| |
1352 | 1356 |
| |
1353 | 1357 |
| |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
1354 | 1362 |
| |
1355 | 1363 |
| |
1356 | 1364 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
136 | 136 |
| |
137 | 137 |
| |
138 | 138 |
| |
| 139 | + | |
| 140 | + | |
139 | 141 |
| |
140 | 142 |
| |
141 | 143 |
| |
142 | 144 |
| |
143 | 145 |
| |
144 | 146 |
| |
| 147 | + | |
145 | 148 |
| |
146 | 149 |
| |
147 | 150 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
138 | 138 |
| |
139 | 139 |
| |
140 | 140 |
| |
| 141 | + | |
| 142 | + | |
141 | 143 |
| |
| 144 | + | |
142 | 145 |
| |
143 | 146 |
| |
144 | 147 |
| |
|
0 commit comments
Comments
(0)