IT lexicon › Database › Predicate

Predicate

Database På svenska → Updated: 2026-11-13

A conditional expression in a WHERE clause — salary > 50000 or city = 'Stockholm'.

A predicate is a logical test that evaluates to true or false for each row. The SQL engine uses predicates to filter which rows are returned. Queries can have simple predicates like "age > 18" or complex AND/OR combinations. Query optimization hinges on evaluating predicates efficiently — can we use an index to skip rows that don't match the predicate?

In older navigational databases like CODASYL, predicates were implicit — you navigated along fixed paths and manually filtered results in application code. SQL's declarative approach allowed optimizers to become far smarter: they analyze predicates to choose which indexes to use, what order to join tables, and how to parallelize work. A predicate like "WHERE customer_id = 5 AND purchase_date > 2024-01-01" gives the optimizer concrete information to route through the best index paths.

← Back to the lexicon