Skip to content

LG-3941 Track statistics for letter responses over time#4550

Merged
stevegsa merged 7 commits intomasterfrom
stevegsa-track-statistics-for-letter-responses
Jan 7, 2021
Merged

LG-3941 Track statistics for letter responses over time#4550
stevegsa merged 7 commits intomasterfrom
stevegsa-track-statistics-for-letter-responses

Conversation

@stevegsa
Copy link
Contributor

@stevegsa stevegsa commented Jan 2, 2021

No description provided.

@stevegsa stevegsa marked this pull request as ready for review January 2, 2021 06:31
Comment on lines +24 to +26
[7, 14, 30, 60, 90, 10_000].each do |days_ago|
sent = letters_sent_since(days_ago)
validated = letters_sent_and_validated_since(days_ago)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is 6 x 2 = 12 table scans of the usps_confirmation_codes table, would it make sense to see if we can parameterize some of this and make one aggregate query? It might be some gnarly CASE statements

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i could do a one pass but the usps_confirmation_codes table currently has a few thousand rows. it would need to get several orders of magnitude bigger before it ever took longer than a sub second total.

@stevegsa stevegsa merged commit 0170297 into master Jan 7, 2021
@stevegsa stevegsa deleted the stevegsa-track-statistics-for-letter-responses branch January 7, 2021 05:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants