forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit186cbbd
committed
Provide hashing support for arrays.
The core of this patch is hash_array() and associated typcacheinfrastructure, which works just about exactly like the existing supportfor array comparison.In addition I did some work to ensure that the planner won't think that anarray type is hashable unless its element type is hashable, and similarlyfor sorting. This includes adding a datatype parameter to op_hashjoinableand op_mergejoinable, and adding an explicit "hashable" flag toSortGroupClause. The lack of a cross-check on the element type was apre-existing bug in mergejoin support --- but it didn't matter so muchbefore, because if you couldn't sort the element type there wasn't any goodalternative to failing anyhow. Now that we have the alternative of hashingthe array type, there are cases where we can avoid a failure by being pickyat the planner stage, so it's time to be picky.The issue of exactly how to combine the per-element hash values to producean array hash is still open for discussion, but the rest of this is prettysolid, so I'll commit it as-is.1 parentbd1ff97 commit186cbbd
File tree
30 files changed
+375
-88
lines changed- src
- backend
- commands
- nodes
- optimizer
- path
- plan
- util
- parser
- utils
- adt
- cache
- include
- catalog
- nodes
- parser
- utils
30 files changed
+375
-88
lines changedLines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1794 | 1794 |
| |
1795 | 1795 |
| |
1796 | 1796 |
| |
1797 |
| - | |
| 1797 | + | |
| 1798 | + | |
1798 | 1799 |
| |
1799 | 1800 |
| |
1800 | 1801 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1882 | 1882 |
| |
1883 | 1883 |
| |
1884 | 1884 |
| |
| 1885 | + | |
1885 | 1886 |
| |
1886 | 1887 |
| |
1887 | 1888 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2227 | 2227 |
| |
2228 | 2228 |
| |
2229 | 2229 |
| |
| 2230 | + | |
2230 | 2231 |
| |
2231 | 2232 |
| |
2232 | 2233 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2073 | 2073 |
| |
2074 | 2074 |
| |
2075 | 2075 |
| |
| 2076 | + | |
2076 | 2077 |
| |
2077 | 2078 |
| |
2078 | 2079 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
264 | 264 |
| |
265 | 265 |
| |
266 | 266 |
| |
| 267 | + | |
267 | 268 |
| |
268 | 269 |
| |
269 | 270 |
| |
|
Lines changed: 3 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
925 | 925 |
| |
926 | 926 |
| |
927 | 927 |
| |
928 |
| - | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
929 | 931 |
| |
930 | 932 |
| |
931 | 933 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
958 | 958 |
| |
959 | 959 |
| |
960 | 960 |
| |
| 961 | + | |
961 | 962 |
| |
962 | 963 |
| |
963 | 964 |
| |
|
Lines changed: 7 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
16 | 16 |
| |
17 | 17 |
| |
18 | 18 |
| |
| 19 | + | |
19 | 20 |
| |
20 | 21 |
| |
21 | 22 |
| |
| |||
1486 | 1487 |
| |
1487 | 1488 |
| |
1488 | 1489 |
| |
| 1490 | + | |
1489 | 1491 |
| |
1490 | 1492 |
| |
1491 | 1493 |
| |
| |||
1495 | 1497 |
| |
1496 | 1498 |
| |
1497 | 1499 |
| |
| 1500 | + | |
1498 | 1501 |
| |
1499 |
| - | |
| 1502 | + | |
1500 | 1503 |
| |
1501 | 1504 |
| |
1502 | 1505 |
| |
| |||
1521 | 1524 |
| |
1522 | 1525 |
| |
1523 | 1526 |
| |
| 1527 | + | |
1524 | 1528 |
| |
1525 | 1529 |
| |
1526 | 1530 |
| |
| |||
1530 | 1534 |
| |
1531 | 1535 |
| |
1532 | 1536 |
| |
| 1537 | + | |
1533 | 1538 |
| |
1534 |
| - | |
| 1539 | + | |
1535 | 1540 |
| |
1536 | 1541 |
| |
1537 | 1542 |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
518 | 518 |
| |
519 | 519 |
| |
520 | 520 |
| |
| 521 | + | |
521 | 522 |
| |
522 | 523 |
| |
523 | 524 |
| |
|
Lines changed: 28 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
861 | 861 |
| |
862 | 862 |
| |
863 | 863 |
| |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
864 | 870 |
| |
865 | 871 |
| |
866 | 872 |
| |
867 | 873 |
| |
868 |
| - | |
869 |
| - | |
870 | 874 |
| |
871 | 875 |
| |
872 | 876 |
| |
873 | 877 |
| |
874 |
| - | |
875 |
| - | |
876 |
| - | |
877 |
| - | |
878 |
| - | |
879 |
| - | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
880 | 886 |
| |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
881 | 900 |
| |
882 |
| - | |
| 901 | + | |
883 | 902 |
| |
884 |
| - | |
885 |
| - | |
886 | 903 |
| |
887 | 904 |
| |
888 | 905 |
| |
|
Lines changed: 5 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
18 | 18 |
| |
19 | 19 |
| |
20 | 20 |
| |
| 21 | + | |
21 | 22 |
| |
22 | 23 |
| |
23 | 24 |
| |
| |||
878 | 879 |
| |
879 | 880 |
| |
880 | 881 |
| |
| 882 | + | |
881 | 883 |
| |
882 | 884 |
| |
883 | 885 |
| |
| |||
908 | 910 |
| |
909 | 911 |
| |
910 | 912 |
| |
| 913 | + | |
911 | 914 |
| |
912 | 915 |
| |
913 | 916 |
| |
| |||
946 | 949 |
| |
947 | 950 |
| |
948 | 951 |
| |
949 |
| - | |
| 952 | + | |
950 | 953 |
| |
951 | 954 |
| |
952 | 955 |
| |
953 | 956 |
| |
954 | 957 |
| |
955 | 958 |
| |
956 |
| - | |
| 959 | + | |
957 | 960 |
| |
958 | 961 |
| |
959 | 962 |
| |
|
Lines changed: 2 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
18 | 18 |
| |
19 | 19 |
| |
20 | 20 |
| |
21 |
| - | |
22 | 21 |
| |
23 | 22 |
| |
24 | 23 |
| |
| |||
348 | 347 |
| |
349 | 348 |
| |
350 | 349 |
| |
351 |
| - | |
352 |
| - | |
353 |
| - | |
354 |
| - | |
| 350 | + | |
355 | 351 |
| |
356 | 352 |
| |
357 | 353 |
| |
| |||
362 | 358 |
| |
363 | 359 |
| |
364 | 360 |
| |
365 |
| - | |
| 361 | + | |
366 | 362 |
| |
367 | 363 |
| |
368 | 364 |
| |
|
Lines changed: 4 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1659 | 1659 |
| |
1660 | 1660 |
| |
1661 | 1661 |
| |
| 1662 | + | |
1662 | 1663 |
| |
1663 | 1664 |
| |
1664 | 1665 |
| |
| |||
1667 | 1668 |
| |
1668 | 1669 |
| |
1669 | 1670 |
| |
1670 |
| - | |
| 1671 | + | |
| 1672 | + | |
1671 | 1673 |
| |
1672 | 1674 |
| |
1673 | 1675 |
| |
| |||
1676 | 1678 |
| |
1677 | 1679 |
| |
1678 | 1680 |
| |
| 1681 | + | |
1679 | 1682 |
| |
1680 | 1683 |
| |
1681 | 1684 |
| |
|
Lines changed: 18 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1937 | 1937 |
| |
1938 | 1938 |
| |
1939 | 1939 |
| |
| 1940 | + | |
1940 | 1941 |
| |
1941 | 1942 |
| |
1942 | 1943 |
| |
| |||
1972 | 1973 |
| |
1973 | 1974 |
| |
1974 | 1975 |
| |
1975 |
| - | |
| 1976 | + | |
| 1977 | + | |
1976 | 1978 |
| |
1977 | 1979 |
| |
1978 | 1980 |
| |
1979 | 1981 |
| |
1980 | 1982 |
| |
1981 |
| - | |
| 1983 | + | |
| 1984 | + | |
1982 | 1985 |
| |
1983 | 1986 |
| |
1984 | 1987 |
| |
| |||
2000 | 2003 |
| |
2001 | 2004 |
| |
2002 | 2005 |
| |
| 2006 | + | |
| 2007 | + | |
| 2008 | + | |
| 2009 | + | |
| 2010 | + | |
2003 | 2011 |
| |
2004 | 2012 |
| |
2005 | 2013 |
| |
2006 | 2014 |
| |
2007 | 2015 |
| |
| 2016 | + | |
2008 | 2017 |
| |
2009 | 2018 |
| |
2010 | 2019 |
| |
| |||
2020 | 2029 |
| |
2021 | 2030 |
| |
2022 | 2031 |
| |
| 2032 | + | |
2023 | 2033 |
| |
2024 | 2034 |
| |
2025 | 2035 |
| |
| |||
2074 | 2084 |
| |
2075 | 2085 |
| |
2076 | 2086 |
| |
2077 |
| - | |
2078 |
| - | |
2079 | 2087 |
| |
2080 | 2088 |
| |
2081 | 2089 |
| |
| |||
2092 | 2100 |
| |
2093 | 2101 |
| |
2094 | 2102 |
| |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
2095 | 2106 |
| |
2096 | 2107 |
| |
2097 | 2108 |
| |
2098 | 2109 |
| |
2099 | 2110 |
| |
2100 | 2111 |
| |
2101 | 2112 |
| |
2102 |
| - | |
| 2113 | + | |
| 2114 | + | |
2103 | 2115 |
| |
2104 | 2116 |
| |
2105 | 2117 |
| |
2106 | 2118 |
| |
2107 | 2119 |
| |
2108 | 2120 |
| |
2109 | 2121 |
| |
| 2122 | + | |
2110 | 2123 |
| |
2111 | 2124 |
| |
2112 | 2125 |
| |
|
0 commit comments
Comments
(0)