Skip to content

Feature: Semantic clustering of Performance Schema query patterns #34

Description

@peter7775

Problem Statement

The application already collects MySQL Performance Schema metrics and does query pattern analysis / bottleneck detection. Structurally different but semantically equivalent queries (e.g. same query with different literals/aliases) can currently be counted as separate hotspots.

Proposed Solution

  • Normalize SQL statements and generate embeddings (via the EmbeddingProvider port) for statements collected by the existing performance analysis layer.
  • Cluster semantically similar queries (e.g. simple k-NN/cosine similarity) before the bottleneck detection step.
  • Surface merged clusters in the existing performance dashboard.

Alternative Solutions

Syntax-only normalization (stripping literals), which likely partially exists already; embeddings help with structurally different but semantically equivalent queries (e.g. reordered JOINs) that syntax normalization misses.

Use Case

More accurate, less duplicated hotspot/bottleneck reports for users analyzing database performance.

Priority Level

Nice to have

Implementation Ideas

  • Builds on the existing "Predictive performance insights" roadmap item (trend/anomaly engine).
  • Evaluate whether embeddings also improve the "Query pattern analysis" feature mentioned in the README.

Additional Context

Depends on: "EmbeddingProvider port". Optionally related to: "Native vector index foundation" if cluster embeddings should be persisted in Neo4j.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementImprovement to existing functionalityfeatureNew feature or functionalityperformancePerformance improvements

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions