Skip to content

Commit

Permalink
fix(peering): minor perf improvement for peering (#3523)
Browse files Browse the repository at this point in the history
using `in` instead of `not in` is more performand and should shave ~15% of our running execution peering time
(ad hoc profiling showed the query going from 4s to about 1s)

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
marchello2000 and mergify[bot] committed Mar 18, 2020
1 parent 26e5a6a commit e551733
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ open class MySqlRawAccess(
jooq
.select(field("id"))
.from(getExecutionTable(executionType))
.where(field("status").notIn(*completedStatuses.toTypedArray())
.where(field("status").`in`(*activeStatuses.toTypedArray())
.and(partitionConstraint))
.fetch(field("id"), String::class.java)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ abstract class SqlRawAccess(
) {
val log: Logger = LoggerFactory.getLogger(this.javaClass)
val completedStatuses = ExecutionStatus.COMPLETED.map { it.toString() }
val activeStatuses = ExecutionStatus.values().map { it.toString() }.filter { !completedStatuses.contains(it) }

/**
* Returns a list of execution IDs and their update_at times for completed executions
Expand Down

0 comments on commit e551733

Please sign in to comment.