The query performance increases by using NOT operator.
-
True
-
False
Using the NOT operator in SQL queries DECREASES performance. NOT prevents the database from using indexes efficiently and forces additional negation processing. Queries using NOT (or !=, NOT IN, NOT EXISTS) are slower than their positive equivalents because they require evaluating and rejecting rows rather than directly matching them.
The NOT operator (and negated conditions like <>, NOT IN, NOT LIKE) typically hurts query performance rather than helping it, because most relational optimizers (including DB2) struggle to use a B-tree index efficiently for 'not equal to' style predicates — the engine often falls back to a full table/index scan to evaluate the negation. So the statement 'query performance increases by using NOT' is False; in practice you should minimize NOT and prefer positive, sargable predicates for better index usage.