Determine active tables, then active players, then...

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

Determine active tables, then active players, then...

Postby svrs » Fri Oct 28, 2011 1:59 pm

I would like to write some application which create files where statistic information is stored (something like statistic log). I want to use DB created by PT3, and my application should receive updated statistic during game (real time) using pure SQL queries (same statistic and working principle like HUD module). So thats why I'm here... Please, help me to understand and write next SQL queries:

1. how to define list of active tables and after that
2. how to identify list of players which seat on these tables defined previously
3. for every players, how to calculate basic statistic list, for example: VPIP, PR, AF, WSD.

thank you for your attention for my problem.
svrs
 
Posts: 5
Joined: Fri Oct 28, 2011 12:16 pm

Re: Determine active tables, then active players, then...

Postby kraada » Fri Oct 28, 2011 2:25 pm

I can help you with (3) when you're ready for it, but (1) and (2) aren't stored in our database so you are going to need to get that information elsewhere.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Determine active tables, then active players, then...

Postby svrs » Sat Oct 29, 2011 8:57 am

thank you, kraada for your reply, I would appreciate if you can help me construct SQL query which solves (3) (statistic calculation on condition that i have a list with players).

If I'm not mistaken I can solve problem (1, 2) only by accessing history files, am i right? And how do the HUD module solve these problems?
Thanks.
svrs
 
Posts: 5
Joined: Fri Oct 28, 2011 12:16 pm

Re: Determine active tables, then active players, then...

Postby kraada » Sun Oct 30, 2011 8:32 am

The HUD looks at the hands that have been imported and looks for a matching existing table.

It sounds like all you want is a way to redo the HUD - if so, why not use the HUD yourself?
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Determine active tables, then active players, then...

Postby svrs » Mon Oct 31, 2011 9:22 am

I am using HUD, but I want to see some player characteristics which I plan to calculate using their stats (to name players like 'maniac', 'passive' ....). Do you help me with SQL?
svrs
 
Posts: 5
Joined: Fri Oct 28, 2011 12:16 pm

Re: Determine active tables, then active players, then...

Postby kraada » Mon Oct 31, 2011 9:51 am

Then what you want to use is our AutoRate system - click Tools -> Configure AutoRate and that will allow you to set up 16 categories into which you can sort players based on their statistical values.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Determine active tables, then active players, then...

Postby svrs » Wed Nov 02, 2011 9:55 am

But I want it to be done by my application, so can you help me with SQL?
svrs
 
Posts: 5
Joined: Fri Oct 28, 2011 12:16 pm

Re: Determine active tables, then active players, then...

Postby kraada » Wed Nov 02, 2011 1:47 pm

What you'll want to use is a SELECT statement - the easiest one will probably be against the holdem_cache table. All columns that PT3 uses to build stats exist there as columns. You'll use the id_player value for the player in question to filter to the right player.

So for example: SELECT sum(cnt_vpip) from holdem_cache where id_player = 1;

gets you the players cnt_vpip value for the player whose id is 1. You can get id_player values by using SELECT statements against the player table (e.g. SELECT id_player from player where player_name = "Melkor";).

There are various fields in the holdem_cache table and if you want to limit your query to certain table sizes or player numbers you can do so by adding more detail to your WHERE clause. Please see our Database Schema (on our documents page) for more details.

You can find how every stat is calculated by clicking Configure --> Configure Statistics. For HUD stats click on Holdem Cash Player Statistics, then on the Stats tab. Click on any stat and the Value Expression is how it is calculated (for tournament stats, use Tourney Cash Player Statistics).

You may also find this documentation useful.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Determine active tables, then active players, then...

Postby svrs » Thu Nov 03, 2011 8:57 am

Thank you, kraada, you really simplify my problem. Indeed,THX!
svrs
 
Posts: 5
Joined: Fri Oct 28, 2011 12:16 pm


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

Who is online

Users browsing this forum: No registered users and 2 guests