forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit5b736e9
committed
Remove unneeded constraint dependency tracking
It was previously thought that remove_useless_groupby_columns() needed tokeep track of which constraints the generated plan depended upon, however,this is unnecessary. The confusion likely arose regarding this because ofcheck_functional_grouping(), which does need to track the dependency toensure VIEWs with columns which are functionally dependant on the GROUP BYremain so. For remove_useless_groupby_columns(), cached plans will justbecome invalidated when the primary key's underlying index is removedthrough the normal relcache invalidation code.Here we just remove the unneeded code which records the dependency andupdates the comments. The previous comments claimed that we could not useUNIQUE constraints for the same optimization due to lack of apg_constraint record for NOT NULL constraints (which are required becauseNULLs can be duplicated in a unique index). Since we don't actually need apg_constraint record to handle the invalidation, it looks like we couldadd code to do this in the future. But not today.We're not really fixing any bug in the code here, this fix is just to setthe record straight on UNIQUE constraints. This code was added back in9.6, but due to lack of any bug, we'll not be backpatching this.Reviewed-by: Tom LaneDiscussion:https://postgr.es/m/CAApHDvrdYa=VhOoMe4ZZjZ-G4ALnD-xuAeUNCRTL+PYMVN8OnQ@mail.gmail.com1 parentfc576b7 commit5b736e9
1 file changed
+9
-11
lines changedLines changed: 9 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3056 | 3056 |
| |
3057 | 3057 |
| |
3058 | 3058 |
| |
3059 |
| - | |
3060 |
| - | |
3061 |
| - | |
| 3059 | + | |
3062 | 3060 |
| |
3063 |
| - | |
3064 |
| - | |
3065 |
| - | |
3066 |
| - | |
| 3061 | + | |
| 3062 | + | |
| 3063 | + | |
| 3064 | + | |
| 3065 | + | |
| 3066 | + | |
| 3067 | + | |
| 3068 | + | |
3067 | 3069 |
| |
3068 | 3070 |
| |
3069 | 3071 |
| |
| |||
3172 | 3174 |
| |
3173 | 3175 |
| |
3174 | 3176 |
| |
3175 |
| - | |
3176 |
| - | |
3177 |
| - | |
3178 |
| - | |
3179 | 3177 |
| |
3180 | 3178 |
| |
3181 | 3179 |
| |
|
0 commit comments
Comments
(0)