Skip to content
This repository has been archived by the owner on Nov 22, 2023. It is now read-only.

Commit

Permalink
Reducing expired secrets fetch cost by 25%
Browse files Browse the repository at this point in the history
  • Loading branch information
mmontgomery-square committed Dec 8, 2022
1 parent 59ecbe5 commit 816f61c
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -253,6 +253,7 @@ public List<SecretSeries> getMultipleSecretSeriesByName(List<String> names) {
public ImmutableList<SecretSeries> getSecretSeries(@Nullable Long expireMaxTime,
@Nullable Group group, @Nullable Long expireMinTime, @Nullable String minName,
@Nullable Integer limit) {

Table<SecretsContentRecord> secretsContentTable = SECRETS_CONTENT;
if (expireMaxTime != null && expireMaxTime > 0) {
// Force this join to use the index on the secrets_content.expiry
Expand All @@ -263,7 +264,7 @@ public ImmutableList<SecretSeries> getSecretSeries(@Nullable Long expireMaxTime,
}

SelectQuery<Record> select = dslContext
.select()
.select(SECRETS.fields())
.from(SECRETS)
.join(secretsContentTable)
.on(SECRETS.CURRENT.equal(SECRETS_CONTENT.ID))
Expand Down

0 comments on commit 816f61c

Please sign in to comment.