Local partitioned indexes

Hi all

I created 2 local partitioned index. The indexes are indexes of function. the table size is 2.3 T.
I created the first clue that it took 14 hours to create, and even to analyze and it works fine now. Then, I created second index. But now it does not.
What should I do?

version 11.1.0.6
RAC, ASM

Thanks in advance

Published by: disaster on April 10, 2011 21:43

Published by: disaster on April 10, 2011 21:51

Dear Sir

----------------------------------------------------------------------------------------------------------
| Id  | Operation              | Name         | Starts | E-Rows | A-Rows |   A-Time   | Buffers | Reads  |
----------------------------------------------------------------------------------------------------------
|   1 |  PARTITION RANGE SINGLE|              |      1 |      1 |     82 |00:03:37.92 |     534K|    534K|
|*  2 |   TABLE ACCESS FULL    | TBL          |      1 |      1 |     82 |00:03:37.92 |     534K|    534K|
----------------------------------------------------------------------------------------------------------

It is the plan of the real explanation followed by the SQL engine to run your query

The Oracle optimizer is the estimate (based on the statistics that you have collected about index and table) that your query will return only 1 rank (E-lines = 1) while in reality (when the query has been executed) it's return of 82 lines (A-Rows = 82) within 3 minutes and 37 seconds (A-Time = 00:03:37.92)

It is clear that your index function that is not used.

You should be aware that when you create a function based index, oracle will create a virtual column that is hidden behind the scene.

Try to gather statistics on this column using dbms_stats.

Please, try first to TEST

BEGIN
   DBMS_STATS.gather_table_stats
                 (ownname             => user,
                  tabname             => 'TBL',
                  CASCADE             => TRUE,
                  method_opt         => 'FOR ALL HIDDEN COLUMNS SIZE 1'
                         );
END;
/

and re - run your query and post once again the new plan explain him like you did before

Best regards

Mohamed Houri

Tags: Database

Similar Questions

  • deletion of a partitioned index

    Hi friends,

    I use 10.2.0.4 oracle on solaris.

    I have several partitioned index with the 2011 created on a daily basis. I tried to drop one of the indexes and got the below error.

    SQL > ALTER INDEX QOSDEV. PK_RATE_CISCOMEMORYPOOL DROP PARTITION 'OCTOBER 5, 2012 '.

    ALTER INDEX QOSDEV. PK_RATE_CISMEPOOL DROP PARTITION 'OCTOBER 5, 2012 '.

    Error on line 2

    ORA-14076: submitted alter index partition/subpartition operation is not valid for local partitioned indexes

    Script done on line 2.

    I ask you how to remove these partitions.

    Thank you

    DBApps

    Hello

    Try-

    ALTER drop partition table RATE_CISCOMEMORYPOOL 'October 5, 2012;

    Anand

  • Partitioned index

    Using Oracle 11.2.0.3

    We are evalauating partitiong stragetegies with a view to the realization of gains from perfomnace in reports in particular.

    How effeicient are partitioned indexes in this by example anti-terrorism just partitioned index aan table is not partitioned.

    One big fact to durrogate keys that have bitmpa indxese table which link to accentuate associated key dimensions.

    Patitioning given bitmap index which links to the largest dimension and partitiong Kay dimesnion dimension laregts.

    Reflections on partitioned indexes would be particularly useful.

    Thank you

    user5716448 wrote:
    Using Oracle 11.2.0.3

    We are evalauating partitiong stragetegies with a view to the realization of gains from perfomnace in reports in particular.

    How effeicient are partitioned indexes in this by example anti-terrorism just partitioned index aan table is not partitioned.

    One big fact to durrogate keys that have bitmpa indxese table which link to accentuate associated key dimensions.

    Patitioning given bitmap index which links to the largest dimension and partitiong Kay dimesnion dimension laregts.

    Reflections on partitioned indexes would be particularly useful.

    Thank you

    It is not possible to create a partitioned index bitmp on a non-partitioned table. Bitmap indexes can be local partitioned only.
    --
    John Watson
    Oracle Certified Master s/n
    http://skillbuilders.com

  • with no prefixes local prefix index a huge difference

    Hello world

    I have a little problem on the partitioning and I didn't understand why. Here is my scenario:

    I created a partitioned table, partition is a date column range partition ona, then I created 2 index a prefix, a non pre-fixed and both of them is local. When I run a query based on the partition column and another (that I've indexed) execution plans are really different. as an example:

      CREATE TABLE PART_HAREKET_TABLE (
        ISLEM_TAR DATE, -- MY PARTITION COLUMN
        ISLEM_REF VARCHAR2(10), -- INDEX COLUMN
        ... -- OTHER COLUMNS HERE
      );
      
    -- load data to the table from one of my prod table...
    
      CREATE INDEX I_PART_HAREKET_1 ON PART_HAREKET_TABLE(ISLEM_TAR, ISLEM_REF) LOCAL;
      
      CREATE INDEX I_PART_HAREKET_2 ON PART_HAREKET_TABLE(ISLEM_REF) LOCAL;
      
      EXEC DBMS_STATS.GATHER_TABLE_STATS(USER, 'PART_HAREKET_TABLE', ESTIMATE_PERCENT => 100, CASCADE => TRUE);
    After this, I run these queries:
      EXPLAIN PLAN FOR
      select /*+ INDEX(PART_HAREKET_TABLE, I_PART_HAREKET_1 ) */ * 
      from   part_hareket_table 
      where islem_tar = to_Date('22/01/2012','dd/mm/yyyy') and islem_ref like 'KN%';
    
    execution plan:
    
    -------------------------------------------------------------------------------------------------------------------------
    | Id  | Operation                          | Name               | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |
    -------------------------------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT                   |                    |  1243 |   195K|    19   (0)| 00:00:01 |       |       |
    |   1 |  PARTITION RANGE SINGLE            |                    |  1243 |   195K|    19   (0)| 00:00:01 |    62 |    62 |
    |   2 |   TABLE ACCESS BY LOCAL INDEX ROWID| PART_HAREKET_TABLE |  1243 |   195K|    19   (0)| 00:00:01 |    62 |    62 |
    |*  3 |    INDEX RANGE SCAN                | I_PART_HAREKET_1   |  1243 |       |     5   (0)| 00:00:01 |    62 |    62 |
    -------------------------------------------------------------------------------------------------------------------------
     
    Predicate Information (identified by operation id):
    ---------------------------------------------------
     
       3 - access("ISLEM_TAR"=TO_DATE(' 2012-01-22 00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND "ISLEM_REF" LIKE 'KN%')
           filter("ISLEM_REF" LIKE 'KN%')
    It is a good cost I think also as predicate info I see ISLEM_TAR and ISLEM_REF.

    When I use this:
      EXPLAIN PLAN FOR
      select /*+ INDEX(PART_HAREKET_TABLE, I_PART_HAREKET_2 ) */ * 
      from   part_hareket_table 
      where islem_tar = to_Date('22/01/2012','dd/mm/yyyy') and islem_ref like 'KN%';
    
    -------------------------------------------------------------------------------------------------------------------------
    | Id  | Operation                          | Name               | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |
    -------------------------------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT                   |                    |  1243 |   195K|  8209   (1)| 00:01:55 |       |       |
    |   1 |  PARTITION RANGE SINGLE            |                    |  1243 |   195K|  8209   (1)| 00:01:55 |    62 |    62 |
    |*  2 |   TABLE ACCESS BY LOCAL INDEX ROWID| PART_HAREKET_TABLE |  1243 |   195K|  8209   (1)| 00:01:55 |    62 |    62 |
    |*  3 |    INDEX RANGE SCAN                | I_PART_HAREKET_2   |   141K|       |   218   (1)| 00:00:04 |    62 |    62 |
    -------------------------------------------------------------------------------------------------------------------------
     
    Predicate Information (identified by operation id):
    ---------------------------------------------------
     
       2 - filter("ISLEM_TAR"=TO_DATE(' 2012-01-22 00:00:00', 'syyyy-mm-dd hh24:mi:ss'))
       3 - access("ISLEM_REF" LIKE 'KN%')
           filter("ISLEM_REF" LIKE 'KN%')
    as you can see here, there is a huge cost difference and ISLEM_TAR (partitioned column) is also used as a filter not access. These indices are LOCAL

    so I expect that second index (non-prefixed) would be more effective. because oracle already know which partition which must be read and this index is smaller (just a column a) so I thought, Oracle will find appropriate part partition index and will read just this score (for the index and table) thus rows.

    even the time of the request are different, first we (prefix) brings data ms 0.031, second 0.375ms (no prefixes).

    but it's not? what Miss me?

    You may say that ' AS' operator cause than on the ISLEM_REF column. I also use it as equal "=",
    for the first query costs 4, for a second, now cost 8. 2 again...

    the partition size is approximately 440 MB

    an example of similer is also here exist: index Local: prefix or no prefix

    Jonathan Lewis made an example and it works very well...

    My db:
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    "CORE     11.2.0.2.0     Production"
    TNS for IBM/AIX RISC System/6000: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production

    find the appropriate index part partition

    Who is 62 of Partition of Index in both cases.

    In both cases, there is a one-to-one correspondence between the partition table and the index partition.

    However, in the second case, he expects to have to browse through the index entries 141thousand against only 1243 index entries in the first case. Oracle expects to have to read several index blocks in the second case.

    I guess your partitions are per month and not per day. So an index that is located on ISLEM_TAR + ISLEM_REF of columns is a more 'fine' (i.e. more accurate) because it only reads the entries for that one day of the index.
    In the second case, Oracle expects that it returns rowid for several days (which means more ROWID returned from the index) and will filter the lines that do not match the date target when he reads the table. You'll notice that the use of the second filter on date against the table - read more lines of the table (because more ROWID is returned by the index).

    Hemant K Collette

    Published by: Hemant K Collette on 10 July 2012 15:17
    --Added clarification that 'fine' are "more accurate".

  • create partitioned indexes

    Hello

    I have created a new local index and found a syntax problem, I thought I had created an index as local, but it was created under the global name.

    Here is my syntax of test:
    CREATE TABLE invoices
    (invoice_no    NUMBER NOT NULL,
     invoice_date  DATE   NOT NULL,
     comments      VARCHAR2(500))
    PARTITION BY RANGE (invoice_date)
    (PARTITION invoices_q1 VALUES LESS THAN (TO_DATE('01/04/2001', 'DD/MM/YYYY')) ,
     PARTITION invoices_q2 VALUES LESS THAN (TO_DATE('01/07/2001', 'DD/MM/YYYY')) ,
     PARTITION invoices_q3 VALUES LESS THAN (TO_DATE('01/09/2001', 'DD/MM/YYYY')) ,
     PARTITION invoices_q4 VALUES LESS THAN (TO_DATE('01/01/2002', 'DD/MM/YYYY')));
    
    CREATE INDEX i_ia ON  invoices  (comments) local
    CREATE INDEX i_ia2 ON  invoices local (comments)
    If I run the interviewed next I get results only for the index 'I_IA ':
    SELECT * 
    FROM DBA_INDEXES,
         dba_ind_PARTITIONS
    WHERE TABLE_NAME like UPPER('%invoices%') and
          DBA_INDEXES.INDEX_NAME = dba_ind_PARTITIONS.INDEX_NAME
    My production table I thought that I had created a table with local index and only when the fact of the decline of the partitions I realized that something was wrong because it was taking too long to execute.
    My database is:
    Oracle Database 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production

    Shouldn't receive a syntax warning if "local" is used outside the correct place?


    Thank you
    Ricardo Tomas

    This position in the CREATE INDEX Syntax [url http://docs.oracle.com/cd/E11882_01/server.112/e26088/statements_5012.htm] is used for a table alias.

    LOCAL is not a reserved word.

  • Local/Global index for OLTP

    In our application (OLTP), we have a rule on

    * "" on all the partitioned tables, we need to have just partitioned LOCAL index "... *"
    I think that this rule is valid, because when we had GLOBAL index partitioned on the table when concurrent transactions
    was going on, we got below error:
    ORA - 00054:resource busy and...
    We get this error when rebuild us all indexes not valid...

    When we changed all the GLOBAL partitioned index at the LOCAL level... we get this error...

    We use MEV for cloud computing (i.e. we have several tenants and a partition for each tenant)


    My doubt is, is the rule as mentioned above may be still valid, because it is at odds with what is mentioned in the Oracle
    Documentation (the concepts guide)...
    http://docs.Oracle.com/CD/B19306_01/server.102/b14220/partconc.htm#i461446

    '' In general, you should use an index for OLTP applications and local storage of data or applications of DSS ''

    We use oracle 10 g 2...

    In our case, research www.lesormes.com will not create several partitions, only one partition (we have a partition for each tenant).

    Local is even better for you.

    Thanks for suggesting to rebuild online (for global)... I'll try with that... .but he would have any problem of performance relative to the index LOCAL...

    I don't think abnd so there shouldn't be any performance impact, rather it improves performance in locaking not all the table exclusively for the index creaiton.

    NY suggestion/idea why Oracle recommends partitioned Global index for OLTP?

    Because normally we have much aprtition of drop/merger/split partition of things in OLTP type (these operations are important in DSS normally loading data).

    any suggestion/idea why Oracle recommends partitioned Global index for OLTP?

    Because they are the fastest to access a record of a table and OLTP, response time is what counts. If you compare your reports OLTP or transactions, to spawn multiple partitions (a small percentage could access only a single partition and rules are made for the majority of cases, not for the small number of cases) and global index are better in this scenario.
    at MAS, you always have a huge data and as partition operation may stop your work until the index is rebuilt (which can take several hours for the huge data) where oracle is recommended to have a local indexing policy.

    Salman

  • Local Bitmap Index confusion

    Hello
    I use Oracle 10.2.0.3.0 on Solaris 5.10.

    I have a range based to 60 partitions partition table. It is a fact table. I load the data for 60 days in this table. I created a partition for each day, and the partition key is the column date. I've created the table with the partition, but does not create the local bitmap index on the partition keys $vdate, because as far as I know oracle makes the local bitmap index unusable before insert you and then to rebuild it after the charge. Is this fair?

    So the best strategy is first load the data in the partition, and then create a local on this partition, is bitmap index - this exact?

    For example, in the future, some lines get inserted into an existing partition where the local bitmap index is present, then I should still once rebuild the index on that partition, as in the case of insertion Oracle would have it turned off?


    In this table, it has a vactivity column that is a foreign key to a dimension. Several queries use this column here where clause. I also want to create an index of bitmap on this column? On this not partitioned key column, the local bitmap index should be created. Is this fair?

    Please also suggest as which is faster, a local bitmap index rebuild after making it unusable, or the deletion and recreation it?

    Thank you and best regards

    If you insert only a few lines, you don't need to score the unusable bitmap index partition. The insert will not fail.

    However, if you perform a bulk insert several lines, it would be desirable mark it unusable and rebuild after insertion.

    You can certainly create an index on the column of the FK.

    Hemant K Collette

  • partitioning and partitioned index

    I created 1 table with partitions.

    CREATE TABLE SAMPLE_ORDERS
    (NUMBER OF ORDER_NUMBER,
    ORDER_DATE DATE,
    NUMBER OF CUST_NUM
    NUMBER OF TOTAL_PRICE
    NUMBER OF TOTAL_TAX
    NUMBER OF TOTAL_SHIPPING)
    PARTITION OF RANGE (ORDER_DATE)
    (
    SO99Q1 PARTITION VALUES LESS THAN (TO_DATE (APRIL 1, 1999 ',' MON-DD-YYYY "")),
    SO99Q2 PARTITION VALUES LESS THAN (TO_DATE (1 JULY 1999 ',' MON-DD-YYYY "")),
    SO99Q3 PARTITION VALUES LESS THAN (TO_DATE (OCTOBER 1, 1999 ',' MON-DD-YYYY "")),
    SO99Q4 PARTITION VALUES LESS THAN (TO_DATE (JANUARY 1, 2000 ',' MON-DD-YYYY "")),
    SO00Q1 PARTITION VALUES LESS THAN (TO_DATE (APRIL 1, 2000 ',' MON-DD-YYYY "")),
    SO00Q2 PARTITION VALUES LESS THAN (TO_DATE (JULY 1, 2000 ',' MON-DD-YYYY "")),
    SO00Q3 PARTITION VALUES LESS THAN (TO_DATE (OCTOBER 1, 2000 ',' MON-DD-YYYY "")),
    SO00Q4 PARTITION VALUES LESS THAN (TO_DATE (JANUARY 1, 2001 ',' MON-DD-YYYY ""))
    )
    ;


    Few questions is now.
    1. How can I create indexes on the table.
    2. How can I rebuild the index if it is partitioned index?
    3. What is the impact of the reconstruction of indexes on the table (all table locks or just locks partitioned index)
    4. If I want to create partition for future purposes, for example for each month do I need to partition manually created for the same thing?

    Thank you

    When you create an Index with the keyword LOCAL and do not specify the names of each partition, Oracle uses the default Partition of Table name.

    For example, to rebuild the index corresponding to the first partition of the table, partition

    alter index sales_orders_ndx_l rebuild partition SO99Q1 ;
    

    DML may continue to run against the other partitions of the table (and their corresponding indices).

    When you do the maintenance of the score as the addition of a new Partition or split an existing Partition, for each Partition of the 'new' Table, a corresponding Index Partition will be automatically created.
    In order to ensure that the affected Index partitions are not left in a State UNUSABLE but are also rebuilt with maintaining the Table Partition, add the clause INDEX of UPDATE of the ALTER TABLE statement you use.

  • Global partitioned index hash

    Is it possible to create an index of global partitioned hash on the columns of the primary key of a table that is not partitioned itself?
    If a table has a PK constraint there an index generated automatically on the PK columns.
    Y at - it a syntax to make the overall index partitioned hash when creating the constraint of PK,.
    or syntax to MODIFY the indexes after the creation of the constraint?

    When you add a Pk to a table, you can choose a place already in the index. Something like

    alter table t1 add constraint T_PK primary key (col1) using index T_IDX;
    

    Create the partitioned index as you like with the same columns as the primary key and use the foregoing.

  • ORA-14086: a partitioned index cannot be reconstructed as a whole

    Hello

    I'm trying to rebuld index had error below.

    SQL > alter index rms12. PRICE_HIST_I1 regeneration;
    ALTER index rms12. PRICE_HIST_I1 rebuild
    *
    ERROR on line 1:
    ORA-14086: a partitioned index cannot be reconstructed as a whole

    Select index_name, separated from dba_indexes where table_name = 'PRICE_HIST '.

    o/p

    Index_name partitioned

    PRICE_HIST_I2 YES
    PRICE_HIST_I1 YES

    Thank you

    If you need to find the names of partition in dba_ind_paritions.

    ------
    Sybrand Bakker
    Senior Oracle DBA

  • Table partition and no partition indexes

    Hello

    I have the partition table that contains about 1 ml recods and he have daily score.
    This partition table have only a unique index that is a partition No.

    CREATE UNIQUE INDEX xxxxxx WE yyyyyy
    (ITEM_GUID, IMAGE_SIDE)
    LOGGING
    TABLESPACE zzzzzz
    PCTFREE 10
    INITRANS 2
    MAXTRANS 255
    STORAGE)
    INITIAL 170M
    ACCORDING TO 1 M
    MINEXTENTS 1
    MAXEXTENTS 2147483645
    PCTINCREASE 0
    DEFAULT USER_TABLES
    )
    NOPARALLEL;

    I drop very first partition of

    Fall of ALTER TABLE wwww.yyyyy SCORE PT_20080706;

    But this isn't my unique INVALID index.

    Is it normal to have a VALID unique index after the fall of any partition?

    Do I have to rebuild a unique index again?

    DB: oracle 10.2.0.3
    platform: solaris

    Thanks in advance

    According to the Oracle doc, if you drop the bulkhead with an overall index,.

    All index global, or all partitions of global partitioned indexes are marked UNUSABLE unless one of the following are true:

    You specify the UPDATE INDEX (cannot be specified for tables organized by index. Use GLOBAL updating INDEXES.)

    The dropped partition or its subparts are empty

    more info here
    http://download.Oracle.com/docs/CD/B19306_01/server.102/b14231/partiti.htm#sthref2751

    Check ALL_PART_INDEXES and ALL_INDEXES to check the State of your indexes.

  • Local partitioned Global Index Index conversion online.

    Hi all
    I use the Release of oracle 10.2.0.4.0 version. As a solution to solve a performance problem, I intend to convert one of the partitioned local index in overall index. Here is the script that I made, but it will take a time out as because other applications may use the same index and will suffer from performance during the transition problem. My question is if I can reach the same onlline, only because the prod database is too busy down time? Please suggest.

    Script:

    drop index INDX_c1c2;

    create the IDX_c1c2 index on tab1 (c1, c2);

    930254 wrote:
    Hi all
    I use the Release of oracle 10.2.0.4.0 version. As a solution to solve a performance problem, I intend to convert one of the partitioned local index in overall index. Here is the script that I made, but it will take a time out as because other applications may use the same index and will suffer from performance during the transition problem. My question is if I can reach the same onlline, only because the prod database is too busy down time? Please suggest.

    Script:

    drop index INDX_c1c2;

    create the IDX_c1c2 index on tab1 (c1, c2);

    Your application will run without index during the time it takes to create. An alternative approach which avoids this would be:

    create index INDX_c1c2null on tab1(c1,c2,null);
    drop index INDX_c1c2;
    

    --
    John Watson
    Oracle Certified Master s/n
    http://skillbuilders.com

    Published by: JohnWatson on February 17, 2013 11:35
    Typo - forgot to change the name of the index

  • Split partition - index / local

    Hi friends,

    I'm trying to divide a table partition.

    Please let me know if the syntax below are correct.

    If the local index used

    ALTER TABLE SNYT. PART_ESTD
    ESTD_M13_S22 PARTITION SPLIT TO ('IS', 13, '22')
    IN (ESTD_M13_S21 PARTITION, PARTITION ESTD_M13_S22)
    update of the index;

    (by http://asktom.oracle.com/pls/asktom/f?p=100:11:0:::P11_QUESTION_ID:1401247200346349807)
    =================================================================

    If used Global indexes

    ALTER TABLE SNYT. PART_ESTD
    ESTD_M13_S22 PARTITION SPLIT TO ('IS', 13, '22')
    IN (ESTD_M13_S21 PARTITION, PARTITION ESTD_M13_S22)
    UPDATE GLOBAL INDEXES;

    Concerning
    KSG

    Published by: KSG on 23 August 2012 18:27

    Published by: KSG on 23 August 2012 18:51

    http://docs.Oracle.com/CD/E11882_01/server.112/e26088/statements_3001.htm#i2131218

    http://docs.Oracle.com/CD/E11882_01/server.112/e26088/statements_3001.htm#i2151566

  • Count (*) using partitioned index gives incorrect results

    I have a table partitioned by hash with 4 index the.

    Table name: store_assortment

    clues the: idx1 (master_id), idx2 (store), idx3 (item), idx4 (request_id)

    When I run this query result is 13649:

    SELECT COUNT (*)

    OF store_assortment

    WHERE to store = 6010

    ORDER BY point;

    When I run this query result is 13648:

    SELECT COUNT (*)

    OF store_assortment

    WHERE store = 6010;

    I rebuild all indexes, but the results are the same. Can anyone point to a bug or something that can explain this?

    I dropped and recreated the indices and values are correct now. Reconstruction did not work.

    Thanks for all the help.

  • Hang partitioned index text on construction

    I have a partitioned table with 2 000 000 + lines with a blob column.  When you try to create an index of type CTXSYS. CONTEXT that is partitioned correctly finished 8 of 10 partitions but crashes right on the other 2 indefinitely.  I am building with a parallel degree of 8.  Three of these have expected of 'direct path read' while the rest are the "PX Deq: execution Msg.

    Any ideas?

    Ok.  18121298 patch solves this problem.  Discovered this while trying to make a service request.

Maybe you are looking for