|
|
|
|
|
by adrianmonk
1903 days ago
|
|
Also, some databases allow you to index the result of a function. Oracle calls them "function-based indexes". PostgreSQL seems to call them "indexes on expressions". And MySQL seems to support "generated columns" which can be "virtual" and can have indexes. (Although in that case the expression lives in the column definition, so it's not actually in a where clause.) Also, I guess some databases probably let you have an index on a view, which could be another way. So if you really need a function in your where clause, there may very well be a way to do it efficiently. Of course, the usual caveat applies that it requires more I/O to maintain more indexes. |
|
I found this article on the topic to be helpful:
https://saveriomiroddi.github.io/An-introduction-to-function...