perf: update nethvoice-reports with CDR query optimizations#710
Merged
edospadoni merged 6 commits intomainfrom Mar 17, 2026
Merged
perf: update nethvoice-reports with CDR query optimizations#710edospadoni merged 6 commits intomainfrom
edospadoni merged 6 commits intomainfrom
Conversation
fc5495d to
60a7b3b
Compare
Points to nethesis/nethvoice-report#207 which includes: - Indexes on source cdr table and generated cdr_YYYY/cdr_YYYY-MM tables - Range scans replacing date_format() anti-patterns - Pre-computed geographic columns eliminating correlated subqueries - LEFT JOIN for trunk type detection instead of per-row subqueries - REGEXP replaced with LIKE for disposition filters - Parallel view execution with goroutines
Add idempotent index creation for queue_log, queue_log_history, report_queue, and cdr. These tables are filtered and joined repeatedly by time range, event, queue, callid, agent, and linkedid during each consolidation run. Without proper indexes, MySQL falls back to wide scans, making the job slow and increasing lock time on busy systems. Creating targeted composite indexes improves selectivity for the hottest predicates, reduces I/O and temporary work, and keeps report generation stable as data grows.
This reverts commit 4cab95e04546406e33a3f68d8d6fe6cffb03dce9.
2043425 to
459805f
Compare
Contributor
|
Tested on this machine: https://helpdesk.nethesis.it/a/tickets/199090 — test OK. |
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.
Summary
See nethesis/nethvoice-report#207 for details.
Reference:
asteriskcdrdb.cdrNethServer/dev#7903