Subject | Re: 'group by' and 'union' v.s. 'union all' have impact on the number of indxd reads |
---|---|
Author | vincent_kwinsey |
Post date | 2008-03-17T07:40:30Z |
sorry - I am correcting myself - I spoke about 'order by', not 'group
by'.
--- In firebird-support@yahoogroups.com, "vincent_kwinsey"
<vincent_kwinsey@...> wrote:
by'.
--- In firebird-support@yahoogroups.com, "vincent_kwinsey"
<vincent_kwinsey@...> wrote:
>minimize
> Hello!
>
> I am trying to find optimal select statement. Currently I have only
> indexed reads (no non-indexed reads), but I am still trying to
> this number - on some test cases I can see improvement some 10times -
> for the number of reads and execution time as well.In
>
> There are strange things:
> - adding 'group by 1, 2, 3' clause removes all the optimization and
> there is max number of reads
> - 'union' remove all the optimization as opposite to 'union all'.
> case of 'union' the total number of reads excees the sum of readsfor
> individual selects (which are parts or 'union').there
>
> Intuition says than in both situations there should be some fixed
> amount of reads and the 'group' or 'union' should simply make some
> sorting or elimination of duplications of some temporary set and
> should be no additional reads...
>