|
|
|
@@ -3739,6 +3739,24 @@ SEARCH commands USING COVERING INDEX idx_commands_connection_id (connection_id=?
|
|
|
|
|
SEARCH messages USING COVERING INDEX idx_messages_connection_id (connection_id=?)
|
|
|
|
|
SEARCH snd_files USING COVERING INDEX idx_snd_files_connection_id (connection_id=?)
|
|
|
|
|
|
|
|
|
|
Query:
|
|
|
|
|
DELETE FROM connections WHERE connection_id IN (
|
|
|
|
|
SELECT connection_id
|
|
|
|
|
FROM connections c
|
|
|
|
|
JOIN user_contact_links uc USING (user_contact_link_id)
|
|
|
|
|
WHERE uc.user_id = ? AND uc.group_id = ?
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
Plan:
|
|
|
|
|
SEARCH connections USING INTEGER PRIMARY KEY (rowid=?)
|
|
|
|
|
LIST SUBQUERY 1
|
|
|
|
|
SEARCH uc USING INDEX idx_user_contact_links_group_id (group_id=?)
|
|
|
|
|
SEARCH c USING COVERING INDEX idx_connections_user_contact_link_id (user_contact_link_id=?)
|
|
|
|
|
SEARCH msg_deliveries USING COVERING INDEX idx_msg_deliveries_agent_msg_id (connection_id=?)
|
|
|
|
|
SEARCH commands USING COVERING INDEX idx_commands_connection_id (connection_id=?)
|
|
|
|
|
SEARCH messages USING COVERING INDEX idx_messages_connection_id (connection_id=?)
|
|
|
|
|
SEARCH snd_files USING COVERING INDEX idx_snd_files_connection_id (connection_id=?)
|
|
|
|
|
|
|
|
|
|
Query:
|
|
|
|
|
DELETE FROM connections WHERE connection_id IN (
|
|
|
|
|
SELECT connection_id
|
|
|
|
@@ -3822,6 +3840,26 @@ SEARCH group_members USING COVERING INDEX idx_group_members_member_profile_id (m
|
|
|
|
|
SEARCH group_members USING COVERING INDEX idx_group_members_contact_profile_id (contact_profile_id=?)
|
|
|
|
|
SEARCH contacts USING COVERING INDEX idx_contacts_contact_profile_id (contact_profile_id=?)
|
|
|
|
|
|
|
|
|
|
Query:
|
|
|
|
|
DELETE FROM contact_profiles
|
|
|
|
|
WHERE contact_profile_id in (
|
|
|
|
|
SELECT cr.contact_profile_id
|
|
|
|
|
FROM contact_requests cr
|
|
|
|
|
JOIN user_contact_links uc USING (user_contact_link_id)
|
|
|
|
|
WHERE uc.user_id = ? AND uc.group_id = ?
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
Plan:
|
|
|
|
|
SEARCH contact_profiles USING INTEGER PRIMARY KEY (rowid=?)
|
|
|
|
|
LIST SUBQUERY 1
|
|
|
|
|
SEARCH uc USING INDEX idx_user_contact_links_group_id (group_id=?)
|
|
|
|
|
SEARCH cr USING INDEX idx_contact_requests_user_contact_link_id (user_contact_link_id=?)
|
|
|
|
|
SEARCH contact_requests USING COVERING INDEX idx_contact_requests_contact_profile_id (contact_profile_id=?)
|
|
|
|
|
SEARCH connections USING COVERING INDEX idx_connections_custom_user_profile_id (custom_user_profile_id=?)
|
|
|
|
|
SEARCH group_members USING COVERING INDEX idx_group_members_member_profile_id (member_profile_id=?)
|
|
|
|
|
SEARCH group_members USING COVERING INDEX idx_group_members_contact_profile_id (contact_profile_id=?)
|
|
|
|
|
SEARCH contacts USING COVERING INDEX idx_contacts_contact_profile_id (contact_profile_id=?)
|
|
|
|
|
|
|
|
|
|
Query:
|
|
|
|
|
DELETE FROM contact_profiles
|
|
|
|
|
WHERE user_id = ? AND contact_profile_id = ?
|
|
|
|
@@ -3929,6 +3967,30 @@ SEARCH groups USING COVERING INDEX sqlite_autoindex_groups_1 (user_id=? AND loca
|
|
|
|
|
SEARCH contacts USING COVERING INDEX sqlite_autoindex_contacts_1 (user_id=? AND local_display_name=?)
|
|
|
|
|
SEARCH users USING INTEGER PRIMARY KEY (rowid=?)
|
|
|
|
|
|
|
|
|
|
Query:
|
|
|
|
|
DELETE FROM display_names
|
|
|
|
|
WHERE user_id = ?
|
|
|
|
|
AND local_display_name in (
|
|
|
|
|
SELECT cr.local_display_name
|
|
|
|
|
FROM contact_requests cr
|
|
|
|
|
JOIN user_contact_links uc USING (user_contact_link_id)
|
|
|
|
|
WHERE uc.user_id = ? AND uc.group_id = ?
|
|
|
|
|
)
|
|
|
|
|
AND local_display_name NOT IN (SELECT local_display_name FROM users WHERE user_id = ?)
|
|
|
|
|
|
|
|
|
|
Plan:
|
|
|
|
|
SEARCH display_names USING PRIMARY KEY (user_id=? AND local_display_name=?)
|
|
|
|
|
LIST SUBQUERY 1
|
|
|
|
|
SEARCH uc USING INDEX idx_user_contact_links_group_id (group_id=?)
|
|
|
|
|
SEARCH cr USING INDEX idx_contact_requests_user_contact_link_id (user_contact_link_id=?)
|
|
|
|
|
LIST SUBQUERY 2
|
|
|
|
|
SEARCH users USING INTEGER PRIMARY KEY (rowid=?)
|
|
|
|
|
SEARCH contact_requests USING COVERING INDEX sqlite_autoindex_contact_requests_1 (user_id=? AND local_display_name=?)
|
|
|
|
|
SEARCH group_members USING COVERING INDEX idx_group_members_user_id_local_display_name (user_id=? AND local_display_name=?)
|
|
|
|
|
SEARCH groups USING COVERING INDEX sqlite_autoindex_groups_1 (user_id=? AND local_display_name=?)
|
|
|
|
|
SEARCH contacts USING COVERING INDEX sqlite_autoindex_contacts_1 (user_id=? AND local_display_name=?)
|
|
|
|
|
SEARCH users USING INTEGER PRIMARY KEY (rowid=?)
|
|
|
|
|
|
|
|
|
|
Query:
|
|
|
|
|
DELETE FROM display_names
|
|
|
|
|
WHERE user_id = ? AND local_display_name = (
|
|
|
|
@@ -4048,13 +4110,6 @@ LIST SUBQUERY 1
|
|
|
|
|
SEARCH groups USING INTEGER PRIMARY KEY (rowid=?)
|
|
|
|
|
SEARCH groups USING COVERING INDEX idx_groups_group_profile_id (group_profile_id=?)
|
|
|
|
|
|
|
|
|
|
Query:
|
|
|
|
|
INSERT INTO calls
|
|
|
|
|
(contact_id, shared_call_id, call_uuid, chat_item_id, call_state, call_ts, user_id, created_at, updated_at)
|
|
|
|
|
VALUES (?,?,?,?,?,?,?,?,?)
|
|
|
|
|
|
|
|
|
|
Plan:
|
|
|
|
|
|
|
|
|
|
Query:
|
|
|
|
|
INSERT INTO chat_item_moderations
|
|
|
|
|
(group_id, moderator_member_id, item_member_id, shared_msg_id, created_by_msg_id, moderated_at)
|
|
|
|
@@ -4169,14 +4224,6 @@ Query:
|
|
|
|
|
Plan:
|
|
|
|
|
SEARCH group_members USING INDEX sqlite_autoindex_group_members_1 (group_id=?)
|
|
|
|
|
|
|
|
|
|
Query:
|
|
|
|
|
SELECT chat_item_id, timed_ttl
|
|
|
|
|
FROM chat_items
|
|
|
|
|
WHERE user_id = ? AND contact_id = ? AND item_status = ? AND timed_ttl IS NOT NULL AND timed_delete_at IS NULL
|
|
|
|
|
|
|
|
|
|
Plan:
|
|
|
|
|
SEARCH chat_items USING INDEX idx_chat_items_contacts (user_id=? AND contact_id=? AND item_status=?)
|
|
|
|
|
|
|
|
|
|
Query:
|
|
|
|
|
SELECT chat_item_id, timed_ttl
|
|
|
|
|
FROM chat_items
|
|
|
|
@@ -4255,13 +4302,6 @@ Query:
|
|
|
|
|
Plan:
|
|
|
|
|
SEARCH chat_items USING INTEGER PRIMARY KEY (rowid=?)
|
|
|
|
|
|
|
|
|
|
Query:
|
|
|
|
|
UPDATE chat_items SET item_status = ?, updated_at = ?
|
|
|
|
|
WHERE user_id = ? AND contact_id = ? AND item_status = ?
|
|
|
|
|
|
|
|
|
|
Plan:
|
|
|
|
|
SEARCH chat_items USING INDEX idx_chat_items_contacts (user_id=? AND contact_id=? AND item_status=?)
|
|
|
|
|
|
|
|
|
|
Query:
|
|
|
|
|
UPDATE chat_items SET item_status = ?, updated_at = ?
|
|
|
|
|
WHERE user_id = ? AND contact_id = ? AND item_status = ? AND chat_item_id = ?
|
|
|
|
@@ -5227,6 +5267,10 @@ Query: SELECT chat_item_id FROM chat_items WHERE user_id = ? AND group_id = ?
|
|
|
|
|
Plan:
|
|
|
|
|
SEARCH chat_items USING COVERING INDEX idx_chat_items_group_scope_item_ts (user_id=? AND group_id=? AND group_scope_tag=? AND group_scope_group_member_id=?)
|
|
|
|
|
|
|
|
|
|
Query: SELECT chat_item_id FROM chat_items WHERE user_id = ? AND group_id = ? AND group_scope_tag IS NULL AND group_scope_group_member_id IS NULL AND LOWER(item_text) LIKE '%' || LOWER(?) || '%' ORDER BY item_ts DESC, chat_item_id DESC LIMIT ?
|
|
|
|
|
Plan:
|
|
|
|
|
SEARCH chat_items USING INDEX idx_chat_items_group_scope_item_ts (user_id=? AND group_id=? AND group_scope_tag=? AND group_scope_group_member_id=?)
|
|
|
|
|
|
|
|
|
|
Query: SELECT chat_item_id FROM chat_items WHERE user_id = ? AND group_id = ? AND group_scope_tag IS NULL AND group_scope_group_member_id IS NULL ORDER BY item_ts DESC, chat_item_id DESC LIMIT ?
|
|
|
|
|
Plan:
|
|
|
|
|
SEARCH chat_items USING COVERING INDEX idx_chat_items_group_scope_item_ts (user_id=? AND group_id=? AND group_scope_tag=? AND group_scope_group_member_id=?)
|
|
|
|
@@ -5244,10 +5288,6 @@ Error: SQLite3 returned ErrorError while attempting to perform prepare "explain
|
|
|
|
|
Query: DELETE FROM app_settings
|
|
|
|
|
Plan:
|
|
|
|
|
|
|
|
|
|
Query: DELETE FROM calls WHERE user_id = ? AND contact_id = ?
|
|
|
|
|
Plan:
|
|
|
|
|
SEARCH calls USING INDEX idx_calls_contact_id (contact_id=?)
|
|
|
|
|
|
|
|
|
|
Query: DELETE FROM chat_item_mentions WHERE chat_item_id = ?
|
|
|
|
|
Plan:
|
|
|
|
|
SEARCH chat_item_mentions USING COVERING INDEX idx_chat_item_mentions_chat_item_id (chat_item_id=?)
|
|
|
|
@@ -5292,7 +5332,7 @@ SEARCH chat_items USING COVERING INDEX idx_chat_items_fwd_from_chat_item_id (fwd
|
|
|
|
|
SEARCH files USING COVERING INDEX idx_files_chat_item_id (chat_item_id=?)
|
|
|
|
|
SEARCH groups USING COVERING INDEX idx_groups_chat_item_id (chat_item_id=?)
|
|
|
|
|
|
|
|
|
|
Query: DELETE FROM chat_items WHERE user_id = ? AND contact_id = ? AND created_at <= ? AND item_content_tag != 'chat_banner'
|
|
|
|
|
Query: DELETE FROM chat_items WHERE user_id = ? AND contact_id = ? AND created_at <= ? AND item_content_tag != 'chatBanner'
|
|
|
|
|
Plan:
|
|
|
|
|
SEARCH chat_items USING INDEX idx_chat_items_contacts_created_at (user_id=? AND contact_id=? AND created_at<?)
|
|
|
|
|
SEARCH chat_item_mentions USING COVERING INDEX idx_chat_item_mentions_chat_item_id (chat_item_id=?)
|
|
|
|
@@ -5304,7 +5344,7 @@ SEARCH chat_items USING COVERING INDEX idx_chat_items_fwd_from_chat_item_id (fwd
|
|
|
|
|
SEARCH files USING COVERING INDEX idx_files_chat_item_id (chat_item_id=?)
|
|
|
|
|
SEARCH groups USING COVERING INDEX idx_groups_chat_item_id (chat_item_id=?)
|
|
|
|
|
|
|
|
|
|
Query: DELETE FROM chat_items WHERE user_id = ? AND contact_id = ? AND item_content_tag != 'chat_banner'
|
|
|
|
|
Query: DELETE FROM chat_items WHERE user_id = ? AND contact_id = ? AND item_content_tag != 'chatBanner'
|
|
|
|
|
Plan:
|
|
|
|
|
SEARCH chat_items USING INDEX idx_chat_items_contacts_created_at (user_id=? AND contact_id=?)
|
|
|
|
|
SEARCH chat_item_mentions USING COVERING INDEX idx_chat_item_mentions_chat_item_id (chat_item_id=?)
|
|
|
|
@@ -5340,7 +5380,7 @@ SEARCH chat_items USING COVERING INDEX idx_chat_items_fwd_from_chat_item_id (fwd
|
|
|
|
|
SEARCH files USING COVERING INDEX idx_files_chat_item_id (chat_item_id=?)
|
|
|
|
|
SEARCH groups USING COVERING INDEX idx_groups_chat_item_id (chat_item_id=?)
|
|
|
|
|
|
|
|
|
|
Query: DELETE FROM chat_items WHERE user_id = ? AND group_id = ? AND item_content_tag != 'chat_banner'
|
|
|
|
|
Query: DELETE FROM chat_items WHERE user_id = ? AND group_id = ? AND item_content_tag != 'chatBanner'
|
|
|
|
|
Plan:
|
|
|
|
|
SEARCH chat_items USING INDEX idx_chat_items_groups_user_mention (user_id=? AND group_id=?)
|
|
|
|
|
SEARCH chat_item_mentions USING COVERING INDEX idx_chat_item_mentions_chat_item_id (chat_item_id=?)
|
|
|
|
@@ -5575,6 +5615,13 @@ Query: DELETE FROM snd_file_chunks WHERE file_id = ? AND connection_id = ?
|
|
|
|
|
Plan:
|
|
|
|
|
SEARCH snd_file_chunks USING COVERING INDEX idx_snd_file_chunks_file_id_connection_id (file_id=? AND connection_id=?)
|
|
|
|
|
|
|
|
|
|
Query: DELETE FROM user_contact_links WHERE user_id = ? AND group_id = ?
|
|
|
|
|
Plan:
|
|
|
|
|
SEARCH user_contact_links USING INDEX idx_user_contact_links_group_id (group_id=?)
|
|
|
|
|
SEARCH contact_requests USING COVERING INDEX idx_contact_requests_user_contact_link_id (user_contact_link_id=?)
|
|
|
|
|
SEARCH connections USING COVERING INDEX idx_connections_via_user_contact_link (via_user_contact_link=?)
|
|
|
|
|
SEARCH connections USING COVERING INDEX idx_connections_user_contact_link_id (user_contact_link_id=?)
|
|
|
|
|
|
|
|
|
|
Query: DELETE FROM user_contact_links WHERE user_id = ? AND local_display_name = '' AND group_id IS NULL
|
|
|
|
|
Plan:
|
|
|
|
|
SEARCH user_contact_links USING INDEX sqlite_autoindex_user_contact_links_1 (user_id=? AND local_display_name=?)
|
|
|
|
@@ -5981,10 +6028,6 @@ Query: UPDATE chat_items SET item_status = ?, updated_at = ? WHERE user_id = ? A
|
|
|
|
|
Plan:
|
|
|
|
|
SEARCH chat_items USING INTEGER PRIMARY KEY (rowid=?)
|
|
|
|
|
|
|
|
|
|
Query: UPDATE chat_items SET item_status = ?, updated_at = ? WHERE user_id = ? AND item_status = ?
|
|
|
|
|
Plan:
|
|
|
|
|
SEARCH chat_items USING INDEX idx_chat_items_user_id_item_status (user_id=? AND item_status=?)
|
|
|
|
|
|
|
|
|
|
Query: UPDATE chat_items SET timed_delete_at = ? WHERE user_id = ? AND contact_id = ? AND chat_item_id = ?
|
|
|
|
|
Plan:
|
|
|
|
|
SEARCH chat_items USING INTEGER PRIMARY KEY (rowid=?)
|
|
|
|
@@ -6081,10 +6124,6 @@ Query: UPDATE contacts SET unread_chat = ?, updated_at = ? WHERE user_id = ? AND
|
|
|
|
|
Plan:
|
|
|
|
|
SEARCH contacts USING INTEGER PRIMARY KEY (rowid=?)
|
|
|
|
|
|
|
|
|
|
Query: UPDATE contacts SET unread_chat = ?, updated_at = ? WHERE user_id = ? AND unread_chat = ?
|
|
|
|
|
Plan:
|
|
|
|
|
SEARCH contacts USING INDEX idx_contacts_chat_ts (user_id=?)
|
|
|
|
|
|
|
|
|
|
Query: UPDATE contacts SET user_preferences = ?, updated_at = ? WHERE user_id = ? AND contact_id = ?
|
|
|
|
|
Plan:
|
|
|
|
|
SEARCH contacts USING INTEGER PRIMARY KEY (rowid=?)
|
|
|
|
@@ -6205,9 +6244,9 @@ Query: UPDATE groups SET ui_themes = ?, updated_at = ? WHERE user_id = ? AND gro
|
|
|
|
|
Plan:
|
|
|
|
|
SEARCH groups USING INTEGER PRIMARY KEY (rowid=?)
|
|
|
|
|
|
|
|
|
|
Query: UPDATE groups SET unread_chat = ?, updated_at = ? WHERE user_id = ? AND unread_chat = ?
|
|
|
|
|
Query: UPDATE groups SET unread_chat = ?, updated_at = ? WHERE user_id = ? AND group_id = ?
|
|
|
|
|
Plan:
|
|
|
|
|
SEARCH groups USING INDEX idx_groups_chat_ts (user_id=?)
|
|
|
|
|
SEARCH groups USING INTEGER PRIMARY KEY (rowid=?)
|
|
|
|
|
|
|
|
|
|
Query: UPDATE groups SET user_member_profile_sent_at = ? WHERE user_id = ? AND group_id = ?
|
|
|
|
|
Plan:
|
|
|
|
@@ -6225,10 +6264,6 @@ Query: UPDATE note_folders SET unread_chat = ?, updated_at = ? WHERE user_id = ?
|
|
|
|
|
Plan:
|
|
|
|
|
SEARCH note_folders USING INTEGER PRIMARY KEY (rowid=?)
|
|
|
|
|
|
|
|
|
|
Query: UPDATE note_folders SET unread_chat = ?, updated_at = ? WHERE user_id = ? AND unread_chat = ?
|
|
|
|
|
Plan:
|
|
|
|
|
SEARCH note_folders USING INDEX note_folders_user_id (user_id=?)
|
|
|
|
|
|
|
|
|
|
Query: UPDATE rcv_files SET agent_rcv_file_deleted = 1, updated_at = ? WHERE file_id = ?
|
|
|
|
|
Plan:
|
|
|
|
|
SEARCH rcv_files USING INTEGER PRIMARY KEY (rowid=?)
|
|
|
|
|