1995
MariaDBWARNINGCriticalQueryMEDIUM confidence

Select in a subquery is reduced

Production Risk

Low — query executes successfully; performance may be suboptimal.

What this means

The optimizer detected that a subquery could be reduced or simplified, and issued a warning. This is informational and does not prevent query execution.

Why it happens
  1. 1Subquery that always returns a constant result.
  2. 2Redundant subquery that the optimizer collapses.
How to reproduce
trigger — this will error
trigger — this will error
SELECT * FROM t WHERE id IN (SELECT 1);

expected output

Warning 1995: Select in a subquery is reduced.

Fix

Simplify the query manually

Simplify the query manually
SELECT * FROM t WHERE id = 1;

Why this works

Removing the redundant subquery is cleaner and avoids the warning.

Sources
Official documentation ↗

MySQL 8.0 — 1995 ER_SELECT_REDUCED

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All MariaDB errors