forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit40608e7
committed
When estimating the selectivity of an inequality "column > constant" or
"column < constant", and the comparison value is in the first or lasthistogram bin or outside the histogram entirely, try to fetch the actualcolumn min or max value using an index scan (if there is an index on thecolumn). If successful, replace the lower or upper histogram bound withthat value before carrying on with the estimate. This limits theestimation error caused by moving min/max values when the comparisonvalue is close to the min or max. Per a complaint from Josh Berkus.It is tempting to consider using this mechanism for mergejoinscansel as well,but that would inject index fetches into main-line join estimation not justendpoint cases. I'm refraining from that until we can get a better handleon the costs of doing this type of lookup.1 parent89a091e commit40608e7
File tree
5 files changed
+322
-28
lines changed- src
- backend
- executor
- tsearch
- utils
- adt
- cache
- include/utils
5 files changed
+322
-28
lines changedLines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
1006 | 1006 |
| |
1007 | 1007 |
| |
1008 | 1008 |
| |
| 1009 | + | |
1009 | 1010 |
| |
1010 | 1011 |
| |
1011 | 1012 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
10 |
| - | |
| 10 | + | |
11 | 11 |
| |
12 | 12 |
| |
13 | 13 |
| |
| |||
170 | 170 |
| |
171 | 171 |
| |
172 | 172 |
| |
| 173 | + | |
173 | 174 |
| |
174 | 175 |
| |
175 | 176 |
| |
|
0 commit comments
Comments
(0)