|
|
|
May 25th, 2009
04:55 pm - what . the . fuck . mysql> update Design set numBattles = (select count(*) from Vote where `timestamp` > '2009-05-25 6:00' and (designId=winnerId || designId=loserId)) where status=1; Query OK, 193 rows affected (16.65 sec) Rows matched: 193 Changed: 193 Warnings: 0
mysql> update Design set numWins = (select count(*) from Vote where `timestamp` > '2009-05-25 6:00' and (designId=winnerId)) where status=1; Query OK, 193 rows affected (1 min 9.30 sec) Rows matched: 193 Changed: 193 Warnings: 0
anyone care to explain what the fuck is going on?
btw, I'm in Boulder. Its fucking beautiful here. Oh, and bhakti chai is amazing. I ran the bolderboulder 10k in 55mins.. it probably could have been about 5 mins quicker if there weren't so many ppl to dodge! Especially towards the finish I just wanted to sprint but there was no way possible without being a jackass and pushing ppl over, lol. They required you to provide proof of finishing in less than an hour to get in the earlier corrals.. kinda annoying. Despite that, it was a very fun race, and so much free shit at the finish, like whoa. FREE BEER! Not very good beer, but still. Later tonight I'm going to a place where I WILL determine what beer I had when I was here with my brothers that we've since been unable to track down.
For now, I'm in programmers heaven, very focused... and I think I'm overhearing a few google engineers at the table next to me... I'm thinking about asking them wtf is up with mysql sucking so much ass.
|
Comments:
![[User Picture]](http://l-userpic.livejournal.com/60510/31710) | | From: | wiz |
| Date: | May 26th, 2009 12:48 am (UTC) |
|---|
| | more info | (Link) |
|
mysql> explain select (select count(*) from Vote where `timestamp` > '2009-05-25 6:00' and (designId=winnerId)) from Design where status=1; +----+--------------------+--------+------+------------------------------+---------------+---------+-----------------------------+------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+--------------------+--------+------+------------------------------+---------------+---------+-----------------------------+------+-------------+ | 1 | PRIMARY | Design | ref | statusIndex | statusIndex | 4 | const | 193 | Using index | | 2 | DEPENDENT SUBQUERY | Vote | ref | winnerIdIndex,timestampIndex | winnerIdIndex | 4 | artistichub.Design.designID | 1488 | Using where | +----+--------------------+--------+------+------------------------------+---------------+---------+-----------------------------+------+-------------+ 2 rows in set (0.00 sec)
mysql> explain select (select count(*) from Vote where `timestamp` > '2009-05-25 6:00' and (designId=winnerId || designId=loserId)) from Design where status=1; +----+--------------------+--------+-------+-------------------------------------------+----------------+---------+-------+-------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+--------------------+--------+-------+-------------------------------------------+----------------+---------+-------+-------+-------------+ | 1 | PRIMARY | Design | ref | statusIndex | statusIndex | 4 | const | 193 | Using index | | 2 | DEPENDENT SUBQUERY | Vote | range | winnerIdIndex,loserIdIndex,timestampIndex | timestampIndex | 4 | NULL | 17822 | Using where | +----+--------------------+--------+-------+-------------------------------------------+----------------+---------+-------+-------+-------------+ 2 rows in set (0.00 sec)
This all should mean that the second query should have been FASTER, not almost an entire minute slower!!!
Free beer at the end of a 10k, lol. Doesn't seem like the obvious choice!
Take some pics of Boulder.
![[User Picture]](http://l-userpic.livejournal.com/60510/31710) | | From: | wiz |
| Date: | May 26th, 2009 03:37 am (UTC) |
|---|
| | k | (Link) |
|
I have been, and been tweeting them. I'll post the good ones on lj when I get home =) |
|
|
|
|
LiveJournal.com |