From c6f3595b93b45dd4d8d17565df2963633aa4919a Mon Sep 17 00:00:00 2001 From: sqlcoder Date: Sun, 7 Jun 2009 21:55:49 +0100 Subject: [PATCH] update with latest handsplayers/hudcache changes --- docs/tabledesign.html | 588 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 544 insertions(+), 44 deletions(-) diff --git a/docs/tabledesign.html b/docs/tabledesign.html index e148b9cf..86898528 100644 --- a/docs/tabledesign.html +++ b/docs/tabledesign.html @@ -312,11 +312,13 @@ The program itself is licensed under AGPLv3, see agpl-3.0.txt


Table HandsPlayers

-

cardX: can be 1 through 20, one for each card. In holdem only 1-2 of these are used, in omaha 1-4, in stud/razz 1-7, in single draw 1-10, in tripple draw all 20 and in badugi 1-16 (4*4).

-

For the draw games: the first 5 (badugi: 4) cards are the initial cards, the next 5 (badugi: 4) are after the first draw, etc.
-Example 1: If a player gets 2-6 spades for his first five cards and decides to throw away the 4 and then gets a 7 of spades then the first 10 fields of cardXValue would be as follows: 2, 3, 4, 5, 6, 2, 3, 5, 6, 7
-Example 2: If a player gets 2, 3, 5, 8, J of spades for his first five cards and decides to throw away the 2 and the 3 and then gets a Q and K of spades then the first 10 fields of cardXValue would be as follows: 2, 3, 5, 8, J, 5, 8, J, Q, K.

+

cardX: can be 1 through 20, one for each card. In holdem only 1-2 of these are used, in omaha 1-4, in stud/razz 1-7, in single draw games 1-10 is used and in badugi 1-16 (4*4) is used.

+

For the draw games: the first 5 (badugi: 4) cards are the initial cards, the next 5 (badugi: 4) are after the first draw. If a player keeps some cards then those cards' spaces are filled with "k", short for "kept".
+Example 1: If a player gets 2-6 spades for his first five cards and decides to throw away the 4 and then gets a 7 of spades then the first 10 fields of cardXValue would be as follows: 2, 3, 4, 5, 6, k, k, 7, k, k
+Example 2: If a player gets 2, 3, 5, 8, J of spades for his first five cards and decides to throw away the 2 and the 3 and then gets a Q and K of spades then the first 10 fields of cardXValue would be as follows: 2, 3, 5, 8, J, Q, K, k, k, k
+Note that it will k in the space of which card was there previously, so in example 2 where the player kept the last 3 cards, the last 3 fields of the first draw (ie. card8-10Value) are replaced with k.

I did not separate this into an extra table because I felt the lost space is not sufficiently large. Also the benefit for searching is far less relevant.

+

ToDo: Original plan was to implement the many flags from hudcache as booleans - need to try this out as it will save space and may therefore be quicker.

@@ -353,33 +355,24 @@ Example 2: If a player gets 2, 3, 5, 8, J of spades for his first five cards and + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - @@ -388,7 +381,12 @@ Example 2: If a player gets 2, 3, 5, 8, J of spades for his first five cards and - + + + + + + @@ -405,6 +403,384 @@ Example 2: If a player gets 2, 3, 5, 8, J of spades for his first five cards and + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Field Name

smallint

The seat in which the person was sitting - necessary for HUD

card1(..7)

smallint

0=none/unknown, 1-13=2-Ah 14-26=2-Ad 27-39=2-Ac 40-52=2-As

startCards

smallint

int representing Holdem starting cards.
Hand is stored as an int 13 * x + y where x and y +are in range 0..12, and (x+2) and (y+2) represents rank of each card (2=2 .. 14=Ace).
+If x > y then pair is suited, if x < y then unsuited.
+Omaha and other games may need to use this as a key into another table. (to be decided ...)

ante

int

note: for cash this could be boolean, but in tourneys you may enter a hand with less than the full ante

cardXValue

smallint

2-10=2-10, J=11, Q=12, K=13, A=14 (even in razz), unknown/no card=x
- see note above table

cardXSuit

char(1)

h=hearts, s=spades, d=diamonds, c=clubs, unknown/no card=x

cardXDiscarded

boolean

Whether the card was discarded (this only applies to draw games, X can be 1 through 15 since the final cards can obviously not be discarded).

DrawnX

smallint

X can be 1 through 3.
- This field denotes how many cards the player has drawn on each draw.

winnings

int

rake

int

rake for this player for this hand

rake for this player for this hand (i.e. final pot(s) size = winnings + rake)

totalProfit

int

profit for this player for this hand ( i.e. winnings - (ante + bets) )

comment

bigint

references TourneysPlayers.id

tourneyTypeId

bigint

references TourneyTypes.id (maybe this should be on Hands?)

wonWhenSeenStreet1(..4)

float

How many hands the player won after seeing the flop/street4 - this can be a "partial win" if the pot is split.
+ To be completely clear, this stores a hand count, NOT a money amount.
+ (2/3/4: Same for turn/street5, river/street6, street7)

wonAtSD

float

As wonWhenSeenStreet1, but for showdown.

street0VPI

int

did player pay to see flop, 1 or 0

street0Aggr

int

did player raise before flop, 1 or 0

street0_3BChance

int

did player have chance to 3B, 1 or 0

street0_3BDone

int

did player 3bet before flop, 1 or 0

street0_4BChance

int

did player have chance to 4B, 1 or 0

street0_4BDone

int

did player 4bet before flop, 1 or 0

other_3BStreet0

int

did other player 3bet before flop, 1 or 0

other_4BStreet0

int

did other player 4bet before flop, 1 or 0

street1Seen(/2/3/4)

int

did player see flop/street4 (.. etc)

sawShowdown

int

did player see showdown

street1Aggr

int

number of hands where player raised flop/street4

street2Aggr

int

number of hands where player raised turn/street5

street3Aggr

int

number of hands where player raised river/street6

street4Aggr

int

number of hands where player raised street7

otherRaisedStreet0

int

number of hands where someone else raised pre-flop/street3

otherRaisedStreet1

int

number of hands where someone else raised flop/street4

otherRaisedStreet2

int

number of hands where someone else raised turn/street5

otherRaisedStreet3

int

number of hands where someone else raised river/street6

otherRaisedStreet4

int

number of hands where someone else raised street7

foldToOtherRaisedStreet0

int

number of hands where someone else raised flop/street4 and the player folded

foldToOtherRaisedStreet1

int

number of hands where someone else raised flop/street4 and the player folded

foldToOtherRaisedStreet2

int

number of hands where someone else raised Turn/street5 and the player folded

foldToOtherRaisedStreet3

int

number of hands where someone else raised River/street6 and the player folded

foldToOtherRaisedStreet4

int

number of hands where someone else raised street7 and the player folded

stealAttemptChance

int

Player was in CO, BTN or SB and nobody has called yet

stealAttempted

int

Player took a chance per the above condition

foldBbToStealChance

int

Somebody tried to steal BB from player

foldedBbToSteal

int

Player folded BB to steal attempt

foldSbToStealChance

int

Somebody tried to steal SB from player

foldedSbToSteal

int

Player folded SB to steal attempt

street1CBChance

int

Player had chance to make continuation bet on flop/street4

street1CBDone

int

Player used chance to make continuation bet on flop/street4

street2CBChance

int

Player had chance to make continuation bet on turn/street5

street2CBDone

int

Player used chance to make continuation bet on turn/street5

street3CBChance

int

Player had chance to make continuation bet on river/street6

street3CBDone

int

Player used chance to make continuation bet on river/street6

street4CBChance

int

Player had chance to make continuation bet on street7

street4CBDone

int

Player used chance to make continuation bet on street7

foldToStreet1CBChance

int

Player had chance to fold to continuation bet on this street

foldToStreet1CBDone

int

Player used chance to fold to continuation bet on this street

foldToStreet2CBChance

int

Player had chance to fold to continuation bet on this street

foldToStreet2CBDone

int

Player used chance to fold to continuation bet on this street

foldToStreet3CBChance

int

Player had chance to fold to continuation bet on this street

foldToStreet3CBDone

int

Player used chance to fold to continuation bet on this street

foldToStreet4CBChance

int

Player had chance to fold to continuation bet on this street

foldToStreet4CBDone

int

Player used chance to fold to continuation bet on this street

street1CheckCallRaiseChance

int

How often player had the chance to do a check-raise or a call-raise on this street

street1CheckCallRaiseDone

int

How often player used the chance to do a check-raise or a call-raise on this street

street2CheckCallRaiseChance

int

How often player had the chance to do a check-raise or a call-raise on this street

street2CheckCallRaiseDone

int

How often player used the chance to do a check-raise or a call-raise on this street

street3CheckCallRaiseChance

int

How often player had the chance to do a check-raise or a call-raise on this street

street3CheckCallRaiseDone

int

How often player used the chance to do a check-raise or a call-raise on this street

street4CheckCallRaiseChance

int

How often player had the chance to do a check-raise or a call-raise on this street

street4CheckCallRaiseDone

int

How often player used the chance to do a check-raise or a call-raise on this street

street0Calls

int

Number of times player called on this street

street1Calls

int

Number of times player called on this street

street2Calls

int

Number of times player called on this street

street3Calls

int

Number of times player called on this street

street4Calls

int

Number of times player called on this street

street0Bets

int

Number of times player bet on this street

street1Bets

int

Number of times player bet on this street

street2Bets

int

Number of times player bet on this street

street3Bets

int

Number of times player bet on this street

street4Bets

int

Number of times player bet on this street

street0Raises

int

Number of times player raised on this street

street1Raises

int

Number of times player raised on this street

street2Raises

int

Number of times player raised on this street

street3Raises

int

Number of times player raised on this street

street4Raises

int

Number of times player raised on this street

actionString

int

Experimental - idea is to store the action on this street as a string: e.g. kkBrcfC, with + player's own choices in upper case and other players in lower case. k=check, b=bet, c=call, + r=raise. (Perhaps NL would miss out bet sizes for this?) It would then be possible to do complex + ad-hoc queries using queries like: actionString like '%B%r%C% +


Table HudCache

@@ -444,12 +820,23 @@ Example 2: If a player gets 2, 3, 5, 8, J of spades for his first five cards and

smallint

References TourneyTypes.id

-

HDs

int

number of hands this player played in this gametype with this number of seats

+ +

wonWhenSeenStreet1(/2/3/4)

+

float

+

How many hands the player won after seeing the flop/street4 - this can be a "partial win" if the pot is split.
+ To be completely clear, this stores a hand count, NOT a money amount.
+ (/2/3/4: Same for turn/street5, river/street6, street7)

+ + +

wonAtSD

+

float

+

As wonWhenSeenStreet1, but for showdown.

+

street0VPI

int

@@ -463,14 +850,24 @@ Example 2: If a player gets 2, 3, 5, 8, J of spades for his first five cards and

number of hands where player raised before flop

-

street0_3B4BChance

+

street0_3BChance

int

-

number of hands where player had chance to 3B or 4B

+

number of hands where player had chance to 3B before flop

-

street0_3B4BDone

+

street0_3BDone

int

-

number of hands where player 3bet/4bet before flop

+

number of hands where player 3bet before flop

+ + +

street0_4BChance

+

int

+

number of hands where player had chance to 4B before flop

+ + +

street0_4BDone

+

int

+

number of hands where player 4bet before flop

street1Seen

@@ -517,6 +914,11 @@ Example 2: If a player gets 2, 3, 5, 8, J of spades for his first five cards and

int

number of hands where player raised street7

+ +

otherRaisedStreet0

+

int

+

number of hands where someone else raised pre-flop/street3

+

otherRaisedStreet1

int

@@ -537,6 +939,11 @@ Example 2: If a player gets 2, 3, 5, 8, J of spades for his first five cards and

int

number of hands where someone else raised street7

+ +

foldToOtherRaisedStreet0

+

int

+

number of hands where someone else raised pre-flop/street3 and the player folded

+

foldToOtherRaisedStreet1

int

@@ -557,18 +964,6 @@ Example 2: If a player gets 2, 3, 5, 8, J of spades for his first five cards and

int

number of hands where someone else raised street7 and the player folded

- -

wonWhenSeenStreet1

-

float

-

How many hands the player won after seeing the flop/street4 - this can be a "partial win" if the pot is split.
- To be completely clear, this stores a hand count, NOT a money amount.

- - -

wonAtSD

-

float

-

As wonWhenSeenStreet1, but for showdown.

- -

stealAttemptChance

int

@@ -729,6 +1124,84 @@ Example 2: If a player gets 2, 3, 5, 8, J of spades for his first five cards and

How often player used the chance to do a check-raise or a call-raise on this street

+ +

street0Calls

+

int

+

Number of times player called on this street

+ + +

street1Calls

+

int

+

Number of times player called on this street

+ + +

street2Calls

+

int

+

Number of times player called on this street

+ + +

street3Calls

+

int

+

Number of times player called on this street

+ + +

street4Calls

+

int

+

Number of times player called on this street

+ + + +

street0Bets

+

int

+

Number of times player bet on this street

+ + +

street1Bets

+

int

+

Number of times player bet on this street

+ + +

street2Bets

+

int

+

Number of times player bet on this street

+ + +

street3Bets

+

int

+

Number of times player bet on this street

+ + +

street4Bets

+

int

+

Number of times player bet on this street

+ + + +

street0Raises

+

int

+

Number of times player raised on this street

+ + +

street1Raises

+

int

+

Number of times player raised on this street

+ + +

street2Raises

+

int

+

Number of times player raised on this street

+ + +

street3Raises

+

int

+

Number of times player raised on this street

+ + +

street4Raises

+

int

+

Number of times player raised on this street

+ +

Table HandsActions

@@ -926,5 +1399,32 @@ Example 2: If a player gets 2, 3, 5, 8, J of spades for his first five cards and


+


+

Possible Changes

+ + + + + + + + + + + + + + + + + + + + + +

Table

Comment

BoardCards

Remove as these attributes are now stored on Hands

HandsActions

Remove if/when these attributes are stored on Hands or elsewhere

HandsPlayers

Move tourneyTypeId field to Hands table.

Comments

Comment fields on various tables should probably be moved to a single comment table. Aim + should be to where possible reduce tables to a list of fixed length not-null columns and have + the larger, sparser comment columns in a dedicated table. (May not be possible or practical but + something to aim at.)