-
-
Notifications
You must be signed in to change notification settings - Fork 89
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
reactions index left out on purpose? #5507
Comments
I don't see in the SQLite docs that |
iequidoo
added a commit
that referenced
this issue
May 31, 2024
This should speed up get_msg_reactions() filtering reactions by `msg_id`, but also other queries in other places involving both `msg_id` and `contact_id`.
iequidoo
added a commit
that referenced
this issue
May 31, 2024
This should speed up `get_msg_reactions()` filtering reactions by `msg_id`, but also queries in other places involving both `msg_id` and `contact_id`.
iequidoo
added a commit
that referenced
this issue
Jun 1, 2024
This should speed up `get_msg_reactions()` filtering reactions by `msg_id`, but also queries in other places involving both `msg_id` and `contact_id`.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
during working on showing reactions in summaries i noticed that there is no sql-index over any reactions column - where we were adding index otherwise on even smaller tables - and reactions table can become quite big, it is only currently small as it is a new feature :)
also, the reaction table is queried often - at least for every message and every chatlist item displayed.
reactions use the following statements that need a full scan currently:
all of them could benefit from an index over
msg_id
- combined index is probably over the top as the most often called query is the first one.wondering if the index was left out on purpose? cc @iequidoo @link2xt - otherwise, we should add one with
CREATE INDEX reactions_index1 ON reactions(msg_id)
EDIT: or does the
FOREIGN KEY(msg_id)
imply an index? my source of truth is the sqlite3browser, maybe i've also overseen sthThe text was updated successfully, but these errors were encountered: