From 19e0eb4444167f4339237fa53dced0e1bfebab5b Mon Sep 17 00:00:00 2001 From: trevor-signal <131492920+trevor-signal@users.noreply.github.com> Date: Fri, 23 Aug 2024 23:43:50 -0400 Subject: [PATCH] Speed up orphaned attachment check --- ts/sql/Server.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ts/sql/Server.ts b/ts/sql/Server.ts index 2043226e18bc..a63e7c842a7b 100644 --- a/ts/sql/Server.ts +++ b/ts/sql/Server.ts @@ -6653,7 +6653,7 @@ function pageMessages( (rowid INTEGER PRIMARY KEY ASC); INSERT INTO tmp_${runId}_updated_messages (rowid) - SELECT rowid FROM messages ORDER BY rowid ASC; + SELECT rowid FROM messages; CREATE TEMP TRIGGER tmp_${runId}_message_updates UPDATE OF json ON messages @@ -6679,7 +6679,6 @@ function pageMessages( ` DELETE FROM tmp_${runId}_updated_messages RETURNING rowid - ORDER BY rowid ASC LIMIT $chunkSize; ` )