- Notifications
You must be signed in to change notification settings - Fork5k
Commitf3281f9
committed
Improve comments for estimate_multivariate_ndistinct()
estimate_multivariate_ndistinct() is coded to assume the caller handlespassing it a list of GroupVarInfos with unique 'var' fields over theentire list.6bb6a62 added code which didn't ensure this and thatcould result in estimate_multivariate_ndistinct() erroring out with:ERROR: corrupt MVNDistinct entryThis occurred because estimate_multivariate_ndistinct() first searchesfor a set of stats that match to at least two of the given GroupVarInfosand then later assumes that the MVNDistinctItem.items array of thebest matching stats will have an entry for those two columns. If theGroupVarInfos List contained a duplicate entry then the same column couldbe matched to twice and that could trick the code into thinking we have>= 2 columns matched in cases where only a single distinct column has beenmatched. This could result in a failure to find the correctMVNDistinctItem in the stats as the array containing those nevercontains an item for single columns.Here we make it more clear that the function needs a distinct set ofGroupVarInfos and also tidy up a few other comments to make things a biteasier to follow.Author: David Rowley <drowleyml@gmail.com>Discussion:https://postgr.es/m/CAApHDvocZCUhM9W9mJ39d6oQz7ePKoqFnao_347mvC-A7QatcQ@mail.gmail.com1 parentab3d8af commitf3281f9
1 file changed
+21
-10
lines changedLines changed: 21 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4146 | 4146 |
| |
4147 | 4147 |
| |
4148 | 4148 |
| |
4149 |
| - | |
4150 |
| - | |
4151 |
| - | |
4152 |
| - | |
| 4149 | + | |
| 4150 | + | |
4153 | 4151 |
| |
4154 |
| - | |
| 4152 | + | |
| 4153 | + | |
4155 | 4154 |
| |
4156 |
| - | |
| 4155 | + | |
| 4156 | + | |
| 4157 | + | |
| 4158 | + | |
| 4159 | + | |
| 4160 | + | |
4157 | 4161 |
| |
4158 | 4162 |
| |
4159 | 4163 |
| |
| |||
4234 | 4238 |
| |
4235 | 4239 |
| |
4236 | 4240 |
| |
| 4241 | + | |
| 4242 | + | |
| 4243 | + | |
| 4244 | + | |
| 4245 | + | |
| 4246 | + | |
4237 | 4247 |
| |
4238 | 4248 |
| |
4239 | 4249 |
| |
4240 | 4250 |
| |
4241 |
| - | |
4242 |
| - | |
| 4251 | + | |
| 4252 | + | |
4243 | 4253 |
| |
4244 |
| - | |
4245 |
| - | |
| 4254 | + | |
| 4255 | + | |
| 4256 | + | |
4246 | 4257 |
| |
4247 | 4258 |
| |
4248 | 4259 |
| |
|
0 commit comments
Comments
(0)