See Twitter's SQL.
twitter.com
twitter.com
Of course, that was wrong. (How annoying are the twitter users who actually "answer the question: What are you doing?") But that kind of insight only comes out once your product is exposed to real humans. It's obvious, but only in hindsight.
As it turns out, when you make LiveJournal really small, you get Jabber.
Grabbing the users
SELECT * FROM `users` WHERE (users.id in (<list of user ids>))
followed by queries for each user id in that list
SELECT * FROM `users` WHERE (`users`.`id` = <user id>)
Maybe there's a reason for doing that, but if there is, I can't think of it
They don't do this so much now, but back in the day (mid-late 90s) MySQL documentation was notorious for glossing over why they didn't have features. Foreign keys were "too slow". Transactions were "too slow", etc. If you need to rollback, store the previous values in memory in your own code, they told everyone (then quietly added the feature and changed the docs).
http://www.mysqlperformanceblog.com/2007/04/10/count-vs-coun...
There is a nice optimisation in MYISAM table that makes count() from table <with no where clause> almost instant as its stored as meta-data on the table - in InnoDB, Oracle or Postgres this optimisation doesn't exist ...
It was basically a semi-transparent box in the top left of the screen which showed you the query as well as which DB served the data (for me they came from db007, and the friend data from some shards), and two links, one for a popdown box with info about the query, and another with the file trace infomation.
Quite intresting, shame they have removed it.
Some profile pages are being linked to the staging server.
At least maybe (big maybe) some good will come of this?