Signal-iOS/SignalServiceKit/src
George Nachman 451fa08c22 Optimize searching for verification status.
When opening a group chat we check if all
participants are verified (which confers to the
chat verified status and a "✓ Verified" label in
the header) and we also check if any participants
have the "no longer verified" status so we can
warn you about potential misdeeds.

Previously, this was done by performing a select
statement for each participant twice (once for
"are all verified" and again for "is any
no-longer-verified").

This change uses a join in a select statement
instead to reduce the number of queries performed.

Given existing indexes in the DB this can be done
efficiently. Adding additional indexes does not
seem to help - or at least I wasn't able to get
sqlite to use them.

Since most chats are not verified, we use a LIMIT
clause when possible to allow the DB to stop
early, which should make queries even cheaper.
2022-02-18 12:32:58 -08:00
..
Account SSK: Prefer SignalServiceAddress(uuid:phoneNumber:) if we have a UUID 2022-01-28 18:02:31 -08:00
Contacts Enumerate unread messages instead of returning an array of them 2022-02-11 16:22:32 -08:00
Devices Store group avatars on disk 2022-02-09 11:56:03 -08:00
groups Store group avatars on disk 2022-02-09 11:56:03 -08:00
Messages Optimize searching for verification status. 2022-02-18 12:32:58 -08:00
Network Add the "Signalyzer" Instruments tool 2022-02-17 14:07:57 -08:00
Payments Don't reindex conversations on every model change 2022-02-01 15:05:34 -08:00
Protocols Temporarily increase user profile cache size. 2022-02-11 13:20:12 -08:00
Protos Ignore messages with StoryContext 2022-01-26 10:28:52 -08:00
Remote Attestation Add support for IASv4 enclaves 2022-01-27 15:58:47 -08:00
Security Optimize searching for verification status. 2022-02-18 12:32:58 -08:00
Storage Merge branch 'release/5.29.0' 2022-02-17 14:35:57 -08:00
TestUtils Temporarily increase user profile cache size. 2022-02-11 13:20:12 -08:00
Util "Feature flags for .qa." 2022-02-17 14:36:08 -08:00
SignalServiceKit.h Add support for IASv4 enclaves 2022-01-27 15:58:47 -08:00
SSKEnvironment.h Fix badge expiry 2021-12-17 14:04:42 -08:00
SSKEnvironment.m Add the "Signalyzer" Instruments tool 2022-02-17 14:07:57 -08:00
TSConstants.swift Add support for IASv4 enclaves 2022-01-27 15:58:47 -08:00
TSPrefix.h Change phone number. 2021-11-19 14:28:18 -03:00