-
-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Loading chats in Delta Chat Desktop got much slower after upgrade to core 1.156.0 #6585
Comments
In dev console I get messages "renderer/stores/MessageListStore loadChat took 1770.0999999940395".
Will try to bisect the core. |
Maybe slowdown is due to #6554 |
Saved messages were added in #5606 If the issue is that |
I did not bisect, but checked that this simple patch speeds up chat loading visibly:
So we need an index (or an explicit backlink, but if a single migration adding an index works then better an index). |
I manually did |
I have made this testcase for SQLite query planner: #!/bin/sh
{
cat <<EOF
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE msgs (
id INTEGER PRIMARY KEY AUTOINCREMENT,
txt TEXT NOT NULL,
starred INTEGER DEFAULT 0,
chat_id INTEGER DEFAULT 0
);
EOF
for i in $(seq 300); do
cat <<EOF
INSERT INTO msgs (txt) VALUES('foobar');
EOF
done
cat <<EOF
CREATE INDEX my_index ON msgs (starred);
COMMIT;
-- At this point query planner decides to use the index.
EXPLAIN QUERY PLAN SELECT id FROM msgs WHERE starred=? AND chat_id!=?;
ANALYZE;
-- After analyzing, query planner stops using the index and scans the whole msgs table.
EXPLAIN QUERY PLAN SELECT id FROM msgs WHERE starred=? AND chat_id!=?;
-- Now we have to resort to forcing using the index because query planner makes wrong decision.
EXPLAIN QUERY PLAN SELECT id FROM msgs INDEXED BY my_index WHERE starred=? AND chat_id!=?;
EOF
} | sqlite3 With SQLite
|
I have reported this to SQLite forum: https://sqlite.org/forum/forumpost/49fd145748 |
I wrote more here: https://sqlite.org/forum/forumpost/edcd4ecddb |
I have
git bisect
-ed the problem and it seems to be commit deltachat/deltachat-desktop@c60aa90Core was updated from 1.155.6 to 1.156.0. Maybe it is the core issue.
The text was updated successfully, but these errors were encountered: