forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit1375422
committed
Create ResultRelInfos later in InitPlan, index them by RT index.
Instead of allocating all the ResultRelInfos upfront in one big array,allocate them in ExecInitModifyTable(). es_result_relations is now anarray of ResultRelInfo pointers, rather than an array of structs, and itis indexed by the RT index.This simplifies things: we get rid of the separate concept of a "resultrel index", and don't need to set it in setrefs.c anymore. This alsoallows follow-up optimizations (not included in this commit yet) to skipinitializing ResultRelInfos for target relations that were not needed atruntime, and removal of the es_result_relation_info pointer.The EState arrays of regular result rels and root result rels are mergedinto one array. Similarly, the resultRelations and rootResultRelationslists in PlannedStmt are merged into one. It's not actually clear to mewhy they were kept separate in the first place, but now that thees_result_relations array is indexed by RT index, it certainly seemspointless.The PlannedStmt->resultRelations list is now only needed forExecRelationIsTargetRelation(). One visible effect of this change is thatExecRelationIsTargetRelation() will now return 'true' also for thepartition root, if a partitioned table is updated. That seems like a goodthing, although the function isn't used in core code, and I don't see anyreason for an FDW to call it on a partition root.Author: Amit LangoteDiscussion:https://www.postgresql.org/message-id/CA%2BHiwqGEmiib8FLiHMhKB%2BCH5dRgHSLc5N5wnvc4kym%2BZYpQEQ%40mail.gmail.com1 parent2050832 commit1375422
File tree
19 files changed
+184
-303
lines changed- src
- backend
- commands
- executor
- nodes
- optimizer/plan
- replication/logical
- include
- executor
- nodes
19 files changed
+184
-303
lines changedLines changed: 8 additions & 16 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2727 | 2727 |
| |
2728 | 2728 |
| |
2729 | 2729 |
| |
| 2730 | + | |
2730 | 2731 |
| |
2731 | 2732 |
| |
2732 | 2733 |
| |
| |||
2829 | 2830 |
| |
2830 | 2831 |
| |
2831 | 2832 |
| |
2832 |
| - | |
2833 |
| - | |
2834 |
| - | |
2835 |
| - | |
2836 |
| - | |
2837 |
| - | |
2838 |
| - | |
| 2833 | + | |
| 2834 | + | |
| 2835 | + | |
2839 | 2836 |
| |
2840 | 2837 |
| |
2841 | 2838 |
| |
2842 | 2839 |
| |
2843 | 2840 |
| |
2844 | 2841 |
| |
2845 |
| - | |
2846 |
| - | |
2847 | 2842 |
| |
2848 | 2843 |
| |
2849 |
| - | |
2850 |
| - | |
2851 | 2844 |
| |
2852 | 2845 |
| |
2853 | 2846 |
| |
| |||
2856 | 2849 |
| |
2857 | 2850 |
| |
2858 | 2851 |
| |
2859 |
| - | |
| 2852 | + | |
2860 | 2853 |
| |
2861 | 2854 |
| |
2862 | 2855 |
| |
| |||
3359 | 3352 |
| |
3360 | 3353 |
| |
3361 | 3354 |
| |
3362 |
| - | |
3363 |
| - | |
3364 | 3355 |
| |
3365 | 3356 |
| |
3366 | 3357 |
| |
3367 | 3358 |
| |
3368 |
| - | |
3369 |
| - | |
| 3359 | + | |
| 3360 | + | |
| 3361 | + | |
3370 | 3362 |
| |
3371 | 3363 |
| |
3372 | 3364 |
| |
|
Lines changed: 7 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
769 | 769 |
| |
770 | 770 |
| |
771 | 771 |
| |
772 |
| - | |
773 |
| - | |
| 772 | + | |
774 | 773 |
| |
775 | 774 |
| |
776 |
| - | |
777 | 775 |
| |
778 | 776 |
| |
| 777 | + | |
779 | 778 |
| |
780 | 779 |
| |
781 | 780 |
| |
782 | 781 |
| |
783 | 782 |
| |
784 |
| - | |
| 783 | + | |
785 | 784 |
| |
786 |
| - | |
787 |
| - | |
788 |
| - | |
789 |
| - | |
790 |
| - | |
791 |
| - | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
792 | 788 |
| |
| 789 | + | |
793 | 790 |
| |
794 | 791 |
| |
795 | 792 |
| |
|
Lines changed: 7 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1787 | 1787 |
| |
1788 | 1788 |
| |
1789 | 1789 |
| |
| 1790 | + | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
| 1794 | + | |
1790 | 1795 |
| |
1791 | 1796 |
| |
1792 | 1797 |
| |
| |||
1801 | 1806 |
| |
1802 | 1807 |
| |
1803 | 1808 |
| |
| 1809 | + | |
| 1810 | + | |
1804 | 1811 |
| |
1805 | 1812 |
| |
1806 |
| - | |
1807 |
| - | |
1808 | 1813 |
| |
1809 | 1814 |
| |
1810 | 1815 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4227 | 4227 |
| |
4228 | 4228 |
| |
4229 | 4229 |
| |
4230 |
| - | |
| 4230 | + | |
4231 | 4231 |
| |
4232 | 4232 |
| |
4233 | 4233 |
| |
|
0 commit comments
Comments
(0)