List:General Discussion« Previous MessageNext Message »
From:Jon Drukman Date:June 28 1999 11:23pm
Subject:Re: Yet Another Optimization Question
View as plain text  
At 03:37 PM 6/28/99 , Kevin Smith wrote:
>The id from the table url is set as INT(11) yet the id from pageview is 
>set as mediumint(8) unsigned.  I believe, if these were set up the same 
>i.e. either both as INT(11) or both as mediumint(8).  This should help 
>increase the speed.

done.

>Also, because of they way MySQL may run the query, try running this, the 
>query defines the join between the two tables first...

funny, i would have thought that that would be slower.  i thought ordering
the where clauses so the most restrictive part came first would reduce the
amount of work, but i guess i was mistaken.

>SELECT SUM(count) as 'Total Views'
>FROM pageview, url
>WHERE (((url.id)=(pageview.id))
>AND ((url.url like '/sports/%'))
>AND ((pageview.date)=('1999-06-16')));
>
>Let me know how you get on, I would infact be VERY interested.

OK, it's certainly a vast improvement:

+-------------+
| Total Views |
+-------------+
|       14398 |
+-------------+
1 row in set (1 min 14.45 sec)

still a little pokey considering i have to run several dozen similar
queries for each days stats but i guess i can deal.

thanks for your help!


Jon Drukman
Director Of Technology
GameSpot
Thread
adding data is slowJon Drukman24 Jun
  • Re: adding data is slowSasha Pachev24 Jun
    • Re: adding data is slowJon Drukman25 Jun
      • Re: adding data is slowBenjamin Pflugmann25 Jun
        • Re: adding data is slowJon Drukman25 Jun
        • Yet Another Optimization QuestionJon Drukman28 Jun
  • Re: adding data is slowDaniel Koch25 Jun
  • adding data is slowMichael Widenius29 Jun
Re: Yet Another Optimization QuestionKevin Smith29 Jun
Re: Yet Another Optimization QuestionJon Drukman29 Jun
  • Re: Yet Another Optimization QuestionBenjamin Pflugmann30 Jun
    • Re: Yet Another Optimization QuestionJon Drukman30 Jun
Re: Yet Another Optimization QuestionKevin Smith29 Jun
Re: Yet Another Optimization QuestionJon Drukman29 Jun
  • Re: Yet Another Optimization QuestionTõnu Samuel29 Jun
    • Re: Yet Another Optimization QuestionJon Drukman29 Jun
      • Re: Yet Another Optimization QuestionMichael Widenius30 Jun
        • Re: Yet Another Optimization QuestionJon Drukman30 Jun
RE: Yet Another Optimization QuestionNigel Parker30 Jun
  • RE: Yet Another Optimization QuestionMichael Widenius30 Jun
Re: Yet Another Optimization Question(David Sklar)1 Jul
RE: Yet Another Optimization Questiontony2 Jul
  • RE: Yet Another Optimization QuestionMichael Widenius2 Jul
  • slow joinsJon Drukman7 Oct