tags:

views:

286

answers:

2

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
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.
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
Just for the record: I removed the first two paragraphs which could be misunderstood.
splattne
+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