Re: Problem with default partition pruning
Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
From: Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
To: hosoya.yuzuko@lab.ntt.co.jp
Cc: thibaut.madelaine@dalibo.com, imai.yoshikazu@jp.fujitsu.com,
Langote_Amit_f8@lab.ntt.co.jp, pgsql-hackers@lists.postgresql.org
Date: 2019-03-15T08:30:07Z
Lists: pgsql-hackers
Hello. At Fri, 15 Mar 2019 15:05:41 +0900, "Yuzuko Hosoya" <hosoya.yuzuko@lab.ntt.co.jp> wrote in <001901d4daf5$1ef4f640$5cdee2c0$@lab.ntt.co.jp> > v2 patch attached. > Could you please check it again? I have some comments on the patch itself. The patch relies on the fact(?) that the lowest index is always -1 in range partition and uses it as pseudo default partition. I'm not sure it is really the fact and anyway it donsn't seem the right thing to do. Could you explain how it works, not what you did in this patch? L96: > /* There can only be zero or one matching partition. */ > - if (partindices[off + 1] >= 0) > - result->bound_offsets = bms_make_singleton(off + 1); > - else > - result->scan_default = > - partition_bound_has_default(boundinfo); > + result->bound_offsets = bms_make_singleton(off + 1); The comment had a meaning for the old code. Seems to need rewrite? L183: > + /* > + * All bounds are greater than the key, so we could only > + * expect to find the lookup key in the default partition. > + */ Long trailing spaces are attached to every line without substantial modification. L198: > - * inclusive, no need add the adjacent partition. > + * inclusive, no need add the adjacent partition. If 'off' is > + * -1 indicating that all bounds are greater, then we simply > + * end up adding the first bound's offset, that is, 0. off doesn't seem to be -1 there. regards. -- Kyotaro Horiguchi NTT Open Source Software Center
Commits
-
Don't constraint-exclude partitioned tables as much
- 815ef2f568c7 13.0 landed
-
Apply constraint exclusion more generally in partitioning
- 4e85642d935e 13.0 landed
-
Improve pruning of a default partition
- e3967a16d3a0 11.5 landed
- 86544071484a 12.0 landed
- 489247b0e615 13.0 landed
-
Doc: Fix event trigger firing table
- 44460d7017cd 13.0 cited
-
Remove obsolete nbtree insertion comment.
- 489e431ba56b 12.0 cited