Tutorial: Managing Multiple Databases

Frequently Asked Questions/Answers, Tutorials, and Common How To's

Moderator: Moderators

Tutorial: Managing Multiple Databases

Postby WhiteRider » Wed Aug 26, 2009 10:12 am

Tutorial: Managing Multiple Databases

Please see the Database Management & Maintenance Guide for general database information.

The PokerTracker 3 database was designed to handle millions of hands so there is no need to create multiple databases for different sites, limits, etc. One large database should be all that is required. The only time that a second database would be needed is if you opt to store observed hand histories in one database and played hands in another database.

This tutorial describes one way of managing observed hand databases should you feel the need to use more than one database.
This method uses a single database for your 'played' hands and multiple databases for 'observed' hands, each of which is used to import hands for an amount of time before creating the next database. The HUD is configured to use just the last few observed databases.
The advantages of this method are to keep your 'played' database fairly small (meaning quicker reports, analysis of results, housekeeping, etc) and allowing older observed hands to be ignored (by the HUD) once you judge that they are out of date and therefore no longer useful. The older observed hands [databases] can either be kept for reference or deleted.

Note: to create new databases you need to be registered - you cannot do this if you are using the free trial.

Starting out - the "Played" hands database

By default you will have a single database in PT3.
default database.png

I suggest renaming this database "Played" for clarity, but there is no need to do this - the original name is fine.
Alternatively you could create a new database called "Played" if you want to start fresh.

  • Select your main database in the list and click the Edit button.
  • On the Configure PostgreSQL Database window change the Name from "PokerTracker 3 Database" to "Played", and click Save.
    You should see this change reflected in the Database Management window.
rename Played.png
rename Played.png (11.93 KiB) Viewed 4992 times

Creating the first "Observed" hands database

Now we need to set up our first 'observed' database, which we're going to import observed hands into.
There is no firm rule how often you should start a new 'observed' database, but every couple of months should work pretty well. If you import a VERY large number of observed hands then you may find that you need to start new databases more often than this, but that would be an exceptional case - PT3 can handle very large databases.

So let's say it's January 2009 and we're intending to use this observed database until the end of February then create a new database every 2 months.

  • Still on the Database Management window click the New button.
  • Give your database a name - I like to be systematic about things like this, so a name like "obs_09_1_JanFeb" does the trick.
    obs=observed; 09=2009; 1=the first database of the year, this just means the names will be sorted correctly; JanFeb=visual name for clarity.
    You can just enter this in the Name field (which is how PT3 refers to the database) but I like to give the actual PostgreSQL database the same name so I enter the same into the PostgreSQL Server Information > Database field too.
  • Click Create and you should see your new database in the Database Management window.
new JanFeb.png
new JanFeb.png (11.92 KiB) Viewed 4995 times

Configuring Auto Import to import into the correct databases

We now need to configure Auto Import to import our played hands into the "Played" database and observed hands into the new "obs_09_1_JanFeb" database.

  • In the Auto Import > Preferences > Databases section untick Lock and select the appropriate databases from the dropdown lists.
    See the Tutorial: Using Auto Import for more information.
import DBs 1.png
import DBs 1.png (5.12 KiB) Viewed 4986 times

Manually importing observed hand histories

If you need to import a batch of observed hand history files you should use Manual Import instead of Auto Import (it's much faster) but you need to make sure you have set your current 'observed' database to be Active first, using the PT3 menu Database > Set Active Database, so that they are imported into the correct database.

Configuring the HUD to use the correct databases

Now we just need to tell the HUD to show stats based on hands from both databases.

  • Open the Configure HUD Profiles window from the PT3 menu Configure > Configure HUD and select the HUD Options tab.
  • In the Read From Databases section tick the checkboxes next to both of your databases.
    Note:When you only have these two databases if they are both unticked then they will both be used by the HUD because they are both configured to be auto imported into, but when you have more databases (see below) this becomes important.
  • Click OK to apply the change.

HUD DBs 1.png
HUD DBs 1.png (6.76 KiB) Viewed 5004 times

Creating and using the next observed database

When we get to the end of February and want to start a new observed database we repeat the above steps.

  • Create a new database called "obs_09_2_MarApr".
  • Configure Auto Import to import into "Played" and "obs_09_2_MarApr".
  • Configure the HUD Options to use all 3 databases.

import DBs 2.png
import DBs 2.png (5.28 KiB) Viewed 4992 times

HUD DBs 2.png
HUD DBs 2.png (7.09 KiB) Viewed 4999 times

You should be using the Housekeeping functions regularly to keep your databases running efficiently (see the "Database Maintenance" section of the Database Management & Maintenance Guide for more information) and if you run full housekeeping on the observed database that you are no longer going to import into ("obs_09_1_JanFeb" in this case) then you do not need to do it again for this database (as long as you don't import to it again, or create any new custom stats - in which case you should rebuild the cache for best performance).

Ongoing upkeep

Repeat the above process every 2 months (or however often you have decided to start new databases), the only difference being that as the months and databases pass by you probably won't want to keep using all the older databases in the HUD. For example you might just want to use the current 'observed' database along with the most recent two (and 'played' database of course) so once you get to "obs_09_4_JulAug" you could un-select "obs_09_1_JanFeb" from the HUD Options.

HUD DBs 4.png
HUD DBs 4.png (7.64 KiB) Viewed 4991 times
Posts: 52496
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Return to FAQs, Tutorials, and How To's [Read Only]

Who is online

Users browsing this forum: No registered users and 1 guest