The Poker Copilot Blog

Tracking the development of Poker Copilot, Mac OS X software for poker analysis and statistics.

Saturday, 16 January 2010

Poker Copilot Database Improvements

Some Poker Copilot users have been having sporadic hangs or really slow refreshes. I suspect this is happening for users with loads of hands in their database. Like 1 million+. So I've been doing some profiling of Poker Copilot's database queries.

I've stumbled upon a couple of full table scans taking place. To translate into English "full table scan" is database-speak for "dog slow". A simple tweak or two fixed this, and reduced the time it takes to import a million hands by about 10%.

More aggressive caching has given a further 10% improvement. I knocked another 2-3% off the import time by removing some columns that were being populated but never used.

I've also created a new denormalised table for Position Summary and Stake Level Summary. To translate again, "denormalised table" is database-speak for "table that has unnecessary redundant information but goes at light-speed". For big databases, this reduces the time taken for Position Summary and Stake Level Summary updates by two orders of magnitude. Two orders of magnitude? That's right, what was taking 25 seconds now takes 0.25 seconds. I suspect this is mostly happening because the denormalised table is small enough to be entirely held in memory.

The downside of the new denormalised table is that it adds about 10% to the time taken to import a million hands. But I think it is a good trade-off. On my iMac, importing a million hands takes a little under two hours.

These changes have not been straight forward. I find a problem. I implement a trial solution. I run a full import of all my test data, which takes about two hours. I then measure the results, not just for the import but also for the various summaries and filters. Sometimes I find the trial solution has made things worse. So I have to undo the trial solution and go to plan B. Then I repeat the whole escapade.

This takes time. Mostly spent waiting. Which is why I've been spending time on the Mac Poker Software mini-site experiment. I hope that the database profiling pays off to give all users a smoother, faster experience.

Last night, while letting a million hands load, I played two tables simultaneously. The HUD continued to update within a couple of seconds after each hand for the full duration.

I hope to release a test version of this update for you to try out within a few days.



4 comments:

KeithX said...

The database improvements sound great, I look forward to seeing them soon. Import time is almost meaningless to me, once the DB is set up I never have to worry about it. So I'd suggest you always make the import time vs. HUD / stats refresh time tradeoff in favor of the actual playing elements.

As for Mac Poker Software, it's off to a good start. Why not have it be a full-featured blog with comments, and then make all your posts that aren't specific to Poker Copilot over there instead of here? You could focus this site on selling and customer service and that one on linkbait. Wordpress is so easy, it wouldn't take much effort to get things humming over there.

frailty said...

I think you should leave the whole blog here! I chose Copilot over PT3 because I saw how active you are (and how much effort you put into this) on this blog and that really set my decision.

Steve McLeod said...

@Keith and Frailty: Thanks for the comments. I'm very attached to this blog, so there's not much chance of me diminishing my writings here, no matter where I go with "Mac Poker Software".

@Keith, you are right, WordPress is crazily easy. I should have been using it long ago.

goldenad said...

on a completely different note, the search Gmail feature is beyond amazing. this has made my record keeping so much easier now that i dont have to copy and paste every single result! keep up the fantastic work

 

Poker Copilot

Free 30 Day Trial

Only $69

Order risk free with our 30-day money back guarantee.

  • Poker software for Mac OS X
  • Supports Full Tilt Poker and PokerStars
  • Analyses your opponents while you play
  • On-table HUD for Mac
  • Easy to use, easy to understand

Watch a demo of the major features of Poker Copilot