Subject | Re: [firebird-support] Indexes on subquery |
---|---|
Author | Ivan Přenosil |
Post date | 2013-11-29T12:06:05Z |
> From: Svein Erling TysværBut it does not make much sense to use "UNION" instead of "UNION ALL"
> Having said all that, I was somewhat surprised about one query I issued yesterday:
>
> SELECT max(MyField) FROM TableA
> UNION
> SELECT max(MyField) FROM TableB
>
> used my descending indexes on MyField. However:
>
> SELECT 'TableA' as TableName, max(MyField) FROM TableA group by 1
> UNION
> SELECT 'TableB', max(MyField) FROM TableB group by 1
>
> used NATURAL for both tables ...
in this particular query :)
Ivan