Skip to content

fix: use deduplicated query count in PR comment#94

Open
veksen wants to merge 1 commit intomainfrom
veksen/fix-pr-query-count
Open

fix: use deduplicated query count in PR comment#94
veksen wants to merge 1 commit intomainfrom
veksen/fix-pr-query-count

Conversation

@veksen
Copy link
Member

@veksen veksen commented Mar 23, 2026

Summary

The PR comment was showing the raw pgbadger log entry count (queryStats.total) instead of the deduplicated/filtered query count. This caused a mismatch — e.g. the comment said "4 queries analyzed" while the app showed "Queries (1)".

After buildQueries() produces the final list, we now override queryStats.total with queries.length so the PR comment matches the app.

Test plan

  • Run the analyzer on a repo with duplicate queries in the log and verify the PR comment count matches the app's query count

🤖 Generated with Claude Code

queryStats.total was counting every log entry before deduplication and
filtering, causing the PR comment to show a higher number than the app.
Override it with the actual buildQueries() output length so both match.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Query Doctor Analysis

View full run details

10 queries analyzed

2 pre-existing issues

Using assumed statistics (10000 rows/table). For better results, sync production stats.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant