Page 1 of 1

Tune PostgreSQL function on Linux

PostPosted: Fri May 01, 2026 6:56 pm
by Solwa54
Does anyone happen to know a way to run the "Tune PostgreSQL" function on a Linux system?

Both Wine and the Windows VM tell me they can't find a server listening on localhost (which in case of the VM is accurate).

Every time my database gets to 300k+ hands, it starts becoming painfully slow. Cache updates after every hand import take almost a second each.

Code: Select all
pokertracker@PT4_DB_V3 LOG:  duration: 775.534 ms  statement: SELECT setting_value, update_cash_cache(), update_cash_custom_cache() FROM settings WHERE setting_name='cache_update:cash';


The hash inner joins for the HUD, take almost 2 seconds.

Code: Select all
6.   Hash Inner Join (cost=9358.04..131735.98 rows=272938 width=156) (actual=40.802..1921.801 rows=478693 loops=3)
Hash Cond: (cash_hand_player_statistics.id_action_r = lookup_actions_r.id_action)
120.91 ms   1921.801 ms
7.    Hash Inner Join (cost=9355.8..130962.06 rows=272938 width=156) (actual=40.762..1800.863 rows=478693 loops=3)
Hash Cond: (cash_hand_player_statistics.id_action_t = lookup_actions_t.id_action)
117.81 ms   1800.863 ms
8.    Hash Inner Join (cost=9353.56..130188.15 rows=272938 width=156) (actual=40.737..1683.04 rows=478693 loops=3)
Hash Cond: (cash_hand_player_statistics.id_action_f = lookup_actions_f.id_action)
110.86 ms   1683.04 ms
9.    Hash Inner Join (cost=9351.32..129414.24 rows=272938 width=156) (actual=40.715..1572.167 rows=478693 loops=3)
Hash Cond: (cash_hand_summary.id_limit = cash_limit.id_limit)
105.768 ms   1572.167 ms
10.    Hash Inner Join (cost=9350.21..128089.37 rows=272938 width=155) (actual=40.653..1466.381 rows=478693 loops=3)
Hash Cond: (cash_hand_player_statistics.id_action_p = lookup_actions_p.id_action)
107.214 ms   1466.381 ms
11.    Hash Inner Join (cost=9347.98..127315.46 rows=272938 width=155) (actual=40.626..1359.152 rows=478693 loops=3)
Hash Cond: (cash_hand_player_statistics.id_player = player.id_player)
117.365 ms   1359.152 ms
12.    Hash Inner Join (cost=9188.41..126438.85 rows=272938 width=131) (actual=39.576..1240.746 rows=478693 loops=3)
Hash Cond: ((cash_hand_player_statistics."position" = lookup_positions."position") AND (cash_hand_player_statistics.cnt_players_lookup_position = lookup_positions.cnt_players))
123.59 ms   1240.746 ms
13.    Hash Inner Join (cost=9185.69..124863.43 rows=290330 width=131) (actual=39.523..1117.117 rows=478693 loops=3)
Hash Cond: ((cash_hand_player_statistics.id_hand = cash_hand_summary.id_hand) AND (cash_hand_player_statistics.id_limit = cash_hand_summary.id_limit))
1005.659 ms   1117.117 ms   

Re: Tune PostgreSQL function on Linux

PostPosted: Sat May 02, 2026 5:11 am
by Flag_Hippo
That's not a supported configuration but you can manually tune PostgreSQL by editing your postgresql.conf file and restarting the PostgreSQL service. If you are not sure what settings to use you can generate a configuration via PGTune here.

Re: Tune PostgreSQL function on Linux

PostPosted: Sat May 02, 2026 10:28 am
by Solwa54
Flag_Hippo wrote:That's not a supported configuration but you can manually tune PostgreSQL by editing your postgresql.conf file and restarting the PostgreSQL service. If you are not sure what settings to use you can generate a configuration via PGTune here.

Thanks!

Re: Tune PostgreSQL function on Linux

PostPosted: Sat May 02, 2026 11:29 am
by Solwa54
That said, if anyone else stumbles onto this post, I can not recommend the settings from that site. They made things so much worse (6-7 seconds per hand for the cache update):

Code: Select all
2026-05-02 17:13:02.116 CEST [5062] pokertracker@PT4_DB_V3 LOG:  duration: 7082.051 ms  statement: SELECT setting_value, update_cash_cache(), update_cash_custom_cache() FROM settings WHERE setting_name='cache_update:cash';
2026-05-02 17:13:08.716 CEST [5062] pokertracker@PT4_DB_V3 LOG:  duration: 6596.094 ms  statement: SELECT setting_value, update_cash_cache(), update_cash_custom_cache() FROM settings WHERE setting_name='cache_update:cash';
2026-05-02 17:13:20.066 CEST [5062] pokertracker@PT4_DB_V3 LOG:  duration: 6258.480 ms  statement: SELECT setting_value, update_cash_cache(), update_cash_custom_cache() FROM settings WHERE setting_name='cache_update:cash';
2026-05-02 17:13:26.535 CEST [5062] pokertracker@PT4_DB_V3 LOG:  duration: 6466.899 ms  statement: SELECT setting_value, update_cash_cache(), update_cash_custom_cache() FROM settings WHERE setting_name='cache_update:cash';
2026-05-02 17:13:45.245 CEST [5062] pokertracker@PT4_DB_V3 LOG:  duration: 6157.631 ms  statement: SELECT setting_value, update_cash_cache(), update_cash_custom_cache() FROM settings WHERE setting_name='cache_update:cash';
2026-05-02 17:13:51.745 CEST [5062] pokertracker@PT4_DB_V3 LOG:  duration: 6498.463 ms  statement: SELECT setting_value, update_cash_cache(), update_cash_custom_cache() FROM settings WHERE setting_name='cache_update:cash';
2026-05-02 17:14:18.866 CEST [5062] pokertracker@PT4_DB_V3 LOG:  duration: 6392.278 ms  statement: SELECT setting_value, update_cash_cache(), update_cash_custom_cache() FROM settings WHERE setting_name='cache_update:cash';
2026-05-02 17:14:25.362 CEST [5062] pokertracker@PT4_DB_V3 LOG:  duration: 6494.126 ms  statement: SELECT setting_value, update_cash_cache(), update_cash_custom_cache() FROM settings WHERE setting_name='cache_update:cash';
2026-05-02 17:15:15.155 CEST [5062] pokertracker@PT4_DB_V3 LOG:  duration: 6393.626 ms  statement: SELECT setting_value, update_cash_cache(), update_cash_custom_cache() FROM settings WHERE setting_name='cache_update:cash';
2026-05-02 17:15:21.642 CEST [5062] pokertracker@PT4_DB_V3 LOG:  duration: 6484.861 ms  statement: SELECT setting_value, update_cash_cache(), update_cash_custom_cache() FROM settings WHERE setting_name='cache_update:cash';


Still, thanks for the suggestion.