- Notifications
You must be signed in to change notification settings - Fork5.2k
Commit8224de4
committed
Indexes with INCLUDE columns and their support in B-tree
This patch introduces INCLUDE clause to index definition. This clausespecifies a list of columns which will be included as a non-key part inthe index. The INCLUDE columns exist solely to allow more queries tobenefit from index-only scans. Also, such columns don't need to haveappropriate operator classes. Expressions are not supported as INCLUDEcolumns since they cannot be used in index-only scans.Index access methods supporting INCLUDE are indicated by amcaninclude flagin IndexAmRoutine. For now, only B-tree indexes support INCLUDE clause.In B-tree indexes INCLUDE columns are truncated from pivot index tuples(tuples located in non-leaf pages and high keys). Therefore, B-tree indexesnow might have variable number of attributes. This patch also providesgeneric facility to support that: pivot tuples contain number of theirattributes in t_tid.ip_posid. Free 13th bit of t_info is used for indicatingthat. This facility will simplify further support of index suffix truncation.The changes of above are backward-compatible, pg_upgrade doesn't need specialhandling of B-tree indexes for that.Bump catalog versionAuthor: Anastasia Lubennikova with contribition by Alexander Korotkov and meReviewed by: Peter Geoghegan, Tomas Vondra, Antonin Houska, Jeff Janes, David Rowley, Alexander KorotkovDiscussion:https://www.postgresql.org/message-id/flat/56168952.4010101@postgrespro.ru1 parent01bb851 commit8224de4
File tree
89 files changed
+2115
-470
lines changed- contrib
- amcheck
- expected
- sql
- bloom
- dblink
- expected
- sql
- tcn
- doc/src/sgml
- ref
- src
- backend
- access
- brin
- common
- gin
- gist
- hash
- heap
- index
- nbtree
- rmgrdesc
- spgist
- bootstrap
- catalog
- commands
- executor
- nodes
- optimizer
- path
- util
- parser
- utils
- adt
- cache
- sort
- bin/pg_dump
- include
- access
- catalog
- nodes
- parser
- utils
- test
- isolation/specs
- regress
- expected
- sql
- subscription/t
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
89 files changed
+2115
-470
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
| 10 | + | |
| 11 | + | |
8 | 12 | | |
9 | 13 | | |
10 | 14 | | |
| |||
93 | 97 | | |
94 | 98 | | |
95 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
96 | 141 | | |
97 | 142 | | |
98 | 143 | | |
| 144 | + | |
99 | 145 | | |
100 | 146 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| 12 | + | |
| 13 | + | |
10 | 14 | | |
11 | 15 | | |
12 | 16 | | |
| |||
57 | 61 | | |
58 | 62 | | |
59 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
60 | 78 | | |
61 | 79 | | |
62 | 80 | | |
| 81 | + | |
63 | 82 | | |
64 | 83 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
617 | 617 | | |
618 | 618 | | |
619 | 619 | | |
620 | | - | |
| 620 | + | |
621 | 621 | | |
622 | 622 | | |
623 | 623 | | |
| |||
722 | 722 | | |
723 | 723 | | |
724 | 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 | + | |
725 | 758 | | |
726 | 759 | | |
727 | 760 | | |
| |||
760 | 793 | | |
761 | 794 | | |
762 | 795 | | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
763 | 820 | | |
764 | 821 | | |
765 | 822 | | |
| |||
802 | 859 | | |
803 | 860 | | |
804 | 861 | | |
805 | | - | |
806 | | - | |
| 862 | + | |
| 863 | + | |
807 | 864 | | |
808 | 865 | | |
809 | 866 | | |
| |||
834 | 891 | | |
835 | 892 | | |
836 | 893 | | |
837 | | - | |
838 | | - | |
| 894 | + | |
| 895 | + | |
839 | 896 | | |
840 | 897 | | |
841 | 898 | | |
842 | 899 | | |
843 | 900 | | |
844 | 901 | | |
845 | 902 | | |
846 | | - | |
847 | | - | |
| 903 | + | |
| 904 | + | |
848 | 905 | | |
849 | 906 | | |
850 | 907 | | |
| |||
932 | 989 | | |
933 | 990 | | |
934 | 991 | | |
935 | | - | |
| 992 | + | |
936 | 993 | | |
937 | 994 | | |
938 | 995 | | |
| |||
1326 | 1383 | | |
1327 | 1384 | | |
1328 | 1385 | | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
1329 | 1391 | | |
1330 | 1392 | | |
1331 | 1393 | | |
| |||
1336 | 1398 | | |
1337 | 1399 | | |
1338 | 1400 | | |
1339 | | - | |
1340 | | - | |
| 1401 | + | |
| 1402 | + | |
1341 | 1403 | | |
1342 | 1404 | | |
1343 | 1405 | | |
| |||
1368 | 1430 | | |
1369 | 1431 | | |
1370 | 1432 | | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
1371 | 1437 | | |
1372 | 1438 | | |
1373 | 1439 | | |
| |||
1391 | 1457 | | |
1392 | 1458 | | |
1393 | 1459 | | |
1394 | | - | |
| 1460 | + | |
1395 | 1461 | | |
1396 | 1462 | | |
1397 | | - | |
| 1463 | + | |
1398 | 1464 | | |
1399 | 1465 | | |
1400 | 1466 | | |
| |||
1410 | 1476 | | |
1411 | 1477 | | |
1412 | 1478 | | |
1413 | | - | |
| 1479 | + | |
1414 | 1480 | | |
1415 | 1481 | | |
1416 | | - | |
| 1482 | + | |
1417 | 1483 | | |
1418 | 1484 | | |
1419 | 1485 | | |
| |||
1433 | 1499 | | |
1434 | 1500 | | |
1435 | 1501 | | |
1436 | | - | |
| 1502 | + | |
1437 | 1503 | | |
1438 | 1504 | | |
1439 | | - | |
| 1505 | + | |
1440 | 1506 | | |
1441 | 1507 | | |
1442 | 1508 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| 123 | + | |
123 | 124 | | |
124 | 125 | | |
125 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
| 103 | + | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| |||
1493 | 1493 | | |
1494 | 1494 | | |
1495 | 1495 | | |
1496 | | - | |
| 1496 | + | |
1497 | 1497 | | |
1498 | 1498 | | |
1499 | 1499 | | |
| |||
1519 | 1519 | | |
1520 | 1520 | | |
1521 | 1521 | | |
1522 | | - | |
| 1522 | + | |
1523 | 1523 | | |
1524 | 1524 | | |
1525 | 1525 | | |
| |||
1539 | 1539 | | |
1540 | 1540 | | |
1541 | 1541 | | |
1542 | | - | |
| 1542 | + | |
1543 | 1543 | | |
1544 | | - | |
| 1544 | + | |
1545 | 1545 | | |
1546 | 1546 | | |
1547 | 1547 | | |
| |||
2029 | 2029 | | |
2030 | 2030 | | |
2031 | 2031 | | |
2032 | | - | |
| 2032 | + | |
2033 | 2033 | | |
2034 | 2034 | | |
2035 | | - | |
| 2035 | + | |
2036 | 2036 | | |
2037 | 2037 | | |
2038 | 2038 | | |
| |||
2042 | 2042 | | |
2043 | 2043 | | |
2044 | 2044 | | |
2045 | | - | |
2046 | | - | |
| 2045 | + | |
| 2046 | + | |
2047 | 2047 | | |
2048 | 2048 | | |
2049 | 2049 | | |
| |||
2064 | 2064 | | |
2065 | 2065 | | |
2066 | 2066 | | |
2067 | | - | |
2068 | | - | |
| 2067 | + | |
| 2068 | + | |
2069 | 2069 | | |
2070 | | - | |
| 2070 | + | |
2071 | 2071 | | |
2072 | | - | |
| 2072 | + | |
2073 | 2073 | | |
2074 | 2074 | | |
2075 | 2075 | | |
| |||
0 commit comments
Comments
(0)