perf: add missing index to optimize message list (#4055)

This commit is contained in:
Mac DeCourcy 2025-12-23 01:30:54 -08:00 committed by GitHub
parent 5feee83701
commit 87760f4a0d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 856 additions and 2 deletions

View file

@ -83,8 +83,9 @@ import org.meshtastic.core.database.entity.TracerouteNodePositionEntity
AutoMigration(from = 22, to = 23),
AutoMigration(from = 23, to = 24),
AutoMigration(from = 24, to = 25),
AutoMigration(from = 25, to = 26),
],
version = 25,
version = 26,
exportSchema = true,
)
@TypeConverters(Converters::class)

View file

@ -62,7 +62,13 @@ data class PacketEntity(
@Suppress("ConstructorParameterNaming")
@Entity(
tableName = "packet",
indices = [Index(value = ["myNodeNum"]), Index(value = ["port_num"]), Index(value = ["contact_key"])],
indices =
[
Index(value = ["myNodeNum"]),
Index(value = ["port_num"]),
Index(value = ["contact_key"]),
Index(value = ["contact_key", "port_num", "received_time"]),
],
)
data class Packet(
@PrimaryKey(autoGenerate = true) val uuid: Long,