Skip to content

Commit 7de4ffd

Browse files
committed
add index for querying for the latest valid authz
Previously, when requesting a new certificate, we might churn through many authz attempts to find the latest authz that was valid for a given domain. There was an index on registration id, but a given registration may have very many authzs. Think CDNs with one registration. Updates letsencrypt#959
1 parent 8f6d452 commit 7de4ffd

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

sa/_db/dbconf.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@ test:
44
integration:
55
driver: mysql
66
open: root@tcp(localhost:3306)/boulder_sa_integration
7+
# what goose uses by default, even during migration creation
8+
development:
9+
driver: mysql
10+
open: root@tcp(localhost:3306)/boulder_sa_integration
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
-- +goose Up
3+
-- SQL in section 'Up' is executed when this migration is applied
4+
5+
CREATE INDEX `registrationID_identifier_status_expires_authz_idx` on authz (`registrationID`, `identifier`, `status`, `expires` desc);
6+
7+
8+
-- +goose Down
9+
-- SQL section 'Down' is executed when this migration is rolled back
10+
11+
DROP INDEX `registrationID_identifier_status_expires_authz_idx` on `authz`;

0 commit comments

Comments
 (0)