Is there redundancy when a predicate in an SQL query affects performance?

Consider a query like:

select *
from t
where a = 5 and (a = 5 and b = 7)

Does a redundant predicate affect a = 5query performance. I believe not, but they tell me differently (yes, I know that it depends on the DBMS, but just assume that these are some enterprise DBMSs, such as SQL Server, DB2, or Oracle).

+3
source share
2 answers

The answer usually will not be, oversupply does not affect performance. Of course, as a programmer, you can use evidence to prove it anyway (unlike a person who will repeat his myths as a fact).

, , explain .

, SQL Server Management Studio (MS SQL Server) , , " " ( ).

+4

SQL , , , . SQL- , . , SQL , " a = b b = c a = c" " a = b b = c", . , . , , , , .

+3

All Articles