Re: [HACKERS] PATCH: multivariate histograms and MCV lists
Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
From: Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
To: david.rowley@2ndquadrant.com
Cc: tomas.vondra@2ndquadrant.com, dean.a.rasheed@gmail.com,
alvherre@2ndquadrant.com, michael@paquier.xyz, andres@anarazel.de,
thomas.munro@enterprisedb.com, bruce@momjian.us,
hornschnorter@gmail.com, pgsql-hackers@postgresql.org
Date: 2019-03-14T11:56:23Z
Lists: pgsql-hackers
At Wed, 13 Mar 2019 19:37:45 +1300, David Rowley <david.rowley@2ndquadrant.com> wrote in <CAKJS1f_6qDQj9m2H0jF4bRkZVLpfc7O9E+MxdXrq0wgv0z1NrQ@mail.gmail.com> > On Wed, 13 Mar 2019 at 17:20, Kyotaro HORIGUCHI > <horiguchi.kyotaro@lab.ntt.co.jp> wrote: > > bms_member_index seems working differently than maybe expected. > > > > bms_member_index((2, 4), 0) => 0, (I think) should be -1 > > bms_member_index((2, 4), 1) => 0, should be -1 > > bms_member_index((2, 4), 2) => 0, should be 0 > > bms_member_index((2, 4), 3) => 1, should be -1 > > bms_member_index((2, 4), 4) => 1, should be 1 > > bms_member_index((2, 4), 5) => 2, should be -1 > > bms_member_index((2, 4), 6) => 2, should be -1 > > ... > > bms_member_index((2, 4), 63) => 2, should be -1 > > bms_member_index((2, 4), 64) => -1, correct > > > > It works correctly only when x is a member - the way the function > > is maybe actually used in this patch -, or needs to change the > > specifiction (or the comment) of the function. > > Looks like: > > + if (wordnum >= a->nwords) > + return -1; > > should be: > > + if (wordnum >= a->nwords || > + (a->word[wordnum] & ((bitmapword) 1 << bitnum)) == 0) > + return -1; Yeah, seems right. regards. -- Kyotaro Horiguchi NTT Open Source Software Center
Commits
-
Convert pre-existing stats_ext tests to new style
- dbb984128ebf 12.0 landed
-
Add support for multivariate MCV lists
- 7300a699502f 12.0 landed
-
Improve ANALYZE's strategy for finding MCVs.
- b5db1d93d2a6 11.0 cited
-
Clone extended stats in CREATE TABLE (LIKE INCLUDING ALL)
- 5564c1181548 11.0 cited
-
Try again to fix accumulation of parallel worker instrumentation.
- 8526bcb2df76 11.0 cited
-
Adjust psql \d query to avoid use of @> operator.
- 471d55859c11 11.0 cited
-
Message style fixes
- 821fb8cdbf70 11.0 cited
-
Add security checks to selectivity estimation functions
- e2d4ef8de869 10.0 cited