SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    is craving 'the potato' slayerment's Avatar
    Join Date
    Nov 2002
    Scottsdale, Arizona, USA
    0 Post(s)
    0 Thread(s)

    Q: Querying Lots of Rows Performance

    I have a case where I store stats and tracking over a period of time and over the past year my database has really grown. I'm hitting around 2 million rows and my queries are slowing down.

    I want to be able to continue to view data from any set time period, but it is really starting to have some performance issues. Is there a way to speed this up? How does a company like Google speed up their Analytics so that you can customize your query on lots and lots of data and still get your results quickly? Is there some type of thing I should be doing to optimize this?

    Any help or pointers would be much appreciated.


  2. #2
    SitePoint Member
    Join Date
    Feb 2009
    0 Post(s)
    0 Thread(s)
    Make sure that all your queries are on indexed fields, ie every field referred to after the WHERE clause is indexed. Any advice more specific than that would be highly dependant on the actual query.

    Have you tried the EXPLAIN command?


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts