A FUNCTION-based index

Hi gurus

I use SQL Developer and in the present, I have a cc_tv table and when I press shift F4 to display related table things while it contains the following information:

index name = TTT_UK_I

uniquiness UNIQUE =

Status = valid

Index_type = NORMAL according TO THE FUNCTIONS

Temporary = N

and the following condition = box 'logical_flag' when ' no can END NO other 'Class_ID.

Another index with the same name but different condition

index name = TTT_UK_I

uniquiness UNIQUE =

Status = valid

Index_type = NORMAL according TO THE FUNCTIONS

Temporary = N

and the following condition = box 'logical_flag' when ' no can END NO other 'As_of_date '.

Can someone explain the above things. Really appreciate your help. Thank you

Hello

It seems that you have a unique composite index based on a function.  To understand this, let's review what each of these terms means.

A unique index ensures that the same value will not be on 2 or more lines.  (NULL, which is not a value, can be on any number of lines).  So if there is a unique index on the column "Class_ID", if the 2 lines have values in the column "Class_ID", these values must be different.

A composite unique index ensures that the same combination of values will not be on 2 or more lines.  So if there is a unique index on the combination of columns ('Class_ID', 'As_of_date'), so and 2 rows have values in each column, 'Class_ID' or 'As_of_date', then 1 or two of these values must be different.  However, you can have any number of lines where both of these columns are NULL.

An index based on a single composite function is as a single composite index, but the things that must be unique are not actually columns; they are expressions that come from columns.

You have a unique composite index based on a function, where the combination of these 2 expressions (not columns) must be unique:

Case 'logical_flag' when ' no can END NO other 'Class_ID.

Case 'logical_flag' when ' no can END NO other 'As_of_date '.

The effect is like a unique composite index on all columns ("Class_ID', 'As_of_date') which applies only to the lines where 'logical_flag' = 'n'.  If "logical_flag" is any other value (or NULL) then the other columns must be unique.  Why?  Because when 'logical_flag' is another value (or NULL), as well of the CASE the above expressions return NULL, and you can have a number any of columns where both of these expressions have the value NULL.

Sorry, I don't know much about SQL Developer.  If you need to know something specific to SQL Developer, for example how it displays information about the index, then you should post a question in the SQL Developer forum

https://community.oracle.com/community/developer/english/development_tools/application_development_in_pl_sql/sql_developer _(not_for_general_sql_plsql_questions)

Not here.

Tags: Database

Similar Questions

  • How Oracle called the hidden for the function-based index columns?


    I came across an interesting problem today.  Statistics object for a schema that have been created on the basis of data X have been imported into a 'identical' to the database schema Y.

    The problem is that, on the basis of data X a group of hidden columns associated with index based service (FBIs) were named SYS_NC00182$ to SYS_NC00191$ and on the basis of data Y the same hidden columns were named SYS_NC00183$ to SYS_NC00192$!  The consequence was that statistical column for an FBI data base X have been used for a totally different FBI on the database Y.

    Now, of course, if this was g 11 or 12 c I could just create virtual columns and those of the index.  In this way the names of the columns would be compatible on databases.  However, it is a 10g database, and I do not have this option.

    I am curious to understand how Oracle generates these hidden column names.  I'm also curious if, in 10g, there is a way to identify the name of a column hidden for an FBI that doesn't involve a statement explain plan running on a query that uses all the expressions of the FBI for the table.

    The names of $ SYS_NCnnnnn are based on the internal column id - what is loosely based on the order of creation of the FBI. If you delete a column the column internal ids (after this column), which means the names for the SYS_NCnnnnn$ the change.  An opportunity to explain your results is that a (real) column on the X data table fell, but the column still exists on the database Y.

    If you want to get the link between the current internal name and expression, then you can start with dba_ind_expressions - and create a customized version of the view - e.g @.

    Select c.intcol #, c.name, io.name, idx.name, bo.name, base.name, c.default$, ic.pos #.

    of sys.col$ c, sys.obj$ idx, basis of sys.obj$, sys.icol$ ic.

    sys. User$ io, sys.user$ bo, sys.ind$ I

    where bitand(ic.spare1,1) = 1 / * expression * /.

    and (bitand (students, 1024) = 0) / * not bmji * /.

    and ic.bo # c.obj = #.

    and ic.intcol # c.intcol = #.

    and ic.bo # base.obj = #.

    and io.user # idx.owner = #.

    and bo.user # base.owner = #.

    and ic.obj # idx.obj = #.

    and idx.obj # i.obj = #.

    and however # (1, 2, 3, 4, 6, 7, 9)

    /

    The first two columns in the select ones that I added to the initial view definition.

    Concerning

    Jonathan Lewis

  • Question of function-based Index

    Hello Experts,

    I am wondering something simple relating to the funcion according to index. Lets say I have a FBI something like the following.

    CREATE INDEX idx my_fbi ON my_table (substr (nls_lower (my_column),1 25));

    Maybe it's a very basic question, but SERIOUSLY, I want to know. My question is, when I use this index, including the rating should I use other side of the equal sign? and WHY?

    SELECT * FROM my_table WHERE substr (nls_lower (my_column),1 25( ) = 'ali';

    OR

    SELECT * FROM my_table WHERE substr (nls_lower (my_column),1 25) = substr (nls_lower ("ali"),1 25( );

    Thank you 1 million for your great comments.

    Best regards

    Charlie

    using value once the '=' sign would be more effective if you already know the value because in this case Oracle does not need to evaluate the expression, but if the values are not known, then you have to use the expression.

    Exact values are more efficient than expressions, especially when the expression is already evaluated and it must be evaluated at run time.

    Onkar

  • With the help of the index function based! =

    Hello

    Is it possible to create an index of basic function that is used when the! = operator is used?

    I have a question with the following in the where clause

    WHERE (SYMBOL = 1 AND LOGICAL_STATUS! = '8')

    Thank you

    Carl

    Published by: Carl Holmes on November 5, 2009 10:18

    But you can create a FBI such as the following which will be a NULL entry when the condition is not put in correspondence:

    CREATE INDEX .... ON TABLE .... (CASE WHEN SYMBOL=1 AND LOGICAL_STATUS !='8' THEN 1 ELSE NULL END);
    

    Then you might change your SQL to match the FBI:

    WHERE CASE WHEN SYMBOL=1 AND LOGICAL_STATUS !='8' THEN 1 ELSE NULL END = 1
    
  • What is the purpose of the function Array Index in the example attached?

    Hello

    I'm fighting with the Array Index function. I found the attached VI on the OR site which was exactly what I wanted to do, but rather than simply accept that it works and use it, I wanted to understand.

    What is the purpose of the function Index of table inside the while loop? If I put a probe on part and on the other, the values are the same, but if I remove the service and connect directly to the > function, I get an error.

    I do not understand the tables but I don't understand what is happening here. Any help would be appreciated gratefully.

    Thanks in advance.

    It is just picking the first reading of the table in the waveform.  If it's good enough (I'd take at least the average of N samples), why not cela?

  • Listen to ObjectChoiceFields-based index

    HIi,

    I need to listen to ObjectChoiceFields based on the Index.

    I need to know how the default ringtone ObjectChoiceField work when we change the focus by trackball it gets the name of the targeted ring and play.

    is there a listener for it. I implement the fieldchangelistener, but it retrieves the selectedIndex property. but I need to retrieve the name of the targeted ring.

    Hey, I found the solution,

    just convert the field calling fieldChanged chain and you will get the name of the index targeted.

    FieldChangeListener listnr = new FieldChangeListener()

    {

    ' Public Sub fieldChanged (field field, int context)

    {

    String emringtoneS = (String) field.toString ();

    }

    };

  • Impossible to apply the functional base index


    Hi gurus

    For my learning, I am applying the functional index of basic but looks like I'm doing something wrong, see below for my code and appreciate your answers.

    Code example

    DROP TABLE my_table;

    CREATE TABLE my_table

    (

    AA: PRIMARY KEY number 4

    aa_desc VARCHAR2 (30),

    aa_type VARCHAR2 (10)

    ) ;

    CREATE INDEX first_name_idx ON my_table (aa > 10 and upper (aa_desc) = "SA" and aa_type is null).

    Thanks in advance

    Concerning

    Shu

    SQL> create table my_table1
      2    (
      3      aa      number(4) primary key,
      4      aa_desc varchar2(30),
      5      aa_type varchar2(10)
      6    ) ;
    
    Table created.
    
    SQL> create or replace function my_table_check
      2  (
      3    p_aa      in my_table.aa%type
      4  , p_aa_desc in my_table.aa_desc%type
      5  , p_aa_type in my_table.aa_type%type
      6  )
      7  return number
      8  deterministic
      9  as
     10  begin
     11     if (p_aa > 10 and upper(p_aa_desc) = 'SA' and p_aa_type is null) then
     12       return 1;
     13     else
     14       return 0;
     15     end if;
     16  end;
     17  /
    
    Function created.
    
    SQL> create index my_table_idx on my_table1(my_table_check(aa, aa_desc, aa_type));
    
    Index created.
    
    SQL> explain plan for
      2  select *
      3    from my_table1
      4   where my_table_check(aa, aa_desc, aa_type) = 1;
    
    Explained.
    
    SQL> set linesize 130
    SQL> set pagesize 200
    SQL>
    SQL> select * from table(dbms_xplan.display);
    
    PLAN_TABLE_OUTPUT
    ----------------------------------------------------------------------------------------------
    Plan hash value: 3962327877
    --------------------------------------------------------------------------------------------
    | Id  | Operation                   | Name         | Rows  | Bytes | Cost (%CPU)| Time     |
    --------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT            |              |     1 |    37 |     1   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| MY_TABLE1    |     1 |    37 |     1   (0)| 00:00:01 |
    |*  2 |   INDEX RANGE SCAN          | MY_TABLE_IDX |     1 |       |     1   (0)| 00:00:01 |
    --------------------------------------------------------------------------------------------
    Predicate Information (identified by operation id):
    ---------------------------------------------------
       2 - access("V195588"."MY_TABLE_CHECK"("AA","AA_DESC","AA_TYPE")=1)
    Note
    -----
       - dynamic sampling used for this statement
    
    18 rows selected.
    
    SQL>
    
  • Groovy aggregate function based on condition

    Hi all

    I use jdev 12.1.3.0.0

    I've set up an aggregate function in my master EO as explained in the blog

    https://blogs.Oracle.com/ADF/entry/using_groovy_aggregate_functions_in

    I need to add a condition to the number of records based on an attribute of the object of details view. Algorithm for the use case is

    detailsAccessor.count ("SmsId")

    where detailsAccessor.MessageType is equal to "file."

    Could you help me write an expression to achieve this functionality.

    Thank you

    Mozakkir

    All aggregate in groovy functions accept a groovy as a parameter expression.

    So instead of detailsAccessor.count("SmsId") you can try something like: detailsAccessor.count ("MessageType is 'Applicant'")

    Or convert sum() like this: detailsAccessor.sum ("MessageType is"Applying"? 1: 0 ")"

    Dario

  • Analytical functions, model indexes and multiple dimensions.

    I don't understand the notion of analytic functions (windowing clause) in the regulation of a model clause. I discovered an ordinary table as one-dimensional, and I can understand the concept of window, just like a line on a segment line. However with the models, there are several dimensions, so I guess that the window to become a kind of cube, instead of a line segment. But I'm not.

    For example, I have a matrix sparse 2D, with 5 values non-zero:
    select * from field
      where f is not null
    
    X     Y     F
    -----------------
    5     8     X
    6     6     X
    6     8     X
    7     7     X
    7     8     X
    I guess that the following clause of the model
    with t as(
      select *
        from field
       model
         reference old_field
           on
           (
             select * from field
           )
           dimension by (x, y)
           measures     (f)
         main new_field
           dimension by (x, y)
           measures     (cast(f as varchar2(3)) f)
           rules
           (
             f[x,y] = max(old_field.f) over (order by old_field.y range between 1 preceding and 1 following)
           ))
    select * from t
      where f is not null
    to assign for each cell up among its neighbors vertical 2. Just like
    0 0 0      0 X 0
    0 X 0  ->  X X 0
    X 0 0      X X 0
    But the real result is all NULL values.

    Hello

    with a as
    (
    select
    level L
    from
    dual
    connect by level < 4
    )
    
    select
         X
         ,Y
         ,Z
         ,X*3+Y
    
    from
         a          A1
         ,A     A2
    
    model
         dimension by ( A1.L X, A2.L Y )
         MEASURES (0 Z)
         RULES
         (
         Z[X,Y] = COUNT(Z) OVER (ORDER BY X * 3 + Y RANGE BETWEEN 1 PRECEDING AND 1 FOLLOWING)
         )
    
    X Y Z X*3+Y
    - - - -----
    1 1 2     4
    1 2 3     5
    1 3 3     6
    2 1 3     7
    2 2 3     8
    2 3 3     9
    3 1 3    10
    3 2 3    11
    3 3 2    12 
    
     9 rows selected 
    

    for x, y = 1.1, there is no previous rank if it is not counted. current line + line = 2
    for x, y = 1, 2, the previous line + line current + more rank = 3
    for x, y = 1.3 the previous line + line current + more rank = 3
    for x, y = 2, 1, the previous line + line current + more rank = 3
    ...
    for x, y = 3, 2 the previous line + line current + more rank = 3
    for x, y = 3, 3 the stored previous + current line = 2. There is no next line.

    What exectly not understand you?

    Kind regards
    Peter

  • How to write Save function based on the drop-down list box selection data in app mxml flex4 with as3

    Hi all

    I'm working on the application web flex4 with as3.

    I have a doubt, I've created a mxml it has two text boxes, except the button and a combo box that is has two option as a percentage and the amount.

    my needs are I gave here.

    need 1: when I choose option amount that two text boxes does not have to be editable.when I select text tat box two percentage option will be editable.

    need 2: when I select the percentage in combox option and two text boxes are empty, and then click the button Save-> I want to display warning msg

    need 3: when I select the option amount combox and the two boxes are emptu click the button Save-> I don't want any warning messages.

    How to validate it and how to write backup for this function.

    This is my sample code:

    list box ID = baseAmtPer

    ID TextBox1 = maxCommAmt.text

    ID = baseAmtPer.text text box

    If (((baseAmtPer.editable!=true) & & (maxCommAmt.editable! = true)) & & ((baseAmtPer.text=="") & &(ma xCommAmt.text=="")) |) (baseAmtPer.text == "") | (maxCommAmt.Text=="")) -> This condition not allowing while I'm selecing amount in combo box. How the TWO TEXT BOX WILL BE EMPTY for this problem

    {

    Alert.Show ("enter in all areas", "Information");

    }

    on the other

    {

    some encodings

    }

    Hello

    Please go through the following Code:

    http://ns.Adobe.com/MXML/2009.

    xmlns:s = "library://ns.adobe.com/flex/spark".

    xmlns:MX = "library://ns.adobe.com/flex/mx" minWidth = "955" = "600" minHeight >

    Import mx.collections.ArrayCollection;

    Import mx.controls.Alert;

    Import spark.events.IndexChangeEvent;

    protected function button1_clickHandler(event:MouseEvent):void

    {

    If (comboBox.selectedItem == "Percentage" & textBox1.text == "" & textBox2.text == "") {}

    Alert.Show ("enter the values");

    }

    }

    protected function comboBox_changeHandler(event:IndexChangeEvent):void

    {

    {if(ComboBox.SelectedItem=="Amount")}

    textBox1.editable = false;

    textBox2.editable = false;

    }

    else {if(comboBox.selectedItem=="Percentage")

    textBox1.editable = true;

    textBox2.editable = true;

    }

    }

    ]]>

    Amount

    Percentage

    Thank you and best regards,

    ------------------------------------------------------------------------------------------ --

    Vibhuti Gosavi . [email protected] | www.infocepts.com

    ------------------------------------------------------------------------------------------ --

  • How to implement "inferior to" by choosing functions based on the digital inputs

    I have a 1 d table and I would like to divide what is happening with different values

    I made sure the table shows an element, with a scroll bar to change the item

    The picture is random

    When the element is< 512="" i="" want="" a="" to="">

    When the element is 512 > I want B to happen

    I played with the structure of the case, but what confuses me, is the least above and below that fucntion, its release is a Boolean

    If it changes anything I borrowed the output to a multiply functino

    Thank you!

    Choose a.  If the value is less than 512, then the Boolean value is True.  Put the code for A in the case of true.  Otherwise, it is wrong to put the code for B in the case of false.

    One thing, you're not telling it what to do if the value is equal to 512.  Do you want A or B?

    I recommend you watch the LabVIEW tutorials online
    LabVIEW Introduction course - 3 hours
    LabVIEW Introduction course - 6 hours

  • Invalidation of the index based on a function because the recompilation

    Hello

    one of our customers has two indices according to the functions that fall under the State "off" in some situations. After looking more closely at the situation, there are some things that my opinion are different from what I expected of a function-based index. Because I am unable to find anything about either on metalink (or I'm not asking the right question) I would appreciate a second opinion of you.

    To keep things simple, I gave an example to illustrate the behavior. I use Oracle 12.1.0.2, although it can also be reproduced on versions 10.2 and 11.2.

    It's my environment and three parameters that I find relevant to the discussion:

    SQL> select banner from v$version;
    
    BANNER
    ----------------------------------------------------------------------------
    
    Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
    PL/SQL Release 12.1.0.2.0 - Production
    CORE    12.1.0.2.0      Production
    TNS for Linux: Version 12.1.0.2.0 - Production
    NLSRTL Version 12.1.0.2.0 - Production
    
    SQL> show parameter remote_dependencies
    
    NAME                                 TYPE        VALUE
    ------------------------------------ ----------- ----------
    remote_dependencies_mode             string      TIMESTAMP
    
    SQL> show parameter query_rewrite
    
    NAME                                 TYPE        VALUE
    ------------------------------------ ----------- -------------
    query_rewrite_enabled                string      TRUE
    query_rewrite_integrity              string      enforced
    

    Test case:

    SQL> CREATE OR REPLACE FUNCTION f1 (p_string IN VARCHAR2)
      2  RETURN VARCHAR2
      3  DETERMINISTIC
      4  IS
      5  BEGIN
      6    RETURN lower(p_string);
      7  END f1;
      8  /
    
    Function created.
    
    SQL> CREATE TABLE tmp_t1 (a_string VARCHAR2(10));
    
    Table created.
    
    SQL> INSERT INTO tmp_t1 VALUES ('a');
    
    1 row created.
    
    SQL> COMMIT;
    
    Commit complete.
    
    SQL> CREATE INDEX x1_tmp_t1 ON tmp_t1(f1(a_string));
    
    Index created.
    
    SQL> set linesize 80;
    SQL> column index_name format a10;
    SQL> SELECT index_name, index_type, status, funcidx_status
      2    FROM user_indexes;
    
    INDEX_NAME INDEX_TYPE                  STATUS   FUNCIDX_
    ---------- --------------------------- -------- --------
    X1_TMP_T1  FUNCTION-BASED NORMAL       VALID    ENABLED
    

    We have our table and our based on an index function which basically converts the values to lowercase. From here on things, download a little weird. What happens with the index based on a function if the underlying function is recompiled? I always thought (and which is also stated in the Concepts and the use of function index (Doc ID 66277.1)) that the index would change its status to "disabled". Here is an excerpt of the said Doc ID:

    The index depends on the State of the PL/SQL function. The index can be

    struck down or rendered useless by changes to the function. The index is marked

    People with DISABILITIES, if he is brought to the function or function is re-created.

    The timestamp of the function is used to validate the index.

    To allow the index after it is created, the function if the signature of the

    the function is identical to the front:

    ALTER INDEX ENABLE;

    If the signature of functions is changed, to make the changes effective

    in the index, the index must be renewed to make it valid.

    ALTER INDEX REBUILD.

    It seems that this is not the case, as the index remains valid and activate.

    SQL> alter function f1 compile;
    
    Function altered.
    
    SQL> SELECT index_name, index_type, status, funcidx_status
      2    FROM user_indexes;
    
    INDEX_NAME INDEX_TYPE                  STATUS   FUNCIDX_
    ---------- --------------------------- -------- --------
    X1_TMP_T1  FUNCTION-BASED NORMAL       VALID    ENABLED
    

    OK, explicitly recompiling function F1 single timestamp changed. What if we replace the function completely and we change the output of the function - for example we will switch from a LOWER function to SUPERIOR function in the body of the F1. Again, it is change that I thought would be not only to disable the index based on a function, but also force its reconstruction. At least that is my understanding of the explanation in Doc ID).

    SQL> CREATE OR REPLACE FUNCTION f1 (p_string IN VARCHAR2)
      2  RETURN VARCHAR2
      3  DETERMINISTIC
      4  IS
      5  BEGIN
      6    RETURN UPPER(p_string);
      7  END f1;
      8  /
    
    Function created.
    
    SQL> SELECT index_name, index_type, status, funcidx_status
      2    FROM user_indexes;
    
    INDEX_NAME INDEX_TYPE                  STATUS   FUNCIDX_
    ---------- --------------------------- -------- --------
    X1_TMP_T1  FUNCTION-BASED NORMAL       VALID    ENABLED
    
    

    Should not be. Because of the function "create or replace" F1 never go through a "invalid" phase which may be necessary for index becomes unusable? What about queries on the TMP_T1 table? Does optimizer always uses access index or not? What about the results?

    SQL> EXPLAIN PLAN SET statement_id='s1' FOR
      2  SELECT a_string, f1(a_string) as f1_a_string, f1('a') as f1_literal
      3    FROM tmp_t1
      4   WHERE f1(a_string) = 'a';
    
    Explained.
    
    SQL> SELECT * from table(dbms_xplan.display(statement_id=>'s1'));
    
    PLAN_TABLE_OUTPUT                                                                                                   
    ------------------------------------------------------------------------------------------------------------------------
    Plan hash value: 3133804460                                                                                         
                                                                                                                        
    -------------------------------------------------------------------------------------------------                   
    | Id  | Operation                           | Name      | Rows  | Bytes | Cost (%CPU)| Time     |                   
    -------------------------------------------------------------------------------------------------                   
    |   0 | SELECT STATEMENT                    |           |     1 |  2024 |     2   (0)| 00:00:01 |                   
    |   1 |  TABLE ACCESS BY INDEX ROWID BATCHED| TMP_T1    |     1 |  2024 |     2   (0)| 00:00:01 |                   
    |*  2 |   INDEX RANGE SCAN                  | X1_TMP_T1 |     1 |       |     1   (0)| 00:00:01 |                   
    -------------------------------------------------------------------------------------------------
    

    The index is used by the optimizer, see the results.

    SQL> column f1_a_string format a15;
    SQL> column f1_literal format a15;
    SQL> SELECT a_string, f1(a_string) as f1_a_string, f1('a') as f1_literal
      2    FROM tmp_t1
      3   WHERE f1(a_string) = 'a';
    
    A_STRING   F1_A_STRING     F1_LITERAL
    ---------- --------------- ---------------
    a          a               A
    

    A_STRING = value in the table

    F1_A_STRING = value of f1 (a_string) but the value is not evaluated because it comes from an index, so tiny value (remember, at the time index created the function returned small values)

    F1_LITERAL = value of the function f1 newly evaluated, using literal instead of the value in the table.

    Predicate f1 (a_string) = 'a' should return no rows because no character uppercase is equivalent to "a". Query with f1 (a_string) = 'A' should return a line, but it doesn't.

    SQL> SELECT a_string, f1(a_string) as f1_a_string, f1('a') as f1_literal
      2    FROM tmp_t1
      3   WHERE f1(a_string) = 'A';
    
    no rows selected
    

    Anyone know if this is an expected behavior? And, is it possible to disable the index based on a function whenever the underlying function signature is changed? The parameter query_rewrite_integrity = applied from

    DOC-ID 66277.1 does not seem to do the trick:

    (c) session variables

    ~~~~~~~~~~~~~~~~~~~~

    QUERY_REWRITE_ENABLED (true, false),

    QUERY_REWRITE_INTEGRITY (confidence, forced, stale_tolerated)

    determines the optimizer to use index based on a function with

    expressions using SQL, user defined functions functions.

    TRUST: Oracle allows rewrites using relationships that have

    was declared.

    APPLIED: Oracle ensures and guarantees consistency and integrity.

    STALE_TOLERATED: Oracle allows rewrites using vessels of the relationship not applied.

    Used in the case of materialized views.

    Set session variable cost function optimizer to choose the

    a function-based index

    Kind regards

    SAMO

    From the Manual 11.2 ( https://docs.oracle.com/cd/E11882_01/appdev.112/e41502/adfns_indexes.htm#ADFNS254 )

    "If you change the semantics of a DETERMINISTIC run and recompile, then you must manually rebuild all addicts depending on index and materialized views." Otherwise, they report results for the previous version of the function. »

    This note is not that I made my initial comment well - which was based on an incorrect memory the relationship between function-oriented and autonomous pl/sql functions, so I won't try to explain it. In fact, I went back to Oracle 8i practice to see if something had changed between yesterday and today and found that I had described exactly the behavior that the OP has been seeing. It's the way it is supposed to be.

    Concerning

    Jonathan Lewis

  • How to create indexes based for TO_CHAR function

    I need to create an index of feature based for the to_char.when function I tried, I got an error, "only pure function can be indexed".which the error really means, help me in the creation of the index in order to reduce my query cost.

    It works fine on my database. version 9iR2

    create index IDX_TO_CHAR on emp(to_char(hiredate,'YYYY-MM-DD HH24:MI:SS'));
    
    explain plan for
    select hiredate from emp where to_char(hiredate,'YYYY-MM-DD HH24:MI:SS')='1981-05-01 00:00:00';
    
    ---------------------------------------------------------------------------------
    | Id  | Operation                   |  Name        | Rows  | Bytes | Cost (%CPU)|
    ---------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT            |              |     1 |     8 |     2  (50)|
    |   1 |  TABLE ACCESS BY INDEX ROWID| EMP          |     1 |     8 |     2  (50)|
    |*  2 |   INDEX RANGE SCAN          | IDX_TO_CHAR  |     1 |       |     2  (50)|
    ---------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       2 - access(TO_CHAR("EMP"."HIREDATE",'YYYY-MM-DD HH24:MI:SS')='1981-05-01 00
                  :00:00')
    

    Your not seem to be a setting issue, then why not give us your sql and execution plan and so on.
    There may be other ways to solve your sql as the creation of a function based index?

  • Syntax for the existing index based on a function

    Hello:

    I'm on 10.2.0.3.

    Below is the list of indexes and the columns in the index on one of the tables. Aparantly one of the columns (SYS_NC00220$) is actually a function-based index.

    Anyone know how to get the SQL syntax for this index? TIA.

    INDEX_NAME UNIQUENES COLUMN_NAME POSITION_COLONNE
    ------------------------------ --------- ------------------------------ ---------------
    PS0BI_HDR not BILL_TO_CUST_ID 1
    PS0BI_HDR don't BUSINESS_UNIT 2
    PS0BI_HDR only SYS_NC00220$ 3
    PS1BI_HDR not BILL_STATUS 1
    PS1BI_HDR don't BUSINESS_UNIT 2
    PS1BI_HDR only SYS_NC00220$ 3
    PS2BI_HDR not CONTRACT_NUM 1
    PS2BI_HDR don't BUSINESS_UNIT 2
    PS2BI_HDR only SYS_NC00220$ 3
    NON-UNIQUE PSABI_HDR BILL 1
    PSABI_HDR don't BILL_TO_CUST_ID 2
    PSABI_HDR don't BUSINESS_UNIT 3
    PSABI_HDR not BILL_STATUS 4
    UNIQUE PROCESS_INSTANCE PSBBI_HDR 1
    UNIQUE BUSINESS_UNIT PSBBI_HDR 2
    INVOICE SINGLE PSBBI_HDR 3
    UNIQUE BUSINESS_UNIT PS_BI_HDR 1
    UNIQUE SYS_NC00220 PS_BI_HDR $ 2

    query user_ind_expressions and search for COLUMN_EXPRESSION.

    This will give you an expression.

  • Function Index

    I'm reviewing an existing table in a database Oracle 11g and I do not understand a function based index that was created. The syntax is less than

    CREATE INDEX abc. Orders_Date on abc. ORDERS

    (CASE WHERE "ORDER_DATE" IS NOT NULL THEN "ORDER_DATE" ELSE NULL END)

    LOGGING;

    This table has about 90 000 lines with 32 000 values distinct order_date, 3000 lines have order_dates null. When you run a query on this table using the order_date column it makes a full table scan.

    What does this function index based? because I do not see how it adds all the required features

    Thank you

    As others have said, this index is actually right on order_date, however, is a core function so it cannot be used in queries that use CASES WHEN "ORDER_DATE" IS NOT NULL THEN END NO OTHER "ORDER_DATE."

    It is assumed that it might be possible that there is an index on (order_date) but it was found that it was used in the sql queries, which would have preferred to use other indexes. Some queries benefits so maybe that option based function was created as the sql must refer to the phrase exactly, requests that have received have been rewritten and others were left so that they could avoid the new index of the index.

    Of course, if this were the case then maybe you can take a look at your stats.

Maybe you are looking for

  • How can I block junk e-mail?

    Im getting bombarded by spam from a single source.  Mail offers an unscubscibe button (although I have never subscribed in the first place).  However, if I click on unsubscribe I tells me I need to sign up first (Im not going to do that). Question -

  • The modernization Pavilion dv8t 16 GB memory will cause problems?

    I have a HP Pavilion dv8t Quad Edition Series Notebook PC, product number: VF836AV. The maximum amount of memory that can be installed in it is 8 GB, according to the operating instructions. I recently replaced the original 8 GB with 16 GB of memory,

  • Devil Update Manager?

    I turn on my PC, enter the password, and then have to wait about 12-18 minutes until the "UPDATE MANAGER" box appears, when I click on it off, the computer works normally, how can I DISABLE the UPDATE MANAGER box? To get my computer to run fast again

  • Shortened Radio FM of smartphones blackBerry is not responding

    Hi, hope someone can help me with a problem I have with my new BB 9720. Used the FM shortcut for the first time the other night. However, at any given time... About 30 minutes later... I received an error message. Unfortunately, I don't remember what

  • Is there a way to merge/combine forms?

    Is it possible for me to merge/combine multiple simple shapes (like several rectangles or a rectangle and a circle) to create a form more complex? I found no option that allows me to combine forms, but as a library for my forms, I was wondering if, p