pgsql: Teach planagg.c that partial indexes specifying WHERE foo IS NOT

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Teach planagg.c that partial indexes specifying WHERE foo IS NOT
Date: 2007-10-13 00:58:04
Message-ID: 20071013005804.1673F753E4C@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
Teach planagg.c that partial indexes specifying WHERE foo IS NOT NULL can be
used to perform MIN(foo) or MAX(foo), since we want to discard null rows in
the indexscan anyway. (This would probably fall out for free if we were
injecting the IS NOT NULL clause somewhere earlier, but given the current
anatomy of the MIN/MAX optimization code we have to do it explicitly.
Fortunately, very little added code is needed.) Per a discussion with
Henk de Wit.

Modified Files:
--------------
pgsql/src/backend/optimizer/plan:
planagg.c (r1.32 -> r1.33)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/planagg.c?r1=1.32&r2=1.33)

Browse pgsql-committers by date

  From Date Subject
Next Message User Jbcooley 2007-10-13 01:00:57 npgsql - Npgsql2: 2007-10-12 Josh Cooley <jbnpgsql@tuxinthebox.net>
Previous Message Tom Lane 2007-10-12 19:39:59 pgsql: When telling the bgwriter that we need a checkpoint because too