Partitioned global index on partitioned table range, but the index partition does not work

Hello:

I was creating an index partitioned on table partitioned and partitioned index does not work.

create table table_range)

CUST_FIRST_NAME VARCHAR2 (20).

CUST_GENDER CHAR (1),

CUST_CITY VARCHAR2 (30),

COUNTRY_ISO_CODE CHAR (2),

COUNTRY_NAME VARCHAR2 (40),

COUNTRY_SUBREGION VARCHAR2 (30),

PROD_ID NUMBER NOT NULL,

CUST_ID NUMBER NOT NULL,

TIME_ID DATE NOT NULL,

CHANNEL_ID NUMBER NOT NULL,

PROMO_ID NUMBER OF NON-NULL,

QUANTITY_SOLD NUMBER (10.2) NOT NULL,

AMOUNT_SOLD NUMBER (10.2) NOT NULL

)

partition by (range (time_id)

lower partition p1 values (u01 tablespace to_date('2001/01/01','YYYY/MM/DD')),

lower partition (to_date('2002/01/01','YYYY/MM/DD')) tablespace u02 p2 values

);

create index ind_table_range on table2 (prod_id)

() global partition range (prod_id)

values less than (100) partition p1,

lower partition p2 values (maxvalue)

);

SQL > select TABLE_NAME, SUBPARTITION_COUNT, HIGH_VALUE, nom_partition NUM_ROWS of user_tab_partitions;

TABLE_NAME NOM_PARTITION SUBPARTITION_COUNT HIGH_VALUE NUM_ROWS

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

TABLE_RANGE P2 0 TO_DATE (' 2002-01-01 00:00:00 ',' SYYYY-MM-DD HH24:MI:SS ',' NLS_CALENDAR = GREGORIA 259418)

TABLE_RANGE P1 0 TO_DATE (' 2001-01-01 00:00:00 ',' SYYYY-MM-DD HH24:MI:SS ',' NLS_CALENDAR = GREGORIA 659425)

SQL > select INDEX_NAME, NUM_ROWS nom_partition, HIGH_VALUE user_ind_partitions;

INDEX_NAME NOM_PARTITION HIGH_VALUE NUM_ROWS

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

P1 IND_TABLE_RANGE 100 479520

IND_TABLE_RANGE P2 MAXVALUE 439323

SQL > EXECUTE DBMS_STATS. GATHER_TABLE_STATS (USER, 'TABLE_RANGE');

SQL > EXECUTE DBMS_STATS. GATHER_TABLE_STATS (USER, 'TABLE_RANGE', GRANULARITY = > 'PARTITION');

SQL > EXECUTE DBMS_STATS. GATHER_INDEX_STATS (USER, 'IND_TABLE_RANGE');

SQL > EXECUTE DBMS_STATS. GATHER_INDEX_STATS (USER, 'IND_TABLE_RANGE', GRANULARITY = > 'PARTITION');

SQL > set autotrace traceonly

SQL > alter shared_pool RAS system;

SQL > changes the system built-in buffer_cache;

SQL > select * from table_range

where prod_id = 127;

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

| ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time | Pstart. Pstop |

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

|   0 | SELECT STATEMENT |             | 16469 |  1334K |  3579 (1) | 00:00:43 |       |       |

|   1.  RANGE OF PARTITION ALL THE |             | 16469 |  1334K |  3579 (1) | 00:00:43 |     1.     2.

|*  2 |   TABLE ACCESS FULL | TABLE_RANGE | 16469 |  1334K |  3579 (1) | 00:00:43 |     1.     2.

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

Information of predicates (identified by the operation identity card):

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

2 - filter ("PROD_ID" = 127)

Statistics

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

320 recursive calls

2 db block Gets

13352 consistent gets

11820 physical reads

0 redo size

855198 bytes sent via SQL * Net to client

12135 bytes received via SQL * Net from client

1067 SQL * Net back and forth to and from the client

61 sorts (memory)

0 sorts (disk)

15984 rows processed

Once the sentence you say ' does not ' and then you go to paste plans that seem to show that it "works".

What gives?

In fact, if you look at the plans - think Oracle you have 16 k rows in the table and he'll be back k 12 rows for your select statement. In this case, Oracle is picking up the right plan - full scan 16 ranks of k is a lot less work to digitize the index lines k 12 followed by the research of rank k 12 rowid.

Tags: Database

Similar Questions

Maybe you are looking for

  • can I upgrade directly to el capitan of 10.9.5

    can I upgrade directly to el capitan of 10.9.5?

  • BK precision 1786B Driver does not

    I downloaded the drivers LabVIEW of BK precision 1786-B site Web of BK.  As communication via the cable of ITE occurs only by 26 hexadecimal byte-code, I have some difficulty controlling the communication OR max.  So, I downloaded the stand-alone pro

  • UDP receive default buffer size

    Hello I have a question about receiving data via UDP: Description of the problem: An application of part 3 is extract to a PACS + 2400 Hz measurement data. All samples are then sent to a UDP port locally. I then use a labview application to read the

  • Aspire V5 591 G-78R9 (NX. G5WAA.004)

    Aspire V5 591 G-78R9 (NX. G5WAA.004) - t - it have a screen matte non-glare?  The description on site microcenter says CineCrystal LED Backlit Display.  It says on the site of the Lim, Active Matrix TFT Color LCD.  Does not over mast or anti-glare an

  • Error 0x8007007B activating Windows8

    Dear Sir. Last year, I bought a laptop HP with Windows 8 pre - install and everything was fine until last week when my computer suddenly asked me to activate Windows. I have installed windows successfully, but the same are enabled for 30 days. When I