please help! i have all indices in place and my sql queries are all very
fast etc. UNTIL i do the following: 

  select 
     count(id) 
    ,count(distinct username) thecount
  from 
    appviews
  group by 
    id
  order by thecount


briefly put, this query tries to get the the overall views for an
application. and the views grouped by username so that we can find out
how many real users viewed the app (not total views, but distinct views).


i have an index on "id". so, if i remove the "order by thecount" line in
the above query, i get results in 0.04 seconds on 3000 rows. if i leave
the orderby row in (and it is necessary as you can understand) it takes
1.08 seconds for exactly the same query. 

one thing i do know is that the "username" is not in my group clause but
in that case, what is an "stanadrd SQL" compliant way of representing the
same logic? do i need two queries? i hope not! 

QUESTION 2 -- 
while we are on it, is there any reason why mysql on a fresh install of
windows 2000 is performing much better than a fresh install of linux? by
a fresh install i mean no much hard disk space or memory being occupied
by random applications. both are fast machines. 

thanks a lot in advance!!
.ep




__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to