]> granicus.if.org Git - postgresql/commit
Teach planagg.c that partial indexes specifying WHERE foo IS NOT NULL can be
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 13 Oct 2007 00:58:03 +0000 (00:58 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 13 Oct 2007 00:58:03 +0000 (00:58 +0000)
commit106264ca3f82821f65db6991ddea76ee35406873
tree649ed01d8ebbb0850f7bb1095f3369d9643ed7fd
parent5c8eb929e69bba417b8e0b20c5016ad8129a073f
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.
src/backend/optimizer/plan/planagg.c