← Lessons

quiz vs the machine

Gold1350

Databases

Predicate Pushdown

Filtering rows as early as possible to avoid wasted work.

4 min read · core · beat Gold to climb

Predicate Pushdown

Predicate pushdown is an optimization that moves filter conditions as close to the data source as possible. By filtering early, the engine reads and processes far fewer rows.

The idea

A predicate is a condition such as a WHERE clause. If a filter sits above a join, the join may process many rows that will later be discarded. Pushing the predicate below the join means each side is filtered first, so the join sees fewer rows.

Where it pays off

Pushdown is most valuable when the data source can apply the filter itself. A column store or a remote table can skip whole blocks or send only matching rows over the network.

  • Push filters below joins to shrink inputs.
  • Push filters into scans to skip blocks or rows.
  • Push filters to remote sources to cut data transfer.

Key idea

Predicate pushdown applies filters as early as possible, near or inside the scan, so the engine never wastes work on rows it will discard.

Check yourself

Answer to earn rating on the learn ladder.

1. What does predicate pushdown try to do?

2. Why is pushing a filter below a join helpful?