forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit2de946b
committed
Improve the performance of LIKE/regex estimation in non-C locales, by making
make_greater_string() try harder to generate a string that's actually greaterthan its input string. Before we just assumed that making a string that wasmemcmp-greater was enough, but it is easy to generate examples where this isnot so when the locale is not C. Instead, loop until the relevant comparisonfunction agrees that the generated string is greater than the input.Unfortunately this is probably not enough to guarantee that the generatedstring is greater than all extensions of the input, so we cannot relax therestriction to C locale for the LIKE/regex index optimization. But it shouldat least improve the odds of getting a useful selectivity estimate inprefix_selectivity(). Per example from Guillaume Smet.Backpatch to 8.1, mainly because that's what the complainant is using...1 parent9542287 commit2de946b
File tree
3 files changed
+43
-27
lines changed- src
- backend
- optimizer/path
- utils/adt
- include/utils
3 files changed
+43
-27
lines changedLines changed: 8 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
9 | 9 |
| |
10 | 10 |
| |
11 | 11 |
| |
12 |
| - | |
| 12 | + | |
13 | 13 |
| |
14 | 14 |
| |
15 | 15 |
| |
| |||
2668 | 2668 |
| |
2669 | 2669 |
| |
2670 | 2670 |
| |
| 2671 | + | |
2671 | 2672 |
| |
2672 | 2673 |
| |
2673 | 2674 |
| |
| |||
2759 | 2760 |
| |
2760 | 2761 |
| |
2761 | 2762 |
| |
2762 |
| - | |
| 2763 | + | |
| 2764 | + | |
| 2765 | + | |
| 2766 | + | |
| 2767 | + | |
| 2768 | + | |
2763 | 2769 |
| |
2764 | 2770 |
| |
2765 |
| - | |
2766 |
| - | |
2767 |
| - | |
2768 |
| - | |
2769 | 2771 |
| |
2770 | 2772 |
| |
2771 | 2773 |
| |
|
Lines changed: 33 additions & 19 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
15 | 15 |
| |
16 | 16 |
| |
17 | 17 |
| |
18 |
| - | |
| 18 | + | |
19 | 19 |
| |
20 | 20 |
| |
21 | 21 |
| |
| |||
4302 | 4302 |
| |
4303 | 4303 |
| |
4304 | 4304 |
| |
4305 |
| - | |
| 4305 | + | |
| 4306 | + | |
| 4307 | + | |
| 4308 | + | |
| 4309 | + | |
| 4310 | + | |
| 4311 | + | |
4306 | 4312 |
| |
4307 | 4313 |
| |
4308 | 4314 |
| |
4309 | 4315 |
| |
4310 |
| - | |
4311 |
| - | |
4312 |
| - | |
4313 |
| - | |
4314 |
| - | |
4315 |
| - | |
4316 | 4316 |
| |
4317 | 4317 |
| |
4318 | 4318 |
| |
| |||
4589 | 4589 |
| |
4590 | 4590 |
| |
4591 | 4591 |
| |
4592 |
| - | |
4593 |
| - | |
| 4592 | + | |
| 4593 | + | |
| 4594 | + | |
| 4595 | + | |
| 4596 | + | |
| 4597 | + | |
| 4598 | + | |
| 4599 | + | |
| 4600 | + | |
| 4601 | + | |
| 4602 | + | |
4594 | 4603 |
| |
4595 | 4604 |
| |
4596 | 4605 |
| |
| |||
4599 | 4608 |
| |
4600 | 4609 |
| |
4601 | 4610 |
| |
4602 |
| - | |
4603 |
| - | |
4604 |
| - | |
4605 |
| - | |
4606 |
| - | |
4607 | 4611 |
| |
4608 | 4612 |
| |
4609 |
| - | |
| 4613 | + | |
4610 | 4614 |
| |
4611 | 4615 |
| |
4612 | 4616 |
| |
4613 | 4617 |
| |
4614 | 4618 |
| |
4615 |
| - | |
| 4619 | + | |
4616 | 4620 |
| |
4617 | 4621 |
| |
4618 | 4622 |
| |
| |||
4660 | 4664 |
| |
4661 | 4665 |
| |
4662 | 4666 |
| |
4663 |
| - | |
4664 |
| - | |
| 4667 | + | |
| 4668 | + | |
| 4669 | + | |
| 4670 | + | |
| 4671 | + | |
| 4672 | + | |
| 4673 | + | |
| 4674 | + | |
| 4675 | + | |
| 4676 | + | |
| 4677 | + | |
| 4678 | + | |
4665 | 4679 |
| |
4666 | 4680 |
| |
4667 | 4681 |
| |
|
Lines changed: 2 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 |
| |
| |||
118 | 118 |
| |
119 | 119 |
| |
120 | 120 |
| |
121 |
| - | |
| 121 | + | |
122 | 122 |
| |
123 | 123 |
| |
124 | 124 |
| |
|
0 commit comments
Comments
(0)