Uncached Hands

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

Uncached Hands

Postby zedjr » Fri Nov 06, 2009 10:15 am

How do we determine which hands are not yet included in the cache? WE are getting all the counts frmo teh cache and not sure how yall know which ahnds havent been cached. IS there a flag in the holdem cache table or what?
zedjr
 
Posts: 198
Joined: Mon Feb 04, 2008 6:28 pm

Re: Uncached Hands

Postby kraada » Fri Nov 06, 2009 10:40 am

PT3 keeps in the Settings table the last id_hand that was used when the last cache updated happened. The setting_name for cash games is cache_update:holdem and for tournies it's cache_update:tourney_holdem.

If you want just one query to see how many hands it's been since you last updated you'd run one of these queries against the database directly:

Cash Games:
SELECT (MAX(holdem_hand_player_detail.id_hand)::int - settings.setting_value::int) as "Hands Since Last Cache Update" FROM holdem_hand_player_detail, settings WHERE setting_name = 'cache_update:holdem' GROUP BY settings.setting_value;

Tournaments:
SELECT (MAX(tourney_holdem_hand_player_detail.id_hand)::int - settings.setting_value::int) as "Hands Since Last Cache Update" FROM tourney_holdem_hand_player_detail, settings WHERE setting_name = 'cache_update:tourney_holdem' GROUP BY settings.setting_value;

Note that if you have a large database it can take a few seconds (up to a minute or two tops probably) to finish the query.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY


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

Who is online

Users browsing this forum: No registered users and 0 guests