Subject Re: [firebird-support] Indexes on subquery
Author Ivan Přenosil
> From: Svein Erling Tysvær
> 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 ...

But it does not make much sense to use "UNION" instead of "UNION ALL"
in this particular query :)

Ivan