메뉴 건너뛰기

Korea Oracle User Group

Guru's Articles

Quick tip on Function Based Indexes

명품관 2016.04.19 11:30 조회 수 : 191

Quick tip on Function Based Indexes

 

 

For “normal” indexes, USER_IND_COLUMNS will contain the column name(s) for an index, but things (appear to) go astray when looking at function-based indexes.

SQL> create table blah ( x varchar2(30));

Table created.

SQL> create index blah_ix on blah ( upper(x));

Index created.

SQL> select column_name from user_ind_columns
  2  where index_name = 'BLAH_IX'
  3  /

COLUMN_NAME
------------------------------
SYS_NC00002$

 

Don’t panic. Simply take a look at USER_IND_EXPRESSIONS to find the function that you used.

SQL> select column_expression from user_ind_expressions
  2  where index_name = 'BLAH_IX'
  3  /

COLUMN_EXPRESSION
--------------------------------------------------------------------------------
UPPER("X")


 

Easy peasy

 

출처 : https://connormcdonald.wordpress.com/2016/04/17/quick-tip-on-function-based-indexes/

위로