Howdy peeps.
I hope you can help me with this one. I got a twitter service ( http://foller.me ) which is about to be updated to public beta 2, but I don't want to do this until I could give the pages out in at least 2 or 3 seconds. The current version is simple enough, but the dev version I'm working on is quite complex.
It's all about my relations and profiles tables which both contain ~ 2 million rows. The profile table contains general twitter user info and the relations table contains [twitter_id
, followed_by
] entries which are both in a UNIQUE index. There's a cron job that runs every once in a while and asks the Twitter API about the users followers and inserts data into the relations database.
I'm using InnoDB, so the table isn't being locked, but updated frequently, thus the query cache isn't getting enough hits, especially when the cron job is executing.
I've got statements like SELECT screen_name FROM profiles WHERE twitter_id IN (SELECT followed_by FROM relations WHERE twitter_id = 'kovshenin')
. I'm sure that's not a very good way to do it and these are the ones (plus lots of others) that come up in the mysql-slow log when I turn it on.
Anyways, I need some general tips on how to acomplish good runtime for my project.
Thanks so much.