Subject | Re: SQL |
---|---|
Author | mihai_silver |
Post date | 2004-11-15T09:36:19Z |
--- In firebird-support@yahoogroups.com, "nxciro" <pict100@y...>
wrote:
interested to see all the results at once you can try this:
"select first :number skip :number distinct xrnd, count(xrnd) from t1
group by xrnd
order by count(xrnd) desc"
Good luck,
Silver
wrote:
>I think you can't improve the speed of that query but if you are't
> Hello
>
> Fb 1.5.1
>
> Do I have a better way to formulate this query
> to speed things up ?
>
> select distinct xrnd, count(xrnd) from t1
> group by xrnd
> order by count(xrnd) desc
>
> there is an index for xrnd
> the table currently has 6 million rows
>
> this is the plan : PLAN SORT (SORT (SORT ((T1 NATURAL))))
>
> nxciro
interested to see all the results at once you can try this:
"select first :number skip :number distinct xrnd, count(xrnd) from t1
group by xrnd
order by count(xrnd) desc"
Good luck,
Silver