Page 1 of 1

tuning sql

PostPosted: Wed Feb 26, 2014 8:14 pm
by lavezzi
Could some1 suggest me how to improve speed of this query? its taking about 9 seconds to fetch results.


Code: Select all
SELECT s.amt_won, d.amt_bet_p, d.amt_bet_f, d.amt_bet_t, d.amt_bet_r FROM  player as p, holdem_hand_histories as h, holdem_hand_player_statistics as s, holdem_hand_player_detail as d
WHERE s.id_hand=h.id_hand AND d.id_hand=h.id_hand AND 
h.history='123456789' and s.id_player=p.id_player and s.id_player=d.id_player  AND p.player_name='hero' ;

Re: tuning sql

PostPosted: Thu Feb 27, 2014 8:54 am
by kraada
I don't see any obvious way to optimize that. Have you run VACUUM ANALYZE recently?