SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    is craving 'the potato' slayerment's Avatar
    Join Date
    Nov 2002
    Location
    Scottsdale, Arizona, USA
    Posts
    603
    Mentioned
    0 Post(s)
    Tagged
    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.

    Thanks,
    Quinton

  2. #2
    SitePoint Member
    Join Date
    Feb 2009
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    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?


Bookmarks

Posting Permissions

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