refactor(kpi,PIN-6997): performance optimization of IPs-by-client-view#167
Draft
marco-vit-pagopa wants to merge 3 commits intomainfrom
Draft
refactor(kpi,PIN-6997): performance optimization of IPs-by-client-view#167marco-vit-pagopa wants to merge 3 commits intomainfrom
marco-vit-pagopa wants to merge 3 commits intomainfrom
Conversation
…ctive ingestion and vieew refresh timing
There was a problem hiding this comment.
Pull request overview
This PR implements a performance optimization for the IPs-by-client-view (PIN-6997) by consolidating materialized views and adjusting time window parameters for auth server usage tracking.
Changes:
- Consolidated three separate IP tracking views (main, latest_ts, oldest_ts) into a single view with computed aggregations
- Refactored client-tenant join to use the standard direct consumer_id relationship instead of indirect path through purpose tables
- Adjusted auth usage time windows from 5/15/30 minutes to 15/30/45 minutes and added last_minute_with_requests tracking
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| R__application_mv_01_auth_usage__data__last_calls.sql | Updated time periods to 15/30/45 minutes and added last_minute_with_requests field |
| R__application_mv_01_client_tenant_authserver_ips.sql | Simplified to use standard client->tenant join and reference consolidated timestamps from main view |
| R__application_mv_00_client_tenant_authserver_ips__oldest_ts.sql | Removed as functionality consolidated into main view |
| R__application_mv_00_client_tenant_authserver_ips__main.sql | Enhanced to compute both latest_ts and oldest_ts using MAX/MIN aggregations, simplified join path |
| R__application_mv_00_client_tenant_authserver_ips__latest_ts.sql | Removed as functionality consolidated into main view |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
views/application/auth_server_usage/R__application_mv_01_auth_usage__data__last_calls.sql
Outdated
Show resolved
Hide resolved
…usage__data__last_calls.sql Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request overview
This PR implements a performance optimization for the IPs-by-client-view (PIN-6997) by consolidating materialized views and adjusting time window parameters for auth server usage tracking.
Changes: