Re: Planning without reason.
- From: Greg Stark <gsstark(at)mit(dot)edu>
- To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
- Cc: Martijn van Oosterhout <kleptog(at)svana(dot)org>, Tzahi Fadida <Tzahi(dot)ML(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
- Subject: Re: Planning without reason.
- Date: 23 Jun 2006 17:02:29 -0400
- Message-id: <87r71fy49m(dot)fsf(at)stark(dot)xeocode(dot)com>
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
> It's conceivable that the planner could prove that neither effect is
> possible in a particular query and then make the transformation
> automatically, but I'm not about to expend that kind of planning effort
> on such an odd case --- checking for it would waste entirely too many
> cycles in most cases.
Fwiw these aren't really very rare cases. Usually it goes the other direction
though. I seem to recall Oracle did in fact support a plan where it converted
OR expressions into a kind of union plan node.
But I think Postgres's bitmap index scan satisfies much of the same need. I
think the most useful case where the union plan was beneficial was precisely
when you had something like WHERE index_col1=1 OR indexed_col2=2.
Going from an UNION plan to a OR plan would be somewhat strange. Programmers
don't usually write plans as UNION in place of the more natural OR unless they
have a reason to.
--
greg
Home |
Main Index |
Thread Index