From 2f3f5a34b46168b1154a4754907836dede0b41bc Mon Sep 17 00:00:00 2001 From: bjoern Date: Sat, 9 Jul 2022 18:25:57 +0200 Subject: [PATCH] do not `SELECT timestamp` if not used (#3493) * do not `SELECT timestamp` if not used ordering is by `id` since #2364, selecting `timestamp` is not needed. (came over this when keeping `id` on downloading in #3487 - had in mind there was sth. special with ids ... however, the assumption of #2364 is even more true with #3487 - before, new (and then maybe much larger) ids were inserted and could result in wrong search result ordering) * remove another unused `SELECT timestamp` --- src/context.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/context.rs b/src/context.rs index 020f35b72..c7f83d301 100644 --- a/src/context.rs +++ b/src/context.rs @@ -594,7 +594,7 @@ impl Context { let list = if let Some(chat_id) = chat_id { do_query( - "SELECT m.id AS id, m.timestamp AS timestamp + "SELECT m.id AS id FROM msgs m LEFT JOIN contacts ct ON m.from_id=ct.id @@ -618,7 +618,7 @@ impl Context { // According to some tests, this limit speeds up eg. 2 character searches by factor 10. // The limit is documented and UI may add a hint when getting 1000 results. do_query( - "SELECT m.id AS id, m.timestamp AS timestamp + "SELECT m.id AS id FROM msgs m LEFT JOIN contacts ct ON m.from_id=ct.id