ChessDB File Formats

ChessDB databases consist of three essential files: an Index file, a Name file and a Game file. All have a two-letter suffix starting with "s": ".si" for index files, ".sn" for name files, and ".sg" for game files.

The Index (.si) file

This file contains a description for the database and a small fixed-size entry for each game. The current size is 41 bytes per game. Of this, about 28 bytes is essential information such as the result, date, player/event/site name ID numbers (the actual names are in the Name file), etc.

The remaining 13 bytes contain redundant but useful information about the game that is used to speed up position, material and pattern searches. See the section Fast searches below for more information.

The Name (.sn) file

This file contains all player, event, site and round names used in the database. Each name is stored only once even if it occurs in many games. The name file is usually the smallest of the three essential files in a database.

The Game (.sg) file

This file contains the actual moves, variations and comments of each game. The move encoding format is very compact: most moves take only one byte of storage.

When a game is replaced, its new version is saved to the end of the game file, so wasted space can accumulate over time. You can restore a database to its minimal size by compacting it.

Other ChessDB files

An EPD file (suffix: ".epd") contains a number of chess positions, each with a text comment. The EPD file format is described in the PGN standard.

An email (suffix: ".sem") file for a database stores details of the opponents you send email messages to.

A SearchOptions (suffix: ".sso") file contains ChessDB header or material/pattern search settings.

Fast searches in ChessDB

As mentioned above, the index file stores some redundant but useful information about each game to speed up position or material searches.

For example, the material of the final position is stored. If you search for rook and pawn endings, then all games that end with a queen, bishop or knight on the board (and have no pawn promotions) will be quickly skipped over.

Another useful piece of information stored is the order in which pawns leave their home squares (by moving, or by being captured). This is used to speed up tree or exact position searches, especially for opening positions. For example, when searching for the starting position of the French defence (1.e4 e6), every game starts with 1.e4 c5, or 1.d4, etc, will be skipped, but games starting with 1.e4 e5 will still need to be searched.

(Updated: ChessDB 2.5, June 2001)