mirror of
https://github.com/chatmail/core.git
synced 2026-05-20 23:36:30 +03:00
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:
@@ -594,7 +594,7 @@ impl Context {
|
|||||||
|
|
||||||
let list = if let Some(chat_id) = chat_id {
|
let list = if let Some(chat_id) = chat_id {
|
||||||
do_query(
|
do_query(
|
||||||
"SELECT m.id AS id, m.timestamp AS timestamp
|
"SELECT m.id AS id
|
||||||
FROM msgs m
|
FROM msgs m
|
||||||
LEFT JOIN contacts ct
|
LEFT JOIN contacts ct
|
||||||
ON m.from_id=ct.id
|
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.
|
// 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.
|
// The limit is documented and UI may add a hint when getting 1000 results.
|
||||||
do_query(
|
do_query(
|
||||||
"SELECT m.id AS id, m.timestamp AS timestamp
|
"SELECT m.id AS id
|
||||||
FROM msgs m
|
FROM msgs m
|
||||||
LEFT JOIN contacts ct
|
LEFT JOIN contacts ct
|
||||||
ON m.from_id=ct.id
|
ON m.from_id=ct.id
|
||||||
|
|||||||
Reference in New Issue
Block a user