]> de.git.xonotic.org Git - xonotic/xonstat.git/commit
Speed up weaponstats requests by 2.5x.
authorAnt Zucaro <azucaro@gmail.com>
Wed, 24 Dec 2014 21:55:17 +0000 (16:55 -0500)
committerAnt Zucaro <azucaro@gmail.com>
Wed, 24 Dec 2014 21:55:17 +0000 (16:55 -0500)
commit078c36e309d5b859cc03761f11e4ee401f543bbb
tree8f62f5b86661a880a65876165334f02e33b5d882
parent5e124876833fb20483bbbd3a40f1fa5936d83397
Speed up weaponstats requests by 2.5x.

We can exploit the GIN index on games.players to quickly get a list of the most
recently-played games. We construct this list as a subquery that can be used in
an IN list in the main weaponstats query, greatly reducing the time needed to
fetch the rows. It's about 2.5 times faster according to apache bench.
Additionally this query is helped by moving it to a subquery, whereas once it
was two queries (thus two round trips to the DB).
xonstat/views/player.py