Re: Are partial indicies supported? - Mailing list pgsql-general

From Tom Lane
Subject Re: Are partial indicies supported?
Date
Msg-id 3089.982391585@sss.pgh.pa.us
Whole thread Raw
In response to Are partial indicies supported?  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-general
Martijn van Oosterhout <kleptog@svana.org> writes:
> In the documentation there is this page about partial indicies:
> http://postgresql.planetmirror.com/devel-corner/docs/user/partial-index.htm
>  From my reading of that I would guess they are supported but since they
> aren't mentioned anywhere else, I guess they're not.
> Can somone clarify the situation please?

There is no provision in the CREATE INDEX grammar for a partial index
condition clause.  Some digging in the CVS archives shows that this
was true clear back to Postgres95, and that Postgres 4.2 was the last
release that accepted a condition clause.  I have no idea why Andrew and
Jolly removed it --- they certainly didn't hesitate to support Postgres
4.2's other non-ANSI-SQL extensions to CREATE INDEX.

There is still a substantial amount of code in the planner and executor
to support partial indexes, however.  Since it hasn't been exercised in
six or seven years, it's doubtless suffering bit rot ... but it's there.

An optimistic view is that a couple more lines of code in gram.y and
some vigorous dust-sweeping would resurrect the feature.  A pessimistic
view is that Andrew and Jolly disabled the feature because they knew
that it was fatally broken for some undocumented, now-forgotten reason.
The truth is probably somewhere in between.

I'd like to see the feature brought back, myself, but I dunno when it
will get to the top of someone's to-do queue.

            regards, tom lane

pgsql-general by date:

Previous
From: Doug McNaught
Date:
Subject: Re: How to use postgres 7.0.3 with -F?
Next
From: Paul M Foster
Date:
Subject: Re: Re: PostgreSQL vs Oracle vs DB2 vs MySQL - Which should I use?