- Notifications
You must be signed in to change notification settings - Fork5
Commite5efda4
committed
Install a search tree depth limit in GIN bulk-insert operations, to prevent
them from degrading badly when the input is sorted or nearly so. In thisscenario the tree is unbalanced to the point of becoming a mere linked list,so insertions become O(N^2). The easiest and most safely back-patchablesolution is to stop growing the tree sooner, ie limit the growth of N. Wemight later consider a rebalancing tree algorithm, but it's not clear thatthe benefit would be worth the cost and complexity. Per report from SergeyBurladyan and an earlier complaint from Heikki.Back-patch to 8.2; older versions didn't have GIN indexes.1 parentfc022d7 commite5efda4
File tree
3 files changed
+20
-12
lines changed- src
- backend/access/gin
- include/access
3 files changed
+20
-12
lines changedLines changed: 5 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
11 | 11 |
| |
12 | 12 |
| |
13 | 13 |
| |
14 |
| - | |
| 14 | + | |
15 | 15 |
| |
16 | 16 |
| |
17 | 17 |
| |
| |||
749 | 749 |
| |
750 | 750 |
| |
751 | 751 |
| |
752 |
| - | |
753 |
| - | |
754 |
| - | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
755 | 756 |
| |
756 | 757 |
| |
757 | 758 |
| |
|
Lines changed: 4 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
245 | 245 |
| |
246 | 246 |
| |
247 | 247 |
| |
248 |
| - | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
249 | 251 |
| |
250 | 252 |
| |
251 | 253 |
| |
|
Lines changed: 11 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4 | 4 |
| |
5 | 5 |
| |
6 | 6 |
| |
7 |
| - | |
| 7 | + | |
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
| |||
26 | 26 |
| |
27 | 27 |
| |
28 | 28 |
| |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
29 | 37 |
| |
30 | 38 |
| |
31 | 39 |
| |
| |||
434 | 442 |
| |
435 | 443 |
| |
436 | 444 |
| |
437 |
| - | |
438 |
| - | |
439 |
| - | |
| 445 | + | |
440 | 446 |
| |
441 |
| - | |
442 |
| - | |
| 447 | + | |
443 | 448 |
| |
444 | 449 |
| |
445 | 450 |
| |
|
0 commit comments
Comments
(0)