Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Yep, got 'em. Thanks!

Author: Dann Corbit

Date: 11:48:19 03/04/06

Go up one level in this thread


On March 04, 2006 at 00:47:11, Mark Boylan wrote:

>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.

The reason I was storing a hash was that the EPD string is to big to use as a
primary key, propagating through all the tables.  But you are right that the
hash does not really have any value.

A better idea is just to use an integral key and use the EPD as an alternate key
(I actually plan to use a 24 byte encoding of the EPD string, rather than
storing the whole thing).

>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.

I have about 4 million games, and I have a friend who has 20 million (he pulls
all the rated games from the chess servers with a script).  I can see exceeding
4 billion positions, eventually.

>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.