diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-05-21 11:53:02 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-05-23 01:48:09 +0200 |
commit | bd6644214c757a08c1c533048352a902fdefe4ae (patch) | |
tree | 6f511e147ab648dee286afd2d79c79b9ba18267b /schema.sql | |
parent | 649fcc09f6addf06dda10862a0f8ff5da19d536e (diff) | |
download | server-bd6644214c757a08c1c533048352a902fdefe4ae.tar.gz |
Improve replay id handling.
Use a without rowid table and create the replay_id dynamically.
This saves a lot of database space and performance as it removes
the need for a separate index.
Diffstat (limited to 'schema.sql')
-rw-r--r-- | schema.sql | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -318,14 +318,13 @@ create view game_chat_view as create index if not exists game_chat_idx on game_chat(game_id); create table if not exists game_replay ( - replay_id integer primary key, game_id integer, + replay_id integer, role text, action text, - arguments json -- numeric affinity is more compact for numbers -); - -create index if not exists game_replay_idx on game_replay(game_id); + arguments json, -- numeric affinity is more compact for numbers + primary key (game_id, replay_id) +) without rowid; create table if not exists game_notes ( game_id integer, |