Knowledgebase

Analysing the Slow Query Log Print

  • 0

Finding what to fix.

WHY IT IS THE PRIMARY TOOL

It records exactly what was slow, with figures.

WHAT EACH ENTRY CONTAINS

The query Time taken Lock time Rows examined Rows sent

WHAT THE MOST USEFUL RATIO IS

Rows examined against rows sent.

WHY

A large gap means the database read far more than it returned.

WHAT TO DO WITH A RAW LOG

Summarise it.

WHY

The same query appears thousands of times with different values.

WHAT SUMMARY TOOLS PROVIDE

Queries grouped by shape, ranked by total time.

WHY TOTAL TIME RATHER THAN SLOWEST

A query taking a moment, run constantly, may cost more than one slow report.

WHAT TO FIX FIRST

Whatever consumes the most total time.

WHAT TO LOOK AT NEXT

Queries examining the most rows.

WHAT TO DO FOR EACH

Read the execution plan Identify the missing or unusable index Test the change on a copy

WHAT TO MEASURE AFTERWARDS

The same summary, comparing.

WHAT TO SET UP

Regular review, rather than only during incidents.

WHY

It catches degradation before it becomes an outage.

WHAT TO ROTATE

The log itself, which grows.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot