forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitf0e4475
committed
Implement table partitioning.
Table partitioning is like table inheritance and reuses much of theexisting infrastructure, but there are some important differences.The parent is called a partitioned table and is always empty; it maynot have indexes or non-inherited constraints, since those make nosense for a relation with no data of its own. The children are calledpartitions and contain all of the actual data. Each partition has animplicit partitioning constraint. Multiple inheritance is notallowed, and partitioning and inheritance can't be mixed. Partitionscan't have extra columns and may not allow nulls unless the parentdoes. Tuples inserted into the parent are automatically routed to thecorrect partition, so tuple-routing ON INSERT triggers are not needed.Tuple routing isn't yet supported for partitions which are foreigntables, and it doesn't handle updates that cross partition boundaries.Currently, tables can be range-partitioned or list-partitioned. Listpartitioning is limited to a single column, but range partitioning caninvolve multiple columns. A partitioning "column" can be anexpression.Because table partitioning is less general than table inheritance, itis hoped that it will be easier to reason about properties ofpartitions, and therefore that this will serve as a better foundationfor a variety of possible optimizations, including query planneroptimizations. The tuple routing based which this patch does based onthe implicit partitioning constraints is an example of this, but itseems likely that many other useful optimizations are also possible.Amit Langote, reviewed and tested by Robert Haas, Ashutosh Bapat,Amit Kapila, Rajkumar Raghuwanshi, Corey Huinker, Jaime Casanova,Rushabh Lathia, Erik Rijkers, among others. Minor revisions by me.1 parentb7e1ae2 commitf0e4475
File tree
85 files changed
+8886
-271
lines changed- doc/src/sgml
- ref
- src
- backend
- access/common
- catalog
- commands
- executor
- nodes
- optimizer/util
- parser
- rewrite
- tcop
- utils
- adt
- cache
- bin
- pg_dump
- psql
- include
- catalog
- commands
- executor
- nodes
- parser
- utils
- test/regress
- expected
- sql
- tools/pgindent
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
85 files changed
+8886
-271
lines changedLines changed: 128 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
225 | 225 |
| |
226 | 226 |
| |
227 | 227 |
| |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
228 | 233 |
| |
229 | 234 |
| |
230 | 235 |
| |
| |||
1723 | 1728 |
| |
1724 | 1729 |
| |
1725 | 1730 |
| |
1726 |
| - | |
| 1731 | + | |
| 1732 | + | |
1727 | 1733 |
| |
1728 | 1734 |
| |
1729 | 1735 |
| |
| |||
1839 | 1845 |
| |
1840 | 1846 |
| |
1841 | 1847 |
| |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
| 1851 | + | |
| 1852 | + | |
| 1853 | + | |
| 1854 | + | |
1842 | 1855 |
| |
1843 | 1856 |
| |
1844 | 1857 |
| |
| |||
1885 | 1898 |
| |
1886 | 1899 |
| |
1887 | 1900 |
| |
| 1901 | + | |
| 1902 | + | |
| 1903 | + | |
| 1904 | + | |
| 1905 | + | |
| 1906 | + | |
| 1907 | + | |
| 1908 | + | |
| 1909 | + | |
| 1910 | + | |
1888 | 1911 |
| |
1889 | 1912 |
| |
1890 | 1913 |
| |
| |||
4689 | 4712 |
| |
4690 | 4713 |
| |
4691 | 4714 |
| |
| 4715 | + | |
| 4716 | + | |
| 4717 | + | |
| 4718 | + | |
| 4719 | + | |
| 4720 | + | |
| 4721 | + | |
| 4722 | + | |
| 4723 | + | |
| 4724 | + | |
| 4725 | + | |
| 4726 | + | |
| 4727 | + | |
| 4728 | + | |
| 4729 | + | |
| 4730 | + | |
| 4731 | + | |
| 4732 | + | |
| 4733 | + | |
| 4734 | + | |
| 4735 | + | |
| 4736 | + | |
| 4737 | + | |
| 4738 | + | |
| 4739 | + | |
| 4740 | + | |
| 4741 | + | |
| 4742 | + | |
| 4743 | + | |
| 4744 | + | |
| 4745 | + | |
| 4746 | + | |
| 4747 | + | |
| 4748 | + | |
| 4749 | + | |
| 4750 | + | |
| 4751 | + | |
| 4752 | + | |
| 4753 | + | |
| 4754 | + | |
| 4755 | + | |
| 4756 | + | |
| 4757 | + | |
| 4758 | + | |
| 4759 | + | |
| 4760 | + | |
| 4761 | + | |
| 4762 | + | |
| 4763 | + | |
| 4764 | + | |
| 4765 | + | |
| 4766 | + | |
| 4767 | + | |
| 4768 | + | |
| 4769 | + | |
| 4770 | + | |
| 4771 | + | |
| 4772 | + | |
| 4773 | + | |
| 4774 | + | |
| 4775 | + | |
| 4776 | + | |
| 4777 | + | |
| 4778 | + | |
| 4779 | + | |
| 4780 | + | |
| 4781 | + | |
| 4782 | + | |
| 4783 | + | |
| 4784 | + | |
| 4785 | + | |
| 4786 | + | |
| 4787 | + | |
| 4788 | + | |
| 4789 | + | |
| 4790 | + | |
| 4791 | + | |
| 4792 | + | |
| 4793 | + | |
| 4794 | + | |
| 4795 | + | |
| 4796 | + | |
| 4797 | + | |
| 4798 | + | |
| 4799 | + | |
| 4800 | + | |
| 4801 | + | |
| 4802 | + | |
| 4803 | + | |
| 4804 | + | |
| 4805 | + | |
| 4806 | + | |
| 4807 | + | |
| 4808 | + | |
| 4809 | + | |
| 4810 | + | |
| 4811 | + | |
| 4812 | + | |
| 4813 | + | |
| 4814 | + | |
| 4815 | + | |
| 4816 | + | |
| 4817 | + | |
| 4818 | + | |
4692 | 4819 |
| |
4693 | 4820 |
| |
4694 | 4821 |
| |
|
Lines changed: 113 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
33 | 33 |
| |
34 | 34 |
| |
35 | 35 |
| |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
36 | 40 |
| |
37 | 41 |
| |
38 | 42 |
| |
| |||
166 | 170 |
| |
167 | 171 |
| |
168 | 172 |
| |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
169 | 179 |
| |
170 | 180 |
| |
171 | 181 |
| |
| |||
704 | 714 |
| |
705 | 715 |
| |
706 | 716 |
| |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
707 | 766 |
| |
708 | 767 |
| |
709 | 768 |
| |
710 | 769 |
| |
711 | 770 |
| |
712 |
| - | |
713 |
| - | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
714 | 774 |
| |
715 | 775 |
| |
716 | 776 |
| |
| |||
721 | 781 |
| |
722 | 782 |
| |
723 | 783 |
| |
724 |
| - | |
725 |
| - | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
726 | 787 |
| |
727 | 788 |
| |
728 | 789 |
| |
| |||
938 | 999 |
| |
939 | 1000 |
| |
940 | 1001 |
| |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
941 | 1021 |
| |
942 | 1022 |
| |
943 | 1023 |
| |
| |||
977 | 1057 |
| |
978 | 1058 |
| |
979 | 1059 |
| |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
980 | 1065 |
| |
981 | 1066 |
| |
982 | 1067 |
| |
| |||
1047 | 1132 |
| |
1048 | 1133 |
| |
1049 | 1134 |
| |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
1050 | 1138 |
| |
1051 | 1139 |
| |
1052 | 1140 |
| |
| |||
1233 | 1321 |
| |
1234 | 1322 |
| |
1235 | 1323 |
| |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
1236 | 1345 |
| |
1237 | 1346 |
| |
1238 | 1347 |
| |
|
Lines changed: 26 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
27 | 27 |
| |
28 | 28 |
| |
29 | 29 |
| |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
30 | 39 |
| |
31 | 40 |
| |
32 | 41 |
| |
| |||
67 | 76 |
| |
68 | 77 |
| |
69 | 78 |
| |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
70 | 85 |
| |
71 | 86 |
| |
72 | 87 |
| |
| |||
314 | 329 |
| |
315 | 330 |
| |
316 | 331 |
| |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
317 | 343 |
| |
318 | 344 |
| |
319 | 345 |
| |
|
0 commit comments
Comments
(0)