Skip site navigation (1) Skip section navigation (2)

pgsql: Fix planning of btree index scans using ScalarArrayOpExprquals.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix planning of btree index scans using ScalarArrayOpExprquals.
Date: 2012-09-18 16:21:14
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-committers
Fix planning of btree index scans using ScalarArrayOpExpr quals.

In commit 9e8da0f75731aaa7605cf4656c21ea09e84d2eb1, I improved btree
to handle ScalarArrayOpExpr quals natively, so that constructs like
"indexedcol IN (list)" could be supported by index-only scans.  Using
such a qual results in multiple scans of the index, under-the-hood.
I went to some lengths to ensure that this still produces rows in index
order ... but I failed to recognize that if a higher-order index column
is lacking an equality constraint, rescans can produce out-of-order
data from that column.  Tweak the planner to not expect sorted output
in that case.  Per trouble report from Robert McGehee.



Modified Files
src/backend/optimizer/path/indxpath.c      |   15 ++++++++-
src/test/regress/expected/create_index.out |   45 ++++++++++++++++++++++++++++
src/test/regress/sql/create_index.sql      |   24 +++++++++++++++
3 files changed, 83 insertions(+), 1 deletions(-)

pgsql-committers by date

Next:From: Peter EisentrautDate: 2012-09-19 02:05:49
Subject: pgsql: pg_upgrade: Remove check for pg_config
Previous:From: Tom LaneDate: 2012-09-18 04:31:53
Subject: pgsql: Fix array_typanalyze to work for domains over arrays.

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group