• /
  • /

Query Examples and EXPLAIN Plans
in Releem Query Analytics

Works for MySQL and MariaDB
JUL 24, 2025 • WRITTEN BY ROMAN AGABEKOV
We shipped query examples and EXPLAIN plans in Releem's query analytics.

Releem has always shown SQL digests in analytics - those normalized query patterns that group similar queries together. Useful for spotting trends, but when you see "this query pattern is slow," the first question is always: "what does the actual query look like?"

Before this update, you'd have to dig through your database logs to find the real query, then manually run EXPLAIN to understand what's happening. That's too much friction for something you need to do constantly.

What We Built

Now when you open query analytics for each query, you see:
  • SQL digests (the normalized patterns)
  • Query examples (actual SQL queries that match the pattern)
  • EXPLAIN plans (MySQL's execution plan)
Everything in one interface. No context switching, no hunting through logs.

Why This Matters for Releem

This change makes Releem's recommendations much more transparent. When Releem suggests an optimization, you can now see exactly what triggered it:
  1. The specific query that caught Releem's attention
  2. The execution plan that revealed the performance issue
  3. How this led to the recommendation you received
You can see the full analysis that led to each recommendation.

Technical Details

Getting query examples was trickier than expected because of how different database engines handle query history.

For MySQL, we pull examples from the Performance Schema, which stores recent query executions with their full SQL text. For MariaDB, the Releem agent monitors query history directly since MariaDB's Performance Schema implementation differs.

Article by

  • Founder & CEO
    Roman Agabekov has 17 years of experience managing and optimizing MySQL and MariaDB in high-load environments. He created Releem to automate routine tasks like performance monitoring, tuning, and query optimization. His articles share practical insights to help others maintain and improve their MySQL databases.
Ready to dive in?
Try Releem today for FREE!