Subject | Re: [firebird-support] Why PLAN token is not allowed after ORDER BY? |
---|---|
Author | Alec Swan |
Post date | 2012-06-04T16:27:01Z |
UNION use case makes sense, thanks!
On Mon, Jun 4, 2012 at 1:29 AM, Svein Erling Tysv�r <
svein.erling.tysvaer@...> wrote:
On Mon, Jun 4, 2012 at 1:29 AM, Svein Erling Tysv�r <
svein.erling.tysvaer@...> wrote:
> **[Non-text portions of this message have been removed]
>
>
> >I consider this issue resolved with one side note that having PLAN hint
> which affects ORDER BY execution
> >before ORDER BY clause is misleading.
>
> Don't forget UNION, Alec. I.e.
>
> select * from T
> where a = 1
> PLAN (T INDEX (IDX_TA))
> union
> select * from T
> where a = 2
> PLAN (T INDEX (IDX_TA))
> order by 1
>
> makes it quite simple to see why the PLAN clause has to be before the
> ORDER BY. Of course, I have no problems understanding that having the
> option of specifying ORDER BY before PLAN in simple selects could be easier
> to read (particularly when the plan involves ORDER as opposed to INDEX).
>
> Set
>
>
>