Skip to content

Query statistics

Find and optimize long-running queries in your application.

Overview

Query statistics give you insight into the active queries running against your databases. This allows you to identify queries that are running too frequently, returning too large of a result set, or require an index to return results more quickly.

Query statisticsQuery statistics

Available statistics

  • Table — The table, or tables for a join, being queried or modified.
  • Count — The number of times this query has run.
  • Time — The total amount of time this query has run, in milliseconds.
  • Rows affected — The number of rows modified by an insert, update, or delete statement.
  • Rows returned — The number of rows fetched by a select statement.
  • Time per query — The number of milliseconds each individual query takes to run. This is calculated from total time divided by count.
Note
Rows returned will not always be equal to the number of rows read counted for billing purposes. We recommend using EXPLAIN ANALYZE to investigate the total number of rows read during the execution of a query.

Need help?

Get help from PlanetScale's support team, or join our GitHub Discussion board to see how others are using PlanetScale.

Was this page useful?
Last updated on November 18, 2021
Help us improve this page
PrivacyTerms© 2021 PlanetScale Inc.