Re: POC, WIP: OR-clause support for indexes
Andrei Lepikhov <lepihov@gmail.com>
Commits
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Make group_similar_or_args() reorder clause list as little as possible
- 775a06d44c04 18.0 landed
-
Allow usage of match_orclause_to_indexcol() for joins
- 627d63419e22 18.0 landed
-
Skip not SOAP-supported indexes while transforming an OR clause into SAOP
- 5bba0546eecb 18.0 landed
-
Remove the wrong assertion from match_orclause_to_indexcol()
- d4d11940df94 18.0 landed
-
Teach bitmap path generation about transforming OR-clauses to SAOP's
- ae4569161a27 18.0 landed
-
Transform OR-clauses to SAOP's during index matching
- d4378c0005e6 18.0 landed
-
Fix the value of or_to_any_transform_limit in postgresql.conf.sample
- 2af75e117478 17.0 landed
-
Transform OR clauses to ANY expression
- 72bd38cc99a1 17.0 landed
-
MergeAttributes code deduplication
- 64444ce071f6 17.0 cited
-
SEARCH and CYCLE clauses
- 3696a600e229 14.0 cited
-
Improve estimation of OR clauses using extended statistics.
- 25a9e54d2db3 14.0 cited
-
Teach btree to handle ScalarArrayOpExpr quals natively.
- 9e8da0f75731 9.2.0 cited
-
Revise collation derivation method and expression-tree representation.
- b310b6e31ce5 9.1.0 cited
-
Instead of trying to force WHERE clauses into CNF or DNF normal form,
- 9888192fb773 8.0.0 cited
On 23/8/2024 14:58, Alexander Korotkov wrote: > On Fri, Aug 23, 2024 at 1:23 PM Andrei Lepikhov <lepihov@gmail.com> wrote: >> The last query doesn't group clauses into two indexes. The reason is in >> match_index_to_operand which classifies all 'x=' to one class. I'm not >> sure because of overhead, but it may be resolved by using >> predicate_implied_by to partial indexes. > > Yes, this is the conscious limitation of my patch: to consider similar > OR arguments altogether and one-by-one, not in arbitrary groups. The > important thing here is that we still generating BitmapOR patch as we > do without the patch. So, there is no regression. I would leave this > as is to not make this feature too complicated. This could be improved > in future though. It looks reasonable for me, thanks for the explanation. What's more, I suspicious about the line: *subrinfo = *rinfo; Here, you copy everything, including cached estimations like norm_selec or eval_cost. I see that the match_orclause_to_indexcol creates a new SAOP where all caches will be cleaned, but just to be sure, maybe we should reset any cached estimations to default values — in that case, anyone who tries to build a new path based on these grouped OR clauses will recalculate that data. At least, incorrect eval_cost of iclause->rinfo can slightly change the cost of rechecking operation, can't it? -- regards, Andrei Lepikhov