Author: Mark Boylan
Date: 21:47:11 03/03/06
Go up one level in this thread
I forgot to add the unique index on position_fen in the position table. And I noticed that you store hash values. I also noticed that you had some triggers, which I haven't read yet but I assume they are related to the hash values. I don't see any need for storing hash values in the database. The database will hash the fens itself and automatically handle collisions with the proverbial buckets. But a surrogate key on the unique fens should be more than adequate for most situations. Even a 10 million game database, where each game has 100 unique positions has only one billion positions. An int can handle 4x that many, and you don't need to worry about collisions because you don't assign the surrogate until you know you have a unique position within the database. If it's a worry, you can always use a bigint which is astronomical. You have an advantage in a user database because, even though the possible number of chess positions is almost limitless, a user's time is not. A user can only collect so many games and those games can only have so many positions. You don't have to give the positions a number until you know you've never seen them before. Chess engines are at a disadvantage because they need to be able to hash every possible chess position every game.
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.