Skip to content

Migrating database format to duckdb + aix #760

@franciscoBSalgueiro

Description

@franciscoBSalgueiro

Describe the feature

I'm considering changing the current database format to a duckdb database running the aix extension that provides several useful chess functions we can use.

https://github.com/duckdb/duckdb
https://github.com/thomas-daniels/aix

Why?

The main advantages would be:

  • Easily and efficiently query multiple databases at the same time
  • No need for manual indexing, duckdb is extremely efficient for the types of queries En Croissant runs
  • Better space efficiency, in large part because of the above
  • One file database (this used to be the case with En Croissant, but I recently introduced a new custom index file to reduce startup loading times)
  • Built-in support for Scoutfish syntax for complex position queries (partial searches, maneuvers, material imbalance, etc.)
  • Combining position filters with metadata filters. Our current setup does not allow us to do this very easily.

What's missing?

  • aix doesn't yet have an optimized exact query function that matches the performance of the current setup. This is necessary because exact position searches are the most commonly used query and they need to be extremely fast for the opening explorer to feel responsive. (Exact FEN match thomas-daniels/aix#1)
  • aix doesn't support Chess 960 or games starting from a custom starting position
  • None of the move encodings provided by aix support nested variations. They could be encoded in a column separate from movedata, but we would have to consider on how exactly that should look like.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions