git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 869ee4f) | patch
Transform OR-clauses to SAOP's during index matching
2024年11月23日 23:40:20 +0000 (01:40 +0200)
2024年11月23日 23:40:20 +0000 (01:40 +0200)
commit d4378c0005e61b1bb78e88097ea6efcdddbe2d6e
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
src/backend/optimizer/path/indxpath.c diff | blob | blame | history
src/test/regress/expected/create_index.out diff | blob | blame | history
src/test/regress/expected/join.out diff | blob | blame | history
src/test/regress/expected/rowsecurity.out diff | blob | blame | history
src/test/regress/expected/stats_ext.out diff | blob | blame | history
src/test/regress/expected/uuid.out diff | blob | blame | history
src/test/regress/sql/create_index.sql diff | blob | blame | history
src/test/regress/sql/join.sql diff | blob | blame | history
src/test/regress/sql/rowsecurity.sql diff | blob | blame | history
src/test/regress/sql/stats_ext.sql diff | blob | blame | history
src/test/regress/sql/uuid.sql diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /