Friday, January 30, 2015

Oracle - Function Based Index

A function-based index computes the value of an expression that involves one or more columns and stores it in the index. The index expression can be an arithmetic expression or an expression that contains a SQL function, PL/SQL function, package function, or C callout.[1]
Oracle generates a column name of the format "SYS_NC?????$" in all_ind_columns table.

If you want to find the corresponding expression for the index, you can like this.

Execute:

SELECT a.index_name, a.column_name, b.column_expression FROM all_ind_columns a LEFT JOIN all_ind_expressions b ON A.index_name = b.index_name AND A.column_position = b.column_position WHERE a.index_name='table_name$unique_index_name';



Result:

table_name$unique_index_name  SYS_NC00031$   TRUNC("UPDATE_DATE")


References


  1. https://docs.oracle.com/cd/E11882_01/appdev.112/e41502/adfns_indexes.htm#ADFNS00505


Create a Successful Online Store at Bigcommerce! Try it Free Now!

No comments:

Post a Comment