From 4436001bb361ad4f9e4e05819214ecf0ea77c063 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Fri, 23 Oct 2026 16:57:14 +0200 Subject: database: Add indices to improve performance --- libdino/src/service/database.vala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libdino/src/service') diff --git a/libdino/src/service/database.vala b/libdino/src/service/database.vala index fba6f7a2..30032e2c 100644 --- a/libdino/src/service/database.vala +++ b/libdino/src/service/database.vala @@ -7,7 +7,7 @@ using Dino.Qlite; namespace Dino { public class Database : Qlite.Database { - private const int VERSION = 34; + private const int VERSION = 35; public class AccountTable : Table { public Column id = new Column.Integer("id") { primary_key = true, auto_increment = true }; @@ -49,6 +49,7 @@ public class Database : Qlite.Database { base(db, "entity"); init({id, account_id, jid_id, resource, caps_hash, last_seen}); unique({account_id, jid_id, resource}, "IGNORE"); + index("entity_account_jid_resource_idx", {account_id, jid_id, resource}); } } @@ -376,6 +377,7 @@ public class Database : Qlite.Database { init({entity, feature}); unique({entity, feature}, "IGNORE"); index("entity_feature_idx", {entity}); + index("entity_feature_feature_idx", {entity, feature}); } } -- cgit v1.3