forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit8b08f7d
committed
Local partitioned indexes
When CREATE INDEX is run on a partitioned table, create catalog entriesfor an index on the partitioned table (which is just a placeholder sincethe table proper has no data of its own), and recurse to create actualindexes on the existing partitions; create them in future partitionsalso.As a convenience gadget, if the new index definition matches someexisting index in partitions, these are picked up and used instead ofcreating new ones. Whichever way these indexes come about, they becomeattached to the index on the parent table and are dropped alongside it,and cannot be dropped on isolation unless they are detached first.To support pg_dump'ing these indexes, add commands CREATE INDEX ON ONLY <table>(which creates the index on the parent partitioned table, withoutrecursing) and ALTER INDEX ATTACH PARTITION(which is used after the indexes have been created individually on eachpartition, to attach them to the parent index). These reconstruct priordatabase state exactly.Reviewed-by: (in alphabetical order) Peter Eisentraut, Robert Haas, AmitLangote, Jesper Pedersen, Simon Riggs, David RowleyDiscussion:https://postgr.es/m/20171113170646.gzweigyrgg6pwsg4@alvherre.pgsql1 parent1ef61dd commit8b08f7d
File tree
49 files changed
+3172
-182
lines changed- doc/src/sgml
- ref
- src
- backend
- access
- common
- heap
- index
- bootstrap
- catalog
- commands
- nodes
- parser
- tcop
- utils
- adt
- cache
- bin
- pg_dump
- t
- psql
- include
- catalog
- commands
- nodes
- parser
- test/regress
- expected
- sql
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
49 files changed
+3172
-182
lines changedLines changed: 23 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2995 | 2995 |
| |
2996 | 2996 |
| |
2997 | 2997 |
| |
| 2998 | + | |
| 2999 | + | |
| 3000 | + | |
| 3001 | + | |
| 3002 | + | |
| 3003 | + | |
| 3004 | + | |
| 3005 | + | |
| 3006 | + | |
| 3007 | + | |
| 3008 | + | |
| 3009 | + | |
| 3010 | + | |
| 3011 | + | |
| 3012 | + | |
| 3013 | + | |
| 3014 | + | |
| 3015 | + | |
| 3016 | + | |
| 3017 | + | |
| 3018 | + | |
| 3019 | + | |
| 3020 | + | |
2998 | 3021 |
| |
2999 | 3022 |
| |
3000 | 3023 |
| |
|
Lines changed: 14 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
23 | 23 |
| |
24 | 24 |
| |
25 | 25 |
| |
| 26 | + | |
26 | 27 |
| |
27 | 28 |
| |
28 | 29 |
| |
| |||
75 | 76 |
| |
76 | 77 |
| |
77 | 78 |
| |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
78 | 92 |
| |
79 | 93 |
| |
80 | 94 |
| |
|
Lines changed: 6 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
805 | 805 |
| |
806 | 806 |
| |
807 | 807 |
| |
808 |
| - | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
809 | 812 |
| |
810 | 813 |
| |
811 | 814 |
| |
| |||
866 | 869 |
| |
867 | 870 |
| |
868 | 871 |
| |
869 |
| - | |
| 872 | + | |
| 873 | + | |
870 | 874 |
| |
871 | 875 |
| |
872 | 876 |
| |
|
Lines changed: 32 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
21 | 21 |
| |
22 | 22 |
| |
23 | 23 |
| |
24 |
| - | |
| 24 | + | |
25 | 25 |
| |
26 | 26 |
| |
27 | 27 |
| |
| |||
151 | 151 |
| |
152 | 152 |
| |
153 | 153 |
| |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
154 | 164 |
| |
155 | 165 |
| |
156 | 166 |
| |
| |||
545 | 555 |
| |
546 | 556 |
| |
547 | 557 |
| |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
548 | 579 |
| |
549 | 580 |
| |
550 | 581 |
| |
|
Lines changed: 5 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
231 | 231 |
| |
232 | 232 |
| |
233 | 233 |
| |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
234 | 239 |
| |
235 | 240 |
| |
236 | 241 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
993 | 993 |
| |
994 | 994 |
| |
995 | 995 |
| |
| 996 | + | |
996 | 997 |
| |
997 | 998 |
| |
998 | 999 |
| |
|
Lines changed: 6 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1293 | 1293 |
| |
1294 | 1294 |
| |
1295 | 1295 |
| |
1296 |
| - | |
| 1296 | + | |
| 1297 | + | |
1297 | 1298 |
| |
1298 | 1299 |
| |
1299 | 1300 |
| |
| |||
1321 | 1322 |
| |
1322 | 1323 |
| |
1323 | 1324 |
| |
1324 |
| - | |
| 1325 | + | |
| 1326 | + | |
1325 | 1327 |
| |
1326 | 1328 |
| |
1327 | 1329 |
| |
| |||
1353 | 1355 |
| |
1354 | 1356 |
| |
1355 | 1357 |
| |
1356 |
| - | |
| 1358 | + | |
| 1359 | + | |
1357 | 1360 |
| |
1358 | 1361 |
| |
1359 | 1362 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
154 | 154 |
| |
155 | 155 |
| |
156 | 156 |
| |
157 |
| - | |
| 157 | + | |
| 158 | + | |
158 | 159 |
| |
159 | 160 |
| |
160 | 161 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
321 | 321 |
| |
322 | 322 |
| |
323 | 323 |
| |
| 324 | + | |
324 | 325 |
| |
325 | 326 |
| |
326 | 327 |
| |
| |||
365 | 366 |
| |
366 | 367 |
| |
367 | 368 |
| |
| 369 | + | |
368 | 370 |
| |
369 | 371 |
| |
370 | 372 |
| |
|
Lines changed: 6 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1824 | 1824 |
| |
1825 | 1825 |
| |
1826 | 1826 |
| |
1827 |
| - | |
| 1827 | + | |
| 1828 | + | |
1828 | 1829 |
| |
1829 | 1830 |
| |
1830 | 1831 |
| |
| |||
5405 | 5406 |
| |
5406 | 5407 |
| |
5407 | 5408 |
| |
5408 |
| - | |
| 5409 | + | |
| 5410 | + | |
5409 | 5411 |
| |
5410 | 5412 |
| |
5411 | 5413 |
| |
| |||
5690 | 5692 |
| |
5691 | 5693 |
| |
5692 | 5694 |
| |
5693 |
| - | |
| 5695 | + | |
| 5696 | + | |
5694 | 5697 |
| |
5695 | 5698 |
| |
5696 | 5699 |
| |
|
Lines changed: 13 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
582 | 582 |
| |
583 | 583 |
| |
584 | 584 |
| |
| 585 | + | |
585 | 586 |
| |
586 | 587 |
| |
587 | 588 |
| |
| |||
633 | 634 |
| |
634 | 635 |
| |
635 | 636 |
| |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
636 | 645 |
| |
637 | 646 |
| |
638 | 647 |
| |
| |||
675 | 684 |
| |
676 | 685 |
| |
677 | 686 |
| |
| 687 | + | |
678 | 688 |
| |
679 | 689 |
| |
680 | 690 |
| |
| |||
762 | 772 |
| |
763 | 773 |
| |
764 | 774 |
| |
| 775 | + | |
765 | 776 |
| |
766 | 777 |
| |
767 | 778 |
| |
| |||
1109 | 1120 |
| |
1110 | 1121 |
| |
1111 | 1122 |
| |
1112 |
| - | |
| 1123 | + | |
| 1124 | + | |
1113 | 1125 |
| |
1114 | 1126 |
| |
1115 | 1127 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
294 | 294 |
| |
295 | 295 |
| |
296 | 296 |
| |
| 297 | + | |
297 | 298 |
| |
298 | 299 |
| |
299 | 300 |
| |
|
0 commit comments
Comments
(0)