Does anyone know how function indexes work in databases?
A:
In Oracle there is something called Function Based Indexes:
Oracle 8i introduced Function Based Indexes to solve the following problem: performing a function on an indexed column in the where clause of a query guaranteed an index would not be used.
Here is a link: Function Based Indexes on Oracle-Base
splattne
2008-11-10 09:59:34
I don't know what "to slove" means. Of course I do. I think you could tell his intent too. Busting on him for missing a word is not in keeping with SO Karma.
2008-11-13 21:08:19
Mark, I'm sorry that my response looks offensive. I remember editing my answer. The original answer contained only the first two paragraphs and was meant to clarify his question.
splattne
2008-11-13 21:22:50
Just for the record: I removed the first two paragraphs which could be misunderstood.
splattne
2008-11-13 21:27:25
+1
A:
If you are talking about taking the result of a function when creating the index, this feature is used from SQL like this:
CREATE INDEX index_name ON table_name (function_name(column_name));
This can be used by the planner for queries like:
SELECT foo FROM table_name WHERE bar = function_name(column_name);
For exact details see the given RDBMS's documentation (for example in PostgreSQL it is called indexes on expressions).
Cd-MaN
2008-11-10 10:24:48