about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-05-07 17:27:15 -0400
committerJune McEnroe <june@causal.agency>2021-05-07 17:31:52 -0400
commitcb74efc6054577367fb918565e6ac9ad33f6071e (patch)
tree3bad040f7ce6d46a4d29022ee5a3a106bd0f56db
parentGet list of formats to test from unscoop itself (diff)
downloadlitterbox-cb74efc6054577367fb918565e6ac9ad33f6071e.tar.gz
litterbox-cb74efc6054577367fb918565e6ac9ad33f6071e.zip
Limit query interface results using search.rowid DESC
This vastly increases the speed of the query for any search with a
decent number of matches. It can be slightly less accurate since
it depends on the insert order of events, but that usually won't
be a problem for a query limited to a single network. The litterbox
query interface isn't meant to exhaustively list results either.
Diffstat (limited to '')
-rw-r--r--litterbox.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/litterbox.c b/litterbox.c
index 19bdca6..f219d37 100644
--- a/litterbox.c
+++ b/litterbox.c
@@ -288,7 +288,7 @@ static void querySearch(struct Message *msg) {
 			WHERE contexts.network = :network
 				AND coalesce(contexts.query = :query, true)
 				AND search MATCH :search
-			ORDER BY time DESC, event DESC
+			ORDER BY search.rowid DESC
 			LIMIT :limit
 		)
 		SELECT * FROM results