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: | 2006-06-23 21:02:29 |
Message-ID: | 87r71fy49m.fsf@stark.xeocode.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
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
From | Date | Subject | |
---|---|---|---|
Next Message | Martijn van Oosterhout | 2006-06-23 21:13:29 | Re: Planning without reason. |
Previous Message | Jonah H. Harris | 2006-06-23 19:46:12 | Re: vacuum, performance, and MVCC |