Using partial index in combination with prepared statement parameters

From: Steven Schlansker <steven(at)likeness(dot)com>
To: "pgsql-general(at)postgresql(dot)org General" <pgsql-general(at)postgresql(dot)org>
Subject: Using partial index in combination with prepared statement parameters
Date: 2013-02-03 23:37:41
Message-ID: C2F990A9-07B5-4593-9E01-519CA16A65B1@likeness.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

It's been covered a few times in the past,
http://www.postgresql.org/message-id/BANLkTimfT4OHQKb6Y7M4wQrffpWNUtPqJQ@mail.gmail.com
http://postgresql.1045698.n5.nabble.com/partial-indexes-not-used-on-parameterized-queries-td2121027.html

but in a nutshell, partial indices do not play nicely with prepared statements because
whether the index is valid or not cannot be known at query plan time.

I am curious if there is any development on this? I have looked around but don't see any activity
(whether Simon's "I have a patch but don't hold your breath" or otherwise).

I ask largely because we use prepared statements everywhere and this makes it very hard
to use partial indices, which would offer us significant performance gains.

Does anyone know of any acceptable workaround? Is there continued interest in maybe improving the PostgreSQL behavior in this case?

Thanks!
Steven Schlansker

Responses

Browse pgsql-general by date

  From Date Subject
Next Message wd 2013-02-04 04:19:29 Weird explain output
Previous Message Jason Dusek 2013-02-03 18:21:10 Re: Syncing an application cache with xmin