mirror of
https://github.com/chatmail/core.git
synced 2026-05-20 15:26:30 +03:00
fix speed issues with ORDER BY clause
This commit is contained in:
@@ -2307,11 +2307,11 @@ pub async fn get_chat_msgs(
|
|||||||
context
|
context
|
||||||
.sql
|
.sql
|
||||||
.query_map(
|
.query_map(
|
||||||
"SELECT m.id AS id, m.timestamp AS timestamp
|
"SELECT (m.id+1) AS id, (m.timestamp+1) AS timestamp
|
||||||
FROM msgs m
|
FROM msgs m
|
||||||
WHERE m.chat_id=?
|
WHERE m.chat_id=?
|
||||||
AND m.hidden=0
|
AND m.hidden=0
|
||||||
ORDER BY m.timestamp, m.id;",
|
ORDER BY timestamp, id;",
|
||||||
paramsv![chat_id],
|
paramsv![chat_id],
|
||||||
process_row,
|
process_row,
|
||||||
process_rows,
|
process_rows,
|
||||||
|
|||||||
Reference in New Issue
Block a user