forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commite69d644
committed
Rotate instead of shifting hash join batch number.
Our algorithm for choosing batch numbers turned out not to workeffectively for multi-billion key inner relations. We would usemore hash bits than we have, and effectively concentrate all tuplesinto a smaller number of batches than we intended. While ideallywe should switch to wider hashes, for now, change the algorithm toone that effectively gives up bits from the bucket number when wedon't have enough bits. That means we'll finish up with longerbucket chains than would be ideal, but that's better than havingbatches that don't fit in work_mem and can't be divided.Batch-patch to all supported releases.Author: Thomas MunroReviewed-by: Tom Lane, thanks also to Tomas Vondra, Alvaro Herrera, Andres Freund for testing and discussionReported-by: James ColemanDiscussion:https://postgr.es/m/16104-dc11ed911f1ab9df%40postgresql.org1 parentd5b9c2b commite69d644
2 files changed
+18
-4
lines changedLines changed: 9 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
37 | 37 |
| |
38 | 38 |
| |
39 | 39 |
| |
| 40 | + | |
40 | 41 |
| |
41 | 42 |
| |
42 | 43 |
| |
| |||
1877 | 1878 |
| |
1878 | 1879 |
| |
1879 | 1880 |
| |
1880 |
| - | |
| 1881 | + | |
1881 | 1882 |
| |
1882 | 1883 |
| |
1883 | 1884 |
| |
| |||
1889 | 1890 |
| |
1890 | 1891 |
| |
1891 | 1892 |
| |
1892 |
| - | |
| 1893 | + | |
| 1894 | + | |
| 1895 | + | |
| 1896 | + | |
| 1897 | + | |
1893 | 1898 |
| |
1894 | 1899 |
| |
1895 | 1900 |
| |
| |||
1902 | 1907 |
| |
1903 | 1908 |
| |
1904 | 1909 |
| |
1905 |
| - | |
1906 | 1910 |
| |
1907 |
| - | |
| 1911 | + | |
| 1912 | + | |
1908 | 1913 |
| |
1909 | 1914 |
| |
1910 | 1915 |
| |
|
Lines changed: 9 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
136 | 136 |
| |
137 | 137 |
| |
138 | 138 |
| |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
139 | 148 |
|
0 commit comments
Comments
(0)