|
Posted by Dan Guzman on 07/26/05 04:15
You can speed up this query with a non-clustered index on REMOTE_ADDR.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Rich" <no@spam.invalid> wrote in message
news:DbfFe.48792$4o.35562@fed1read06...
> My table looks like this:
> char(150) HTTP_REF,
> char(250) HTTP_USER,
> char(150) REMOTE_ADDR,
> char(150) REMOTE_HOST,
> char(150) URL,
> smalldatetime TIME_STAMP
>
> There are no indexes on this table and there are only 293,658 records
> total.
>
> When I do a select like this it takes forever:
>
> SELECT COUNT(DISTINCT REMOTE_ADDR)
>
> Takes 2 minutes. Is there anyway to speed that up?
>
> Thanks
>
>
Navigation:
[Reply to this message]
|