Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion obp-api/src/main/scala/code/metrics/MappedMetrics.scala
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,10 @@ class MetricArchive extends APIMetric with LongKeyedMapper[MetricArchive] with I
override def getAuthType(): String = authType.get
}
object MetricArchive extends MetricArchive with LongKeyedMetaMapper[MetricArchive] {
// metricId: MetricsArchiveScheduler looks each archived row up by metricId twice (the dedup in
// saveMetricsArchive and the verify before deleting the source row). Without this index both
// lookups scan the whole archive, so the cost of archiving one row grows with the archive size.
override def dbIndexes =
Index(userId) :: Index(consumerId) :: Index(url) :: Index(date) :: Index(userName) ::
Index(appName) :: Index(developerEmail) :: Index(consentReferenceId) :: super.dbIndexes
Index(appName) :: Index(developerEmail) :: Index(consentReferenceId) :: Index(metricId) :: super.dbIndexes
}
Loading