In this question , which I asked the other day, I received the following comment.
In almost any database, almost every function in a column prevents the use of indexes. There are exceptions here, but in general, functions prevent the use of indexes
I googled around and found more mentions of the same behavior, but I was not able to find something deeper than what the comment already told me.
Can someone explain why this is happening, and perhaps strategies to prevent it?
- , . , , . , / .
/ , . , ( reverse('integral') 'largetni'). , , . . i, in, int .., , .
reverse('integral')
'largetni'
i
in
int
, reverse(term) , . , , .
reverse(term)
SQL. , , B-, , , , (), .
, ( SQL Server, , , SQL RDBMS):
https://www.mssqltips.com/sqlservertip/1236/avoid-sql-server-functions-in-the-where-clause-for-performance/
, , " , , ".
. , -, HASH(email_address) = 0x123456. , email_address, HASH(email_address), . , email_address , HASH(email_address). , , , .
HASH(email_address) = 0x123456
email_address
HASH(email_address)