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`
This commit is contained in:
bjoern
2022-07-09 18:25:57 +02:00
committed by GitHub
parent d9003f344e
commit 2f3f5a34b4

View File

@@ -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