On 25 Jun 2011, at 7:14pm, Black, Michael (IS) wrote:
> I guess my point is why doesn't the optimizer recognize the almost-zero cost
> of min/max in the compound query? It assumes instead to do it all in one scan.
Because it's almost impossible to optimize sub-SELECTs. You pretty-much have
On 25-06-2011 20:14, Black, Michael (IS) wrote:
> So these two queries should be equal in speed and plan:
>
>
>
>
>
> select * from (select min(i) from test) as a,(select max(i) from
> test) as b, (select count(i) from test) as c; select
> min(i),max(i),count(i) from test;
and, to make the
I guess my point is why doesn't the optimizer recognize the almost-zero cost of
min/max in the compound query? It assumes instead to do it all in one scan.
So these two queries should be equal in speed and plan:
select * from (select min(i) from test) as a,(select max(i) from test) as b,
3 matches
Mail list logo