Skip to content

feat: parse query comments using custom, faster parser#929

Merged
levkk merged 15 commits intomainfrom
levkk-remove-query-comments
Apr 24, 2026
Merged

feat: parse query comments using custom, faster parser#929
levkk merged 15 commits intomainfrom
levkk-remove-query-comments

Conversation

@levkk
Copy link
Copy Markdown
Collaborator

@levkk levkk commented Apr 23, 2026

  • Parse query comments using memchr instead of query parser. Use comment-stripped query as the cache key for the query cache, dramatically increasing cache hits on deployments that push request tracing IDs into the queries (e.g. Datadog APM). Not using pg_query::scan also reduces the parsing time considerably.
  • Make query fingerprinting lazy. It's not used very much and it's very expensive compared to just query parsing. This reduces overall parsing time by 50%.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 23, 2026

@levkk levkk merged commit 52d28ce into main Apr 24, 2026
13 of 16 checks passed
@levkk levkk deleted the levkk-remove-query-comments branch April 24, 2026 18:12
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