diff options
author | Alexander Korotkov | 2024-11-23 23:41:45 +0000 |
---|---|---|
committer | Alexander Korotkov | 2024-11-23 23:41:45 +0000 |
commit | ae4569161a27823793ca24825bbabce2a91a0bc9 (patch) | |
tree | 59d2131807aed4b471ad48e0d7a0e55bfa213ff9 /src/include/optimizer | |
parent | d4378c0005e61b1bb78e88097ea6efcdddbe2d6e (diff) |
Teach bitmap path generation about transforming OR-clauses to SAOP's
When optimizer generates bitmap paths, it considers breaking OR-clause
arguments one-by-one. But now, a group of similar OR-clauses can be
transformed into SAOP during index matching. So, bitmap paths should
keep up.
This commit teaches bitmap paths generation machinery to group similar
OR-clauses into dedicated RestrictInfos. Those RestrictInfos are considered
both to match index as a whole (as SAOP), or to match as a set of individual
OR-clause argument one-by-one (the old way).
Therefore, bitmap path generation will takes advantage of OR-clauses to SAOP's
transformation. The old way of handling them is also considered. So, there
shouldn't be planning regression.
Discussion: https://postgr.es/m/CAPpHfdu5iQOjF93vGbjidsQkhHvY2NSm29duENYH_cbhC6x%2BMg%40mail.gmail.com
Author: Alexander Korotkov, Andrey Lepikhov
Reviewed-by: Alena Rybakina, Andrei Lepikhov, Jian he, Robert Haas
Reviewed-by: Peter Geoghegan
Diffstat (limited to 'src/include/optimizer')
-rw-r--r-- | src/include/optimizer/restrictinfo.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/include/optimizer/restrictinfo.h b/src/include/optimizer/restrictinfo.h index fe03a8ecd34..f32dae8620b 100644 --- a/src/include/optimizer/restrictinfo.h +++ b/src/include/optimizer/restrictinfo.h @@ -22,6 +22,17 @@ make_restrictinfo(root, clause, true, false, false, false, 0, \ NULL, NULL, NULL) +extern RestrictInfo *make_plain_restrictinfo(PlannerInfo *root, + Expr *clause, + Expr *orclause, + bool is_pushed_down, + bool has_clone, + bool is_clone, + bool pseudoconstant, + Index security_level, + Relids required_relids, + Relids incompatible_relids, + Relids outer_relids); extern RestrictInfo *make_restrictinfo(PlannerInfo *root, Expr *clause, bool is_pushed_down, |