Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to speed up count(*) on group by ?
Another thing to speed things up (slightly) would be to count(1) or
count(rowid) instead of count(*). count(*) has to evaluate the * first, so
the more columns, the longer it will take. I don't know how much difference
this will make in your situation, but every little bit helps.
Michael Keppler wrote in message <7ts8d4$ml0_at_TGZ3>...
>Hello everybody !
>
>I have a table with about 100.000 lines and one of its columns can have
>12 different values (integers). I have to group by this column very
>often and to count the number of lines for each groups, using something
>like
>
>select count(*),value
>from table
>group by value
>
>I defined an index on that column, but it still needs about two seconds
>to calculate (I think just for numbering the lines in the groups) on a
>Pentium 333. Is there another way to speed up this kind of selection ?
>
>Ciao and Thanks, Michael.
>
>--
>Michael Keppler, MCSE, MCP+I
>IT logic GbR
>Michael.Keppler_at_gmx.de
>
>
Received on Mon Oct 11 1999 - 20:24:43 CDT