Comments on: Look Ma, no FBI (Function Based Index) Friends of Oracle and Java Wed, 08 Jul 2015 07:37:03 +0000 hourly 1 By: Mr. Ed Fri, 08 Sep 2006 12:10:28 +0000 A little info on SYS_NC00014$.

By: Viliam Fri, 08 Sep 2006 11:30:12 +0000 You were wondering, why FBI was not used before you created statistics. It was because RBO does not consider FBIs. That database apparently had the default optimizer set to RBO. CBO is default, when there are statistics for some of tables in the query. If you used the hint /*+first_rows*/, the FBI would be used even without statistics…

And if you have FBI on upper(column), it cannot be used for searching without upper function. Workaround could be to put both conditions: column=:x and upper(column)=:x.

INDEX FAST FULL SCAN means that whole index is read. It could be used because only columns used in index were read in the select list, so there was no need to read whole table with (probably) lot more columns. If you used “select *”, you will get TABLE FULL SCAN… It’s misleading to say that “index was used” with IFFS – it’s still full scan, but little less data (but more than a table, because of PCTFREE).

You can think of an index as of a table physically sorted, and of an FBI as of a MV physically sorted…

By: Patrick Sinke Fri, 08 Sep 2006 09:19:20 +0000 Cool stuff indeed!
But what I don’t get… does the optimizer look for all the occurrences in the index which would be found when the function would not be applied on the column and apply the function on the result of that index scan? Or is there another mechanism in play?
I thought dynamic sampling was used to take a guess at un-indexed tables, but apparently it also uses tricks to optimize the use of existing indexes. Awesome!

By: Lucas Jellema Fri, 08 Sep 2006 07:23:09 +0000 That is pretty cool! That means that the contents of a Function (or probably better defined as Expression) Based Index is available to us as a sort of cache of precalculated values!

In the article Smart denormalization and Enhanced PL/SQL Function Call performance – Comparing Function Based Index and Materialized Views on our weblog, I compare Materialized Views and Function Based Index, and suggested (erroneously as you demonstrate) that only the MV provides a cache of precalculated values that is automatically maintained and that is accessible to us. Apparently, the same applies to FBI!

Thanks for the analysis and the clear conclusions.