diff options
author | Alexander Korotkov <akorotkov@postgresql.org> | 2024-11-24 01:40:20 +0200 |
---|---|---|
committer | Alexander Korotkov <akorotkov@postgresql.org> | 2024-11-24 01:40:20 +0200 |
commit | d4378c0005e61b1bb78e88097ea6efcdddbe2d6e (patch) | |
tree | 7b1d55b537b5a809c668a2413c119d359063ad60 /src/include/postgres.h | |
parent | 869ee4f10eca2acda3d2210198a46d5029a569fc (diff) | |
download | postgresql-d4378c0005e61b1bb78e88097ea6efcdddbe2d6e.tar.gz postgresql-d4378c0005e61b1bb78e88097ea6efcdddbe2d6e.zip |
Transform OR-clauses to SAOP's during index matching
This commit makes match_clause_to_indexcol() match
"(indexkey op C1) OR (indexkey op C2) ... (indexkey op CN)" expression
to the index while transforming it into "indexkey op ANY(ARRAY[C1, C2, ...])"
(ScalarArrayOpExpr node).
This transformation allows handling long OR-clauses with single IndexScan
avoiding diving them into a slower BitmapOr.
We currently restrict Ci to be either Const or Param to apply this
transformation only when it's clearly beneficial. However, in the future,
we might switch to a liberal understanding of constants, as it is in other
cases.
Discussion: https://postgr.es/m/567ED6CA.2040504%40sigaev.ru
Author: Alena Rybakina, Andrey Lepikhov, Alexander Korotkov
Reviewed-by: Peter Geoghegan, Ranier Vilela, Alexander Korotkov, Robert Haas
Reviewed-by: Jian He, Tom Lane, Nikolay Shaplov
Diffstat (limited to 'src/include/postgres.h')
0 files changed, 0 insertions, 0 deletions