- Notifications
You must be signed in to change notification settings - Fork5k
Commit475dbd0
committed
Track a Bitmapset of non-pruned partitions in RelOptInfo
For partitioned tables with large numbers of partitions where queries areable to prune all but a very small number of partitions, the time spent inthe planner looping over RelOptInfo.part_rels checking for non-NULLRelOptInfos could become a large portion of the overall planning time.Here we add a Bitmapset that records the non-pruned partitions. Thisallows us to more efficiently skip the pruned partitions by looping overthe Bitmapset.This will cause a very slight slow down in cases where no or not manypartitions could be pruned, however, those cases are already slow to plananyway and the overhead of looping over the Bitmapset would beunmeasurable when compared with the other tasks such as path creation fora large number of partitions.Reviewed-by: Amit Langote, Zhihong YuDiscussion:https://postgr.es/m/CAApHDvqnPx6JnUuPwaf5ao38zczrAb9mxt9gj4U1EKFfd4AqLA@mail.gmail.com1 parenta5cb4f9 commit475dbd0
File tree
7 files changed
+31
-17
lines changed- src
- backend
- nodes
- optimizer
- path
- plan
- util
- partitioning
- include/nodes
7 files changed
+31
-17
lines changedLines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2386 | 2386 |
| |
2387 | 2387 |
| |
2388 | 2388 |
| |
| 2389 | + | |
2389 | 2390 |
| |
2390 | 2391 |
| |
2391 | 2392 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1539 | 1539 |
| |
1540 | 1540 |
| |
1541 | 1541 |
| |
| 1542 | + | |
1542 | 1543 |
| |
1543 | 1544 |
| |
1544 | 1545 |
| |
|
Lines changed: 19 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6989 | 6989 |
| |
6990 | 6990 |
| |
6991 | 6991 |
| |
6992 |
| - | |
| 6992 | + | |
6993 | 6993 |
| |
6994 | 6994 |
| |
6995 |
| - | |
| 6995 | + | |
| 6996 | + | |
6996 | 6997 |
| |
6997 |
| - | |
| 6998 | + | |
6998 | 6999 |
| |
6999 | 7000 |
| |
7000 | 7001 |
| |
7001 | 7002 |
| |
7002 | 7003 |
| |
7003 |
| - | |
7004 |
| - | |
| 7004 | + | |
| 7005 | + | |
| 7006 | + | |
| 7007 | + | |
7005 | 7008 |
| |
7006 | 7009 |
| |
7007 | 7010 |
| |
| |||
7082 | 7085 |
| |
7083 | 7086 |
| |
7084 | 7087 |
| |
7085 |
| - | |
7086 |
| - | |
7087 | 7088 |
| |
7088 | 7089 |
| |
7089 | 7090 |
| |
7090 | 7091 |
| |
| 7092 | + | |
7091 | 7093 |
| |
7092 | 7094 |
| |
7093 | 7095 |
| |
7094 | 7096 |
| |
7095 | 7097 |
| |
7096 | 7098 |
| |
7097 |
| - | |
| 7099 | + | |
| 7100 | + | |
7098 | 7101 |
| |
7099 |
| - | |
7100 |
| - | |
| 7102 | + | |
| 7103 | + | |
7101 | 7104 |
| |
7102 | 7105 |
| |
7103 | 7106 |
| |
7104 | 7107 |
| |
7105 | 7108 |
| |
7106 | 7109 |
| |
7107 |
| - | |
7108 |
| - | |
| 7110 | + | |
| 7111 | + | |
| 7112 | + | |
| 7113 | + | |
7109 | 7114 |
| |
7110 | 7115 |
| |
| 7116 | + | |
| 7117 | + | |
7111 | 7118 |
| |
7112 | 7119 |
| |
7113 | 7120 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
348 | 348 |
| |
349 | 349 |
| |
350 | 350 |
| |
351 |
| - | |
| 351 | + | |
352 | 352 |
| |
353 | 353 |
| |
354 | 354 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
255 | 255 |
| |
256 | 256 |
| |
257 | 257 |
| |
| 258 | + | |
258 | 259 |
| |
259 | 260 |
| |
260 | 261 |
| |
| |||
669 | 670 |
| |
670 | 671 |
| |
671 | 672 |
| |
| 673 | + | |
672 | 674 |
| |
673 | 675 |
| |
674 | 676 |
| |
| |||
847 | 849 |
| |
848 | 850 |
| |
849 | 851 |
| |
| 852 | + | |
850 | 853 |
| |
851 | 854 |
| |
852 | 855 |
| |
|
Lines changed: 3 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
654 | 654 |
| |
655 | 655 |
| |
656 | 656 |
| |
657 |
| - | |
| 657 | + | |
| 658 | + | |
658 | 659 |
| |
659 | 660 |
| |
660 | 661 |
| |
661 | 662 |
| |
662 | 663 |
| |
663 |
| - | |
664 |
| - | |
665 |
| - | |
| 664 | + | |
666 | 665 |
| |
667 | 666 |
| |
668 | 667 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
762 | 762 |
| |
763 | 763 |
| |
764 | 764 |
| |
| 765 | + | |
| 766 | + | |
| 767 | + | |
765 | 768 |
| |
766 | 769 |
| |
767 | 770 |
| |
|
0 commit comments
Comments
(0)