pfr and 3bet betsize sql statement

Forum for users that want to write their own custom queries against the PT database either via the Structured Query Language (SQL) or using the PT3 custom stats/reports interface.

Moderator: Moderators

pfr and 3bet betsize sql statement

Postby K1K0 » Thu Dec 15, 2011 9:03 am

Hi,

I made the following sql statement. It gives two columns, 1st is the pfr size in bb, 2nd the amount of times this betsize was made.

SELECT DISTINCT ROUND(amt_p_raise_made / amt_bb, 1), COUNT(amt_p_raise_made / amt_bb)
FROM holdem_hand_player_statistics
JOIN player
ON holdem_hand_player_statistics.id_player = player.id_player
JOIN holdem_limit
ON holdem_hand_player_statistics.id_limit = holdem_limit.id_limit
JOIN holdem_hand_player_detail
ON holdem_hand_player_statistics.id_hand = holdem_hand_player_detail.id_hand
WHERE player_name = 'SomePlayer'
AND position = 9
AND cnt_players = 2
AND flg_p_open = true AND flg_p_first_raise = true
GROUP BY amt_p_raise_made / amt_bb

OUTPUT

0.0;519
2.0;6
2.5;576
3.0;3
3.5;4
4.0;2
5.0;2
7.0;1
8.0;19
9.0;16
10.0;27
12.0;2
16.0;1

A couple of questions.

1) I compared with PT3 filtering and 2bb, 2.5bb, 3bb and 3.5bb betsizes are correct. But how about the others? Where exactly are those coming from? Could they be 4bets? Or perheps due to some import errors? Any way to get rid of them? 10bb and 9bb look like 3bet sizes at NL100, where most of the hands were played. But if the guy was in the sb and open raised first in, how can he 3bet? Something wrong with my statement maybe?

2) How can I do the same for 3bet sizes?

3) What exactly is amt_p_raise_made_2?

Thanks in advance.
K1K0
 
Posts: 19
Joined: Sat Mar 08, 2008 10:01 am

Re: pfr and 3bet betsize sql statement

Postby kraada » Thu Dec 15, 2011 9:27 am

From the query it looks like those should have been open raise sizes. I agree they are strange sizes to open but that's what the data you have implies.

You could alter your query to get the id_hand for those hands and look at the actual hand histories involved and that would give us a much better idea exactly what is going on here.

amt_p_raise_made_2 is the size of the second (or last) raise you made preflop.

For 3bets you still want amt_p_raise_made because the 3bet will always be your first raise (just check for flg_p_3bet).
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: pfr and 3bet betsize sql statement

Postby K1K0 » Thu Dec 15, 2011 10:08 am

Thanks for the quick reply.

I tried the 3bet query.

SELECT DISTINCT ROUND(amt_p_raise_made / amt_bb, 2), COUNT(amt_p_raise_made / amt_bb)
FROM holdem_hand_player_statistics
JOIN player
ON holdem_hand_player_statistics.id_player = player.id_player
JOIN holdem_limit
ON holdem_hand_player_statistics.id_limit = holdem_limit.id_limit
JOIN holdem_hand_player_detail
ON holdem_hand_player_statistics.id_hand = holdem_hand_player_detail.id_hand
WHERE player_name = 'SomePlayer'
AND position = 8
AND cnt_players = 2
AND flg_p_3bet = true
AND flg_p_first_raise = false
GROUP BY amt_p_raise_made / amt_bb

OUTPUT

2.00;31
2.50;10
3.00;62
4.00;1
5.55;1
7.40;10
7.55;3
8.00;1
8.55;20
9.25;61
9.55;6
10.25;1
12.95;1

It seems like instances where the sb limped and the player in question raised the limp, are counted as 3bets as well and are included in the table, even though I added flg_p_first_raise = false. Is it possible something is wrong with the JOIN ON part of my statement? Does the order in which you add those matter? I don't know, I only recently started messing around with sql statements.

I compared with PT3 3bet size filters.
Between 10 and 15bbs: 2 OK
Between 5 and 10bbs: 102 OK
Between 0 and 5bbs: 0 ???
K1K0
 
Posts: 19
Joined: Sat Mar 08, 2008 10:01 am

Re: pfr and 3bet betsize sql statement

Postby kraada » Thu Dec 15, 2011 10:34 am

I think you're right and the issue is with your join - you're not joining on holdem_hand_player_detail.id_player which I think you'll need to do as well. Otherwise you'll get hands where any player made the raise size not just the player you've picked out.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: pfr and 3bet betsize sql statement

Postby K1K0 » Thu Dec 15, 2011 11:53 am

WORKING FINE NOW. Correct statement for 3bet sizes below.

SELECT DISTINCT ROUND(amt_p_raise_made / amt_bb, 2), COUNT(amt_p_raise_made / amt_bb)
FROM holdem_hand_player_statistics
JOIN player
ON holdem_hand_player_statistics.id_player = player.id_player
JOIN holdem_limit
ON holdem_hand_player_statistics.id_limit = holdem_limit.id_limit
JOIN holdem_hand_player_detail
ON (holdem_hand_player_statistics.id_hand = holdem_hand_player_detail.id_hand AND holdem_hand_player_statistics.id_player = holdem_hand_player_detail.id_player)
WHERE player_name = 'SomePlayer'
AND position = 8
AND cnt_players = 2
AND flg_p_3bet = true
AND flg_p_first_raise = false
GROUP BY amt_p_raise_made / amt_bb

Thanks a lot for the help :heart:
K1K0
 
Posts: 19
Joined: Sat Mar 08, 2008 10:01 am


Return to Custom Stats, Reports, and SQL [Read Only]

Who is online

Users browsing this forum: No registered users and 1 guest