by 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.