diff --git a/vendor/nim-libbacktrace/vendor/libbacktrace-upstream/libtool b/vendor/nim-libbacktrace/vendor/libbacktrace-upstream/libtool index 0e6c4a029..478bd9161 100755 --- a/vendor/nim-libbacktrace/vendor/libbacktrace-upstream/libtool +++ b/vendor/nim-libbacktrace/vendor/libbacktrace-upstream/libtool @@ -2,7 +2,7 @@ # libtool - Provide generalized library-building support services. # Generated automatically by config.status (libbacktrace) version-unused -# Libtool was configured on host fv-az453-266: +# Libtool was configured on host fv-az132-410: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, diff --git a/waku/v2/node/storage/message/waku_message_store.nim b/waku/v2/node/storage/message/waku_message_store.nim index bedc27c1f..a9560a6dc 100644 --- a/waku/v2/node/storage/message/waku_message_store.nim +++ b/waku/v2/node/storage/message/waku_message_store.nim @@ -100,6 +100,12 @@ proc init*(T: type WakuMessageStore, db: SqliteDatabase, storeCapacity: int = 50 let numMessages = messageCount(db).get() debug "number of messages in sqlite database", messageNum=numMessages + # add index on receiverTimestamp + let addIndexStmt = "CREATE INDEX IF NOT EXISTS i_rt ON " & TABLE_TITLE & "(receiverTimestamp);" + let resIndex = db.query(addIndexStmt, proc(s: ptr sqlite3_stmt) = discard) + if resIndex.isErr: + return err("Could not establish index on receiverTimestamp: " & resIndex.error) + let storeMaxLoad = int(float(storeCapacity) * MaxStoreOverflow) let deleteWindow = int(float(storeMaxLoad - storeCapacity) / 2) let wms = WakuMessageStore(database: db,