Skip to content
Paul Bunyan Message Logger by Diamond Sierra

PB-2504: Slow query read a whole table

Paul Bunyan code PB-2504 (Warning): Slow query read a whole table. What it means and what to do.

Updated · By Diamond Sierra

The Codes screen: every PB code found on the site, with counts
On this page

What it means

A slow query had no index it could use, so the database read every row of a table to find the few it wanted. It gets slower as the table grows.

What to do

The message shows the plan in words: which table, and about how many rows. Add an index on the column the query filters on, or change the query to filter on a column that already has one. For WordPress meta tables, the Index WP MySQL For Speed plugin adds the usual missing indexes.

Details

CodeSeverityGroup
PB-2504WarningDatabase