- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit33e52ad
committed
Fix ndistinct estimates with system attributes
When estimating the number of groups using extended statistics, the codewas discarding information about system attributes. This led to strangesituation that SELECT 1 FROM t GROUP BY ctid;could have produced higher estimate (equal to pg_class.reltuples) than SELECT 1 FROM t GROUP BY a, b, ctid;with extended statistics on (a,b). Fixed by retaining information aboutthe system attribute.Backpatch all the way to 10, where extended statistics were introduced.Author: Tomas VondraBackpatch-through: 101 parenta14a011 commit33e52ad
File tree
2 files changed
+4
-4
lines changed- src
- backend/utils/adt
- test/regress/expected
2 files changed
+4
-4
lines changedLines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3987 | 3987 |
| |
3988 | 3988 |
| |
3989 | 3989 |
| |
3990 |
| - | |
| 3990 | + | |
| 3991 | + | |
3991 | 3992 |
| |
3992 | 3993 |
| |
3993 |
| - | |
3994 |
| - | |
| 3994 | + | |
3995 | 3995 |
| |
3996 | 3996 |
| |
3997 | 3997 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
260 | 260 |
| |
261 | 261 |
| |
262 | 262 |
| |
263 |
| - | |
| 263 | + | |
264 | 264 |
| |
265 | 265 |
| |
266 | 266 |
| |
|
0 commit comments
Comments
(0)