Re: Strange logic for partial index proving - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Strange logic for partial index proving
Date
Msg-id 20787.1119394154@sss.pgh.pa.us
Whole thread Raw
In response to Re: Strange logic for partial index proving  ("Jim C. Nasby" <decibel@decibel.org>)
List pgsql-hackers
"Jim C. Nasby" <decibel@decibel.org> writes:
> Has anyone looked at how hard it would be to identify impossible
> conditions as part of planning the query?

The question in my mind is not so much how hard it would be as how many
cycles we would waste trying to prove things that won't be true for
99.999% of queries.  There is always a tradeoff involved when you add
more processing to the planner, and in this case I can't believe that it
would be a win.

Simon is looking at a different and much more constrained case (WHERE
clause provably inconsistent with check constraints of individual tables
in an inheritance hierarchy), and so the risk of wasted processing
doesn't loom so large.

Note also that when the contradictory constraints are on a column of a
btree index, the amount you save by recognizing the condition in the
planner isn't all that great, since the btree index code discovers it
during plan startup anyway.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: The contrib hit list
Next
From: Alvaro Herrera
Date:
Subject: Re: Why is checkpoint so costly?