How exactly will "recent" stats behave with the new cache?

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

How exactly will "recent" stats behave with the new cache?

Postby merkur33 » Wed Feb 24, 2010 5:32 am

I have some "recent" stats that show the stats of the last 15 minutes as a difference to the longer term versions of this stat. E.g. i have "recent vpip"
Code: Select all
((cnt_p_recent_vpip / cnt_recenthands) - (cnt_vpip / cnt_hands)) * 100
with the columns cnt_p_recent_vpip:
Code: Select all
sum(if[ localtimestamp - interval '15 minutes' < tourney_holdem_hand_summary.date_imported AND tourney_holdem_hand_player_statistics.flg_vpip, 1, 0])
and cnt_recenthands
Code: Select all
sum(if[ localtimestamp - interval '15 minutes' < tourney_holdem_hand_summary.date_imported, 1, 0])
Then i have a stat "streaks" that just shows the big (>= 2 big bets) wins and losses during the last 15 Minutes and expresses them like "wins : losses", with the columns "recent_wins"
Code: Select all
sum(if[ localtimestamp - interval '15 minutes' < tourney_holdem_hand_summary.date_imported AND tourney_holdem_hand_player_statistics.flg_won_hand AND (tourney_holdem_blinds.amt_bb *tourney_holdem_blinds.val_nlpl_mult) <= tourney_holdem_hand_player_detail.amt_bet_ttl, 1, 0])
and recent_losses:
Code: Select all
sum(if[ localtimestamp - interval '15 minutes' < tourney_holdem_hand_summary.date_imported AND NOT tourney_holdem_hand_player_statistics.flg_won_hand AND (tourney_holdem_blinds.amt_bb *tourney_holdem_blinds.val_nlpl_mult) <= tourney_holdem_hand_player_detail.amt_bet_ttl, 1, 0])
(by the way, this "streaks"-stat is somehow flawed, though working pretty good but not exactly as it should...) Now to my question: obviously these stats, together with kraada's "M"-Stat, are affected by the new incremental cache. But i can't figure out exactly, how. I get the impression, 80% of the time they still work, but then they put out some weird numbers. Can anybody tell me what's going on here?
merkur33
 
Posts: 126
Joined: Tue Nov 25, 2008 11:57 am

Re: How exactly will "recent" stats behave with the new cache?

Postby WhiteRider » Wed Feb 24, 2010 5:42 am

I'm not exactly sure whether they will still work correctly - I suspect they won't because each new value will be added to the cache so won't be forgotten when the time elapses. I've mentioned this to the development team to see if we can get a conclusive answer.
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: How exactly will "recent" stats behave with the new cache?

Postby merkur33 » Wed Feb 24, 2010 5:54 am

Oh, i see. so basically the longer i use these stats, the more wrong the numbers become? :shock: because the cache is never rebuilt from scrach (under normal circumstances) and it adds more and more once recent stats into the columns... dang! but sounds logical. I guess there is no easy way to fix this?
merkur33
 
Posts: 126
Joined: Tue Nov 25, 2008 11:57 am

Re: How exactly will "recent" stats behave with the new cache?

Postby kraada » Wed Feb 24, 2010 10:01 am

We've been discussing what to do as a result of these changes but I don't believe we've come to a conclusion in our discussions yet.
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