The goal is to document the format in a simple way and to collect any suggestions on how to improve it.
It should also be noted that the format is still the one designed by Shane Hudson over 20 years ago.
And the main reason why a classic SQL database is not used is to obtain better performance.
The database is divided into 3 files:
.sn4 -> NameBase
.si4 -> Index
.sg4 -> GamesData
The NameBase consists of 4 reference tables which contain the names of the players, events, sites and rounds.
The correspondent in an SQL database would be:
Code: Select all
CREATE TABLE Players (Name varchar (255), NameID int);
CREATE TABLE Events (Name varchar (255), NameID int);
CREATE TABLE Sites (Name varchar (255), NameID int);
CREATE TABLE Rounds (Name varchar (255), NameID int);
https://en.wikipedia.org/wiki/Associative_entity
which allows to save space and speed up searches.
The binary format is described in the source code:
https://sourceforge.net/p/scid/code/ci/ ... d4.cpp#l31
The names are slightly compressed:
https://en.wikipedia.org/wiki/Incremental_encoding
The main drawback is the need to rewrite the entire file when something changes.
From a performance point of view, however, it is not a significant problem.
When there are multiple changes, for example because games are added to the database,
the tables are modified in memory and written to the file only once at the end of the operation.
In the next post I will describe the .si4 Index where the NameIDs of the NameBase are used.