Page 1 of 1
Custom Query

Posted:
Sun Nov 24, 2013 5:06 pm
by bodhisoma
Wanted to make a stat that was something like "Given the last 10 hands, how many were steal attempts between 8 and 20bb live stacks."
Kraada and I spoke about it some time ago but going back to his instructions, I think we were discussing a custom report, I want to do this as a stat.
Possible?
Re: Custom Query

Posted:
Mon Nov 25, 2013 4:38 am
by WhiteRider
Individual stats can't get information just from the last X hands. If this stat is to be used in the Hud while playing then we may be able to do something by using the time the hands were played.
Are you using PT3 or PT4?
Re: Custom Query

Posted:
Mon Nov 25, 2013 9:09 am
by bodhisoma
PT4, latest build (4.10.5 if I'm not mistaken).
Re: Custom Query

Posted:
Mon Nov 25, 2013 10:57 am
by kraada
I don't think the PT4 live table has enough information to make this particular stat.
Re: Custom Query

Posted:
Mon Nov 25, 2013 11:32 am
by bodhisoma
In pseudo sql, why not something like
SELECT FROM `table` WHERE 'blinds' >= 8 AND 'blinds' <= 20 ORDER BY timestamp LIMIT 0, 10
...?
Re: Custom Query

Posted:
Mon Nov 25, 2013 2:10 pm
by kraada
Stats are kept per player per hand; the amount of table-wide data is actually fairly small (take a look at the cash_hand_summary table vs the cash_hand_player_statistics table in PGAdmin).
Re: Custom Query

Posted:
Mon Nov 25, 2013 2:39 pm
by bodhisoma
I feel bad for asking this because when you say it can't be done, I believe you. I just don't understand why table-wide data is needed.
I can have a stat that tells me how many times they attempted to steal between 8 and 20bb, why would sorting the query results by timestamp and limiting the return lines involve table data?
Or are you saying each entry doesn't have a timestamp?
Re: Custom Query

Posted:
Mon Nov 25, 2013 3:13 pm
by kraada
It does, but the index doesn't sort by it. So the query would have to traverse the table which would take a lot longer than you'd otherwise expect. It's possible in the sense that it would work but not in the sense that it would work with reasonable results timewise.