Faster or not?
Posted: Thu May 14, 2015 12:42 am
Hello,
Can someone familiar with Postgresql/Pokertracker internals tell me if there is any advantage to changing the order of terms in a summation?
For example, let's say I have a stat with the following conditions:
sum(if[...
AND cash_hand_player_statistics.enum_f_cbet_action = 'C'
AND cash_hand_player_statistics.enum_t_cbet_action = 'C'
AND cash_hand_player_statistics.enum_r_cbet_action = 'R'
, 1, 0])
Now since we humans play poker in order of Flop/Turn/River, I have written the summation in this order. However, it is clear
that the frequency of these things happening is in the reverse order. That is, a player will raise a River cbet far less often than
he will call a Turn cbet, than he will call a Flop cbet.
So my question is should I look to write these summations in a reverse order to speed up cache rebuild, report generation,
HUD population, etc. For one stat and one player, it won't make much difference, but for a large database and many stats,
is there a noticeable difference? Has anyone tested this?
Thanks for any comments,
John
Can someone familiar with Postgresql/Pokertracker internals tell me if there is any advantage to changing the order of terms in a summation?
For example, let's say I have a stat with the following conditions:
sum(if[...
AND cash_hand_player_statistics.enum_f_cbet_action = 'C'
AND cash_hand_player_statistics.enum_t_cbet_action = 'C'
AND cash_hand_player_statistics.enum_r_cbet_action = 'R'
, 1, 0])
Now since we humans play poker in order of Flop/Turn/River, I have written the summation in this order. However, it is clear
that the frequency of these things happening is in the reverse order. That is, a player will raise a River cbet far less often than
he will call a Turn cbet, than he will call a Flop cbet.
So my question is should I look to write these summations in a reverse order to speed up cache rebuild, report generation,
HUD population, etc. For one stat and one player, it won't make much difference, but for a large database and many stats,
is there a noticeable difference? Has anyone tested this?
Thanks for any comments,
John