by lsb · 16y ago · 0 comments
create table feed_items (item_id integer, feed_id integer, created_at datetime);
create index idx1 on feed_items (feed_id, datetime, item_id);
how much slower is that covering index for your query of select item_id from feed_items where feed_id=42 order by datetime desc limit 10
than the mysql/memcached/redis trifecta, and why not upgrade your database machine to a 68GB EC2 instance? Writing's definitely going to be slower, but you can batch transactions every 10 seconds or so, and 9x the RAM will be a big help.Regardless, A 68GB EC2 instance costs ~$1700/month. Four 2GB slices on Slicehost are priced at $520/month, with the cheaper set-up performing significantly better.