forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit9ddef36
committed
Centralize executor's opening/closing of Relations for rangetable entries.
Create an array estate->es_relations[] paralleling the es_range_table,and store references to Relations (relcache entries) there, so that anygiven RT entry is opened and closed just once per executor run. Scannodes typically still call ExecOpenScanRelation, but ExecCloseScanRelationis no more; relation closing is now done centrally in ExecEndPlan.This is slightly more complex than one would expect because of theinteractions with relcache references held in ResultRelInfo nodes.The general convention is now that ResultRelInfo->ri_RelationDesc doesnot represent a separate relcache reference and so does not need to beexplicitly closed; but there is an exception for ResultRelInfos in thees_trig_target_relations list, which are manufactured byExecGetTriggerResultRel and have to be cleaned up byExecCleanUpTriggerState. (That much was true all along, but theseResultRelInfos are now more different from others than they used to be.)To allow the partition pruning logic to make use of es_relations[] ratherthan having its own relcache references, adjust PartitionedRelPruneInfoto store an RT index rather than a relation OID.Amit Langote, reviewed by David Rowley and Jesper Pedersen,some mods by meDiscussion:https://postgr.es/m/468c85d9-540e-66a2-1dde-fec2b741e688@lab.ntt.co.jp1 parentfb9e93a commit9ddef36
File tree
27 files changed
+144
-181
lines changed- contrib/postgres_fdw
- src
- backend
- catalog
- commands
- executor
- nodes
- optimizer/plan
- partitioning
- replication/logical
- include
- executor
- nodes
- partitioning
27 files changed
+144
-181
lines changedLines changed: 0 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2546 | 2546 |
| |
2547 | 2547 |
| |
2548 | 2548 |
| |
2549 |
| - | |
2550 |
| - | |
2551 |
| - | |
2552 |
| - | |
2553 | 2549 |
| |
2554 | 2550 |
| |
2555 | 2551 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
42 | 42 |
| |
43 | 43 |
| |
44 | 44 |
| |
45 |
| - | |
| 45 | + | |
46 | 46 |
| |
47 | 47 |
| |
48 | 48 |
| |
|
Lines changed: 3 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2471 | 2471 |
| |
2472 | 2472 |
| |
2473 | 2473 |
| |
2474 |
| - | |
| 2474 | + | |
2475 | 2475 |
| |
2476 | 2476 |
| |
2477 | 2477 |
| |
| |||
2485 | 2485 |
| |
2486 | 2486 |
| |
2487 | 2487 |
| |
| 2488 | + | |
| 2489 | + | |
2488 | 2490 |
| |
2489 | 2491 |
| |
2490 | 2492 |
| |
|
Lines changed: 40 additions & 36 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
824 | 824 |
| |
825 | 825 |
| |
826 | 826 |
| |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
827 | 836 |
| |
828 | 837 |
| |
829 | 838 |
| |
| |||
845 | 854 |
| |
846 | 855 |
| |
847 | 856 |
| |
848 |
| - | |
849 | 857 |
| |
850 | 858 |
| |
851 |
| - | |
852 |
| - | |
853 |
| - | |
854 |
| - | |
| 859 | + | |
| 860 | + | |
855 | 861 |
| |
856 | 862 |
| |
857 | 863 |
| |
| |||
886 | 892 |
| |
887 | 893 |
| |
888 | 894 |
| |
889 |
| - | |
890 | 895 |
| |
891 | 896 |
| |
892 |
| - | |
893 |
| - | |
894 |
| - | |
| 897 | + | |
| 898 | + | |
895 | 899 |
| |
896 | 900 |
| |
897 |
| - | |
| 901 | + | |
898 | 902 |
| |
899 | 903 |
| |
900 | 904 |
| |
| |||
967 | 971 |
| |
968 | 972 |
| |
969 | 973 |
| |
970 |
| - | |
971 |
| - | |
972 |
| - | |
973 |
| - | |
| 974 | + | |
974 | 975 |
| |
975 | 976 |
| |
976 | 977 |
| |
| |||
1483 | 1484 |
| |
1484 | 1485 |
| |
1485 | 1486 |
| |
1486 |
| - | |
1487 |
| - | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
1488 | 1500 |
| |
1489 | 1501 |
| |
1490 | 1502 |
| |
| |||
1607 | 1619 |
| |
1608 | 1620 |
| |
1609 | 1621 |
| |
| 1622 | + | |
1610 | 1623 |
| |
1611 | 1624 |
| |
1612 | 1625 |
| |
| |||
1634 | 1647 |
| |
1635 | 1648 |
| |
1636 | 1649 |
| |
1637 |
| - | |
| 1650 | + | |
| 1651 | + | |
1638 | 1652 |
| |
1639 | 1653 |
| |
1640 | 1654 |
| |
1641 | 1655 |
| |
1642 |
| - | |
1643 | 1656 |
| |
1644 |
| - | |
1645 | 1657 |
| |
1646 | 1658 |
| |
1647 | 1659 |
| |
1648 |
| - | |
1649 |
| - | |
1650 |
| - | |
| 1660 | + | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
1651 | 1666 |
| |
1652 |
| - | |
1653 |
| - | |
| 1667 | + | |
| 1668 | + | |
1654 | 1669 |
| |
1655 | 1670 |
| |
1656 | 1671 |
| |
1657 | 1672 |
| |
1658 |
| - | |
1659 |
| - | |
1660 |
| - | |
1661 |
| - | |
1662 |
| - | |
1663 |
| - | |
1664 |
| - | |
1665 |
| - | |
1666 |
| - | |
1667 |
| - | |
1668 |
| - | |
1669 |
| - | |
1670 | 1673 |
| |
1671 | 1674 |
| |
1672 | 1675 |
| |
| |||
3161 | 3164 |
| |
3162 | 3165 |
| |
3163 | 3166 |
| |
| 3167 | + | |
3164 | 3168 |
| |
3165 | 3169 |
| |
3166 | 3170 |
| |
|
Lines changed: 10 additions & 36 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
219 | 219 |
| |
220 | 220 |
| |
221 | 221 |
| |
222 |
| - | |
| 222 | + | |
223 | 223 |
| |
224 | 224 |
| |
225 | 225 |
| |
| |||
1389 | 1389 |
| |
1390 | 1390 |
| |
1391 | 1391 |
| |
1392 |
| - | |
1393 |
| - | |
1394 |
| - | |
1395 | 1392 |
| |
1396 | 1393 |
| |
1397 | 1394 |
| |
| |||
1433 | 1430 |
| |
1434 | 1431 |
| |
1435 | 1432 |
| |
| 1433 | + | |
1436 | 1434 |
| |
1437 | 1435 |
| |
1438 | 1436 |
| |
| |||
1487 | 1485 |
| |
1488 | 1486 |
| |
1489 | 1487 |
| |
| 1488 | + | |
1490 | 1489 |
| |
1491 | 1490 |
| |
1492 | 1491 |
| |
| |||
1509 | 1508 |
| |
1510 | 1509 |
| |
1511 | 1510 |
| |
1512 |
| - | |
1513 |
| - | |
1514 |
| - | |
1515 |
| - | |
1516 |
| - | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
1517 | 1515 |
| |
1518 |
| - | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
1519 | 1519 |
| |
1520 |
| - | |
1521 |
| - | |
1522 | 1520 |
| |
1523 | 1521 |
| |
1524 | 1522 |
| |
| |||
1595 | 1593 |
| |
1596 | 1594 |
| |
1597 | 1595 |
| |
1598 |
| - | |
1599 |
| - | |
1600 |
| - | |
1601 |
| - | |
1602 |
| - | |
1603 |
| - | |
1604 |
| - | |
1605 |
| - | |
1606 |
| - | |
1607 |
| - | |
1608 |
| - | |
1609 |
| - | |
1610 |
| - | |
1611 |
| - | |
1612 |
| - | |
1613 |
| - | |
1614 |
| - | |
1615 |
| - | |
1616 |
| - | |
1617 |
| - | |
1618 |
| - | |
1619 |
| - | |
1620 |
| - | |
1621 |
| - | |
1622 | 1596 |
| |
1623 | 1597 |
| |
1624 | 1598 |
| |
|
Lines changed: 36 additions & 24 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
25 | 25 |
| |
26 | 26 |
| |
27 | 27 |
| |
28 |
| - | |
| 28 | + | |
| 29 | + | |
29 | 30 |
| |
30 | 31 |
| |
31 | 32 |
| |
| |||
107 | 108 |
| |
108 | 109 |
| |
109 | 110 |
| |
| 111 | + | |
110 | 112 |
| |
111 | 113 |
| |
112 | 114 |
| |
| |||
648 | 650 |
| |
649 | 651 |
| |
650 | 652 |
| |
651 |
| - | |
652 | 653 |
| |
653 |
| - | |
654 |
| - | |
655 |
| - | |
656 |
| - | |
657 |
| - | |
658 |
| - | |
659 |
| - | |
| 654 | + | |
| 655 | + | |
660 | 656 |
| |
661 | 657 |
| |
662 | 658 |
| |
| |||
674 | 670 |
| |
675 | 671 |
| |
676 | 672 |
| |
677 |
| - | |
678 |
| - | |
679 |
| - | |
680 |
| - | |
681 |
| - | |
682 |
| - | |
683 |
| - | |
684 |
| - | |
685 |
| - | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
686 | 676 |
| |
687 |
| - | |
688 |
| - | |
689 |
| - | |
| 677 | + | |
690 | 678 |
| |
691 |
| - | |
692 |
| - | |
| 679 | + | |
| 680 | + | |
693 | 681 |
| |
694 |
| - | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
695 | 707 |
| |
696 | 708 |
| |
697 | 709 |
| |
|
Lines changed: 0 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
335 | 335 |
| |
336 | 336 |
| |
337 | 337 |
| |
338 |
| - | |
339 |
| - | |
340 |
| - | |
341 |
| - | |
342 |
| - | |
343 |
| - | |
344 | 338 |
| |
345 | 339 |
| |
346 | 340 |
| |
|
0 commit comments
Comments
(0)