1. If there was a minraise 2Bet preflop then the players behind will be facing a raise of 2BB and not 1BB unless they are in the blinds. The amount of the raise faced is the amount the player needs to call so the player in the SB will be facing a raise of 1.5BB and the BB will be facing a raise of 1BB. Also
tourney_hand_player_statistics.amt_p_raise_facing is the size of the last raise faced by the player (which might not be a 2Bet and I am assuming you only want preflop 2Bets) so in these cases it is better to use
tourney_hand_player_statistics.amt_p_2bet_facing. To account for all of the above regardless of whether the player was in the blinds or not you can use:
- Code: Select all
((tourney_hand_player_statistics.amt_p_2bet_facing + tourney_hand_player_statistics.amt_blind) / tourney_blinds.amt_bb) = 2
tourney_hand_player_statistics.amt_blind is the amount of any blind posted by the player so if the player hasn't posted a blind it will be zero for them.
2. With both columns you are restricting the hands which are counted to those in which the player made only one single preflop action so hands where they made more than action (e.g. subsequently facing a squeeze) are not going to get counted. To count those hands you will need to use this in the first column:
- Code: Select all
lookup_actions_p.action LIKE 'C%'
For more detail on pattern matching in PostgreSQL see
this guide. For the second column you don't need to test the players actions - you only need to know they faced the minraise and had the opportunity to call.