Teach bitmap path generation about transforming OR-clauses to SAOP's
Alexander Korotkov <akorotkov@postgresql.org>
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
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/optimizer/path/indxpath.c | modified | +428 −2 |
| src/backend/optimizer/util/restrictinfo.c | modified | +49 −58 |
| src/include/optimizer/restrictinfo.h | modified | +11 −0 |
| src/test/regress/expected/create_index.out | modified | +110 −15 |
| src/test/regress/expected/join.out | modified | +27 −29 |
| src/test/regress/sql/create_index.sql | modified | +38 −0 |
| src/tools/pgindent/typedefs.list | modified | +1 −0 |
Discussion
- POC, WIP: OR-clause support for indexes 322 messages · 2015-12-26 → 2025-03-28