PDA

View Full Version : technical question on number of queries performed by HUD



DeepBlue
05-06-2010, 07:40 PM
I am hoping someone in engineering can answer this. How exactly does the querying work for HUD stats?

I.e., is the HUD asking for each stat to be updated for each player in a separate query, like is it doing a SELECT for each stat for each player on the table, or is it doing a select per player (and including all stats in the select statement)?

Is it doing more than select, i.e., where do the stats get calculated - on the fly when new hands are imported by a trigger on the database, or does the HUD's query do this in realtime (either triggering a new value of the stat to be stored, or doing the calculations in real-time, the latter of which I would doubt)?

Finally, does it request the stats EVERY hand, or does it do it less often when players have say 100 or 1k hands on them, and thus stats don't really need to be updated every hand?

Basically I am just trying to figure out how many queries per hand are actually being sent over the wire.

netsrak
05-07-2010, 04:57 AM
I'll forward this question to our developers.

Mike chops
05-07-2010, 06:57 AM
I wrote the hud display code. Not the postgres end but I think I can answer.

One select per player

I'm not sure. I think it is just the same query ran each hand and postgres caches results?

Yes stats are updated every hand.

DeepBlue
05-07-2010, 11:45 PM
Thanks Mike! The reason I ask is because I am running the database server on the LAN and i think I improved my HUD simply by switching to a wired connection all the way around, instead of wireless. I seem to notice an improvement in the client-side response (ping times did go down to under 1 ms from an average of 2 ms), so I wanted to see if that made sense from what's actually going on. I think it does - even if it's just one SELECT per player per table, when playing even six tables, that's a lot of interaction with the database (plus the auto import).