diff options
author | June McEnroe <june@causal.agency> | 2021-05-07 17:27:15 -0400 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2021-05-07 17:31:52 -0400 |
commit | cb74efc6054577367fb918565e6ac9ad33f6071e (patch) | |
tree | 3bad040f7ce6d46a4d29022ee5a3a106bd0f56db | |
parent | Get list of formats to test from unscoop itself (diff) | |
download | litterbox-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.
-rw-r--r-- | litterbox.c | 2 |
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 |