forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit859b300
committed
Don't build extended statistics on inheritance trees
When performing ANALYZE on inheritance trees, we collect two samples foreach relation - one for the relation alone, and one for the inheritancesubtree (relation and its child relations). And then we build statisticson each sample, so for each relation we get two sets of statistics.For regular (per-column) statistics this works fine, because the catalogincludes a flag differentiating statistics built from those two samples.But we don't have such flag in the extended statistics catalogs, and weended up updating the same row twice, triggering this error: ERROR: tuple already updated by selfThe simplest solution is to disable extended statistics on inheritancetrees, which is what this commit is doing. In the future we may need todo something similar to per-column statistics, but that requires adding aflag to the catalog - and that's not backpatchable. Moreover, the currentselectivity estimation code only works with individual relations, sobuilding statistics on inheritance trees would be pointless anyway.Author: Tomas VondraBackpatch-to: 10-Discussion:https://postgr.es/m/20190618231233.GA27470@telsasoft.comReported-by: Justin Pryzby1 parentaf41ab5 commit859b300
File tree
3 files changed
+25
-3
lines changed- src
- backend/commands
- test/regress
- expected
- sql
3 files changed
+25
-3
lines changedLines changed: 9 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
589 | 589 |
| |
590 | 590 |
| |
591 | 591 |
| |
592 |
| - | |
593 |
| - | |
594 |
| - | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
595 | 601 |
| |
596 | 602 |
| |
597 | 603 |
| |
|
Lines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
86 | 86 |
| |
87 | 87 |
| |
88 | 88 |
| |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
89 | 97 |
| |
90 | 98 |
| |
91 | 99 |
| |
|
Lines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
55 | 55 |
| |
56 | 56 |
| |
57 | 57 |
| |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
58 | 66 |
| |
59 | 67 |
| |
60 | 68 |
| |
|
0 commit comments
Comments
(0)