tuning sql

PostgreSQL is the database server used to store information. Do you have a question or are you having problem with PostgreSQL? If so, post them here.

Moderator: Moderators

tuning sql

Postby lavezzi » Wed Feb 26, 2014 8:14 pm

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' ;
lavezzi
 
Posts: 24
Joined: Tue Apr 21, 2009 6:08 pm

Re: tuning sql

Postby kraada » Thu Feb 27, 2014 8:54 am

I don't see any obvious way to optimize that. Have you run VACUUM ANALYZE recently?
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY


Return to PostgreSQL [Read Only]

Who is online

Users browsing this forum: No registered users and 6 guests

cron
highfalutin