Partitioning huge tables.

Hi all,
I am looking in a database for a customer where they have huge tables.
I have just executed:
SELECT SEGMENT_NAME, SEGMENT_TYPE, OWNER, (BYTES/1024/1024) MEGAS
FROM DBA_SEGMENTS
ORDER BY MEGAS DESC;
Some of them are displayed below:
GL_JE_LINES     TABLE     GL     42,272
SYS_IOT_TOP_789022     INDEX     APPLSYS     19,670
WIP_PERIOD_BALANCES     TABLE     WIP     11,157
SYS_IOT_TOP_789028     INDEX     APPLSYS     10,923
MTL_TRANSACTION_ACCOUNTS     TABLE     INV     10,796
WIP_TRANSACTION_ACCOUNTS     TABLE     WIP     10,763
RLM_SCHEDULE_LINES_ALL     TABLE     RLM     10,482
What kind of partition has anybody used for GL_JE_LINES table for example?
Any advice or comment will be really appreciated.
Thanks in advance.
Kind regards,
Francisco

Francisco,
Please see old threads for similar discussion -- http://forums.oracle.com/forums/search.jspa?threadID=&q=Partitioning&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
Thanks,
Hussein

Similar Messages

  • Limit on the number of partitions a table can have

    Hi,
    It's been quite some time I'm thinking of a simple and the best solution to a performance issue in my application. Benefiting out of partitioning the table seems a simplest approach; it involves very minimal changes to my application code and in addition, it keeps the overall application logic 100% intact. However, at times, the number of partitions required can grow to as large as 500 thousand. I know of another application implementing as many as 50 thousand partitions for one of its tables. I'm wondering if Oracle recommends or poses any limit to a number of partitions the table can have. How does that limit, if it exists, vary if each of my table partition holds only a small amount of data; say, not more than 2 thousand records each of 1 KB size. What are the important considerations that one needs to keep in mind while creating the huge number of partitions for a table?
    Any inputs on this would be a great help.
    Thanks,
    Aniruddh
    ps: Consider Oracle releases 10g onwards.
    Edited by: Aniruddh on Dec 30, 2009 9:46 AM
    Edited by: Aniruddh on Dec 30, 2009 9:50 AM

    Aniruddh,
    >
    What are the important considerations that one needs to keep in mind while creating the huge number of partitions for a table?
    >
    I doubt if you are using partitioning for the right causes. Please explain how is your data structured and why you need to create so many partitions..?
    when creating partition, you need to consider..
    a) why you need to partition?
    b) how is your data structured
    c) how your data is indexed.
    d) What kind of queries would you firing on this table to get the data. Will they use the partition key ?
    Thanks,
    Rajesh.
    Please mark this/any other answer as helpful or answered if it is so. If not, provide additional details/feedback.
    Always try to provide create table and insert statements to help the forum members help you better.

  • I have partitioned my tables, do I need to rebuild the indexes of the table

    Hello,
    I have partition very huge tables, by using rage partition method. After that few queries taking more time than before. Does the old indexes needs to rebuild?
    Thanks

    929941 wrote:
    Hello,
    I have partition very huge tables, by using rage partition method. After that few queries taking more time than before. Does the old indexes needs to rebuild?
    ThanksWhat do you think?
    By the way, how did you partition existing tables? Did you use dbms_redefinition, or did you use CTAS, or some other method?
    I love RAGE partitions. You should always always partition your rage.

  • Huge Group by operation on Huge Table takes lot of time

    Hi,
    Pl find the below given process which takes of time in execution (approx 5-6 hrs)
    The mailn reason for this is
    1) It Fetch data from huge table partition (i.e 18GB data for per day)
    2)Performs Group by operations
    3)In the where clause Index is not there on destination_number so performs Full Table scan
    I have some idea i.e I need to change the Some Parameter which will make the process faster ,
    Can you please help on this
    create or replace table tmp_kumar nologging as
    SELECT c.series_num , subscriber_id , COUNT(1) cnt , SUM(NVL(total_currency_charge,0))total_currency_charge ,
    TRUNC(disconnect_date) FROM
    (select * from prepcdr.PREPCDR_MAR_P3_10 partition(disconnect_date_11) union all
    select * from prepcdr.PREPCDR_MAR_P3_10 partition(disconnect_date_11_new)) b,
    (SELECT series_num, des, created_dt, LENGTH (series_num) len
    FROM PREPCDR.HSS_SERIES_MAST where home_ind ='Y'
    UNION
    SELECT cimd_number, des, created_dt, LENGTH (cimd_number)
    FROM PREPCDR.HSS_CIMD_MASTER) c
    WHERE b.cdr_call_type = '86'
    AND SUBSTR (b.destination_number, 1, c.len) = c.series_num
    AND c.len = (SELECT MAX(x.len) FROM (SELECT series_num, des, created_dt, LENGTH (series_num) len
    FROM PREPCDR.HSS_SERIES_MAST where home_ind ='Y'
    UNION
    SELECT cimd_number, des, created_dt, LENGTH (cimd_number) len
    FROM PREPCDR.HSS_CIMD_MASTER) x WHERE x.series_num = SUBSTR (b.destination_number, 1, x.len))
    AND disconnect_date >= '11-MAR-2010'
    AND disconnect_date < '12-MAR-2010'
    GROUP BY c.series_num , TRUNC(disconnect_date) , suBscriber_id

    This, most likely, will be more efficient:
    SELECT  c.series_num,
            subscriber_id,
            COUNT(1) cnt,
            SUM(NVL(total_currency_charge,0)) total_currency_charge,
            TRUNC(disconnect_date)
      FROM  (
              select  *
                from  prepcdr.PREPCDR_MAR_P3_10 partition(disconnect_date_11)
             union all
              select  *
                from  prepcdr.PREPCDR_MAR_P3_10 partition(disconnect_date_11_new)
            ) b,
             SELECT  DISTINCT series_num,
                              des,
                              created_dt,
                              len
               FROM  (
                      SELECT  series_num,
                              des,
                              created_dt,
                              len,
                              RANK() OVER(ORDER BY len) rnk
                        FROM  (
                                SELECT  series_num,
                                        des,
                                        created_dt,
                                        LENGTH(series_num) len
                                  FROM  PREPCDR.HSS_SERIES_MAST
                                  where home_ind ='Y'
                               UNION ALL
                                SELECT  cimd_number,
                                        des,
                                        created_dt,
                                        LENGTH(cimd_number)
                                  FROM  PREPCDR.HSS_CIMD_MASTER
               WHERE rnk = 1
            ) c
      WHERE b.cdr_call_type = '86'
        AND SUBSTR(b.destination_number,1,c.len) = c.series_num
       AND disconnect_date >= DATE '2010-03-11'
       AND disconnect_date < DATE '2010-03-12'
      GROUP BY  c.series_num,
                TRUNC(disconnect_date),
                suBscriber_id
    /SY.

  • Problem regarding partitioning of tables

    hi all....good afternoon
    I have a table of huge number of records and thats why I want to do partitioning of that table.
    The column upon which I have to make the partition is of varchar2(7) type which contains the data in the format '2009APR', '2010JAN' etc etc..
    Now I have to fetch out the first 4 characters of the datas (i.e only the year) and then I can partition the table based on the years.
    How can I do that....plss help.
    create table test123
    (name varchar2(10),
    age number,
    DOB varchar2(7),
    gender varchar2(1)
    Edited by: user12780416 on Dec 24, 2010 2:48 AM

    Just partition by DOB column:
    SQL> create table test123(
      2                       name varchar2(10),
      3                       age number,
      4                       DOB varchar2(7),
      5                       gender varchar2(1)
      6                      )
      7    partition by range(DOB)
      8      (
      9       partition DOB_past values less than('2009'),
    10       partition DOB_2009 values less than('2010'),
    11       partition DOB_2010 values less than('2011'),
    12       partition DOB_maxvalue values less than(maxvalue)
    13      )
    14  /
    Table created.
    SQL> insert into test123 values('X',0,'2010APR','M')
      2  /
    1 row created.
    SQL> select count(*) from test123 partition(DOB_2010)
      2  /
      COUNT(*)
             1
    SQL> insert into test123 values('Y',0,'2009JAN','M')
      2  /
    1 row created.
    SQL> select count(*) from test123 partition(DOB_2009)
      2  /
      COUNT(*)
             1
    SQL> SY.

  • Selecting Max Value from Huge Table

    Dear Proffessionals
    I have a huge table (20,000,000+ records) with the following columns:
    [Time], [User], [Value]
    The values in [Value] column can recur for a single User at a Time e.g.
    2015-01-01, Me, X
    2015-01-01, Me, Y
    2015-01-01, Me, X
    2015-01-02, Me, Z
    2015-01-02, Me, X
    2015-01-02, Me, Z
    For each day, and for every user I want to have the maximum recurring value :
    2015-01-01, Me, X
    2015-01-02, Me, Z
    to be inserted into another table.
    PS: I want the MOST optimized way of achieving this functionality, bcause I am expecting a growth on the raw table over time, so PERFORMANCE is of great consideration.
    I would really appreciate it, if somebody can help me.
    Regards

    I can think of two techniques based on the data selecticity
    1) using row number function
    2) using cross apply operator
    USE Northwind;
    -- Solution 1
    SELECT S.SupplierID, S.CompanyName, CA.ProductID, CA.UnitPrice
    FROM dbo.Suppliers AS S
      CROSS APPLY
        (SELECT TOP (10) *
         FROM dbo.Products AS P
         WHERE P.SupplierID = S.SupplierID
         ORDER BY UnitPrice DESC, ProductID DESC) AS CA
    ORDER BY S.SupplierID, CA.UnitPrice DESC, CA.ProductID DESC;
    -- Solution 2
    WITH C AS
      SELECT S.SupplierID, S.CompanyName, P.ProductID, P.UnitPrice,
        ROW_NUMBER() OVER(
          PARTITION BY P.SupplierID
          ORDER BY P.UnitPrice DESC, P.ProductID DESC) AS RowNum
      FROM dbo.Suppliers AS S
        JOIN dbo.Products AS P
          ON P.SupplierID = S.SupplierID
    SELECT SupplierID, CompanyName, ProductID, UnitPrice
    FROM C
    WHERE RowNum <= 10
    ORDER BY SupplierID, ProductID DESC, UnitPrice DESC;
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Problem while partitioning The Table

    create table Employee ( empno number(3), name varchar2(10), deptno number(4))
    partition by range(deptno)
    (partition p1 values less than(11),
    partition p2 values less than(21),
    partition p3 values less than(31));
    create table Employee (
    ERROR at line 1:
    ORA-00439: feature not enabled: Partitioning
    Please help me for solving this problem and send me the details I need to partition my table.
    Thanks in advance.
    w.regards
    R.Satish

    Looks like you don't have partition license or don't have a complete install of Oracle version 8.0.5. The best way to check is do a sqlplus user/passwd and look for a message that said "Production with the Partitioning and objects options" to appear before the SQL> prompt. Hope this helps....
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by rkumar:
    create table Employee ( empno number(3), name varchar2(10), deptno number(4))
    partition by range(deptno)
    (partition p1 values less than(11),
    partition p2 values less than(21),
    partition p3 values less than(31));
    create table Employee (
    ERROR at line 1:
    ORA-00439: feature not enabled: Partitioning
    Please help me for solving this problem and send me the details I need to partition my table.
    Thanks in advance.
    w.regards
    R.Satish <HR></BLOCKQUOTE>
    null

  • PL/SQL- Problem in creating a partitioned fact table using select as syntax

    Hi All,
    I am trying to create a clone(mdccma.fact_pax_bkng_t) of existing fact table (mdccma.fact_pax_bkng) using dynamic pl/sql. However, pl/sql anonymous block errors out with following error:
    SQL> Connected.
    SQL> SQL> DECLARE
    ERROR at line 1:
    ORA-00911: invalid character
    ORA-06512: at "SYS.DBMS_SYS_SQL", line 1608
    ORA-06512: at "SYS.DBMS_SQL", line 33
    ORA-06512: at line 50
    Here is pl/sql block:
    -- CREATING FPB_T
    DECLARE
    v_owner VARCHAR2(32) := 'MDCCMA';
    v_table_original VARCHAR2(32) := 'FACT_PAX_BKNG';
    v_table VARCHAR2(32) := 'FACT_PAX_BKNG_T';
    v_tblspc VARCHAR2(32) := v_owner||'_DATA';
    CURSOR c_parts IS SELECT TABLESPACE_NAME, PARTITION_NAME,HIGH_VALUE, ROW_NUMBER() OVER (ORDER BY PARTITION_NAME) AS ROWNUMBER
    FROM USER_TAB_PARTITIONS
    WHERE TABLE_NAME = v_table_original
    ORDER BY PARTITION_NAME;
    v_cmd CLOB := EMPTY_CLOB();
    v_cmd3 varchar2(300) := 'CREATE TABLE ' ||v_owner||'.'||v_table||' TABLESPACE '||v_tblspc
    ||' NOLOGGING PARTITION BY RANGE'||'(' ||'SNAPSHOT_DTM '||')' ||'(';
    v_part VARCHAR2(32);
    v_tblspc_name VARCHAR2(32);
    v_row number;
    v_value LONG;
    v_tmp varchar2(20000);
    v_cur INTEGER;
    v_ret NUMBER;
    v_sql DBMS_SQL.VARCHAR2S;
    v_upperbound NUMBER;
    BEGIN
    v_cmd := v_cmd3;
    OPEN c_parts;
    FETCH c_parts INTO v_tblspc_name, v_part,v_value, v_row;
    WHILE c_parts%FOUND
    LOOP
    IF (v_row = 1) THEN
    v_tmp := ' PARTITION '||v_part||' VALUES LESS THAN ' ||'('|| v_value||')'||' NOLOGGING TABLESPACE '||v_tblspc_name;
    ELSE
    v_tmp := ', PARTITION '||v_part||' VALUES LESS THAN ' ||'('|| v_value||')'||' NOLOGGING TABLESPACE '||v_tblspc_name;
    END IF;
    v_cmd := v_cmd || v_tmp;
    -- DBMS_OUTPUT.PUT_LINE(v_cmd);
    FETCH c_parts INTO v_tblspc_name, v_part,v_value, v_row;
    END LOOP;
    -- DBMS_OUTPUT.PUT_LINE('Length:'||DBMS_LOB.GETLENGTH(v_cmd));
    v_cmd := v_cmd||')'||' AS SELECT ' || '*'||' FROM ' || v_owner||'.'|| v_table_original ||' WHERE '||'1'||'='||'2'||';';
    v_upperbound := CEIL(DBMS_LOB.GETLENGTH(v_cmd)/256);
    FOR i IN 1..v_upperbound
    LOOP
    v_sql(i) := DBMS_LOB.SUBSTR(v_cmd
    ,256 -- amount
    ,((i-1)*256)+1 -- offset
    END LOOP;
    v_cur := DBMS_SQL.OPEN_CURSOR;
    DBMS_SQL.PARSE(v_cur, v_sql, 1, v_upperbound, FALSE, DBMS_SQL.NATIVE);
    v_ret := DBMS_SQL.EXECUTE(v_cur);
    CLOSE c_parts;
    DBMS_OUTPUT.PUT_LINE(v_cmd);
    -- EXECUTE IMMEDIATE v_cmd ;
    END;
    The above pl/sql creates a DDL for partitioned fact table(new) based on an existing fact table and get executes through CLOB.
    Please look into the issue and let me know any changes or modifications/suggestions that are required to fix the issue. Any help is appreciated.
    Thank You,
    Sudheer

    Think this is your problem:
    v_cmd := v_cmd||')'||' AS SELECT ' || '*'||' FROM ' || v_owner||'.'|| v_table_original ||' WHERE '||'1'||'='||'2'||';';Remove the SQL terminator ';' ... dynamic SQL doesn't require it, try this instead:
    v_cmd := v_cmd||')'||' AS SELECT ' || '*'||' FROM ' || v_owner||'.'|| v_table_original ||' WHERE '||'1'||'='||'2';Thanks
    Paul

  • Partitioning of table in oracle 10g - How to Add

    Hello Friends ,
    Hope you are all fine and doing great.
    By the way - I have a quick question on oracle 10g Partitioning of tables...
    I have a table with partition as stated below ..
    CREATE TABLE X_ACC_ASSETS_GPC_AGG
    X_ACC_ASSETS_GPC_AGG_RK NUMBER(10) NOT NULL,
    X_AS_OF_DT DATE NOT NULL,
    ACCOUNT_RK NUMBER(10) NOT NULL,
    X_UNIV_ACCOUNT_ID NUMBER(10),
    ACCOUNT_ID VARCHAR2(10 BYTE),
    X_ASSET_TYPE_CD VARCHAR2(6 BYTE),
    X_AUC_AMT NUMBER(18,5),
    X_FIRM_AMT NUMBER(18,5),
    X_ADJ_SRCE_AMT NUMBER(18,5),
    PROCESSED_DTTM DATE
    )PARTITION BY RANGE (X_AS_OF_DT)
    PARTITION P200712 VALUES LESS THAN (TO_DATE(' 2008-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    NOLOGGING
    NOCOMPRESS
    TABLESPACE KAW_DATA
    PCTFREE 10
    INITRANS 1
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS 2147483645
    BUFFER_POOL DEFAULT
    PARTITION P201112
    NOLOGGING
    NOCOMPRESS
    TABLESPACE KAW_DATA
    PCTFREE 10
    INITRANS 2
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS 2147483645
    BUFFER_POOL DEFAULT
    PARTITION PMAX
    NOLOGGING
    NOCOMPRESS
    TABLESPACE KAW_DATA
    PCTFREE 10
    INITRANS 2
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS 2147483645
    BUFFER_POOL DEFAULT
    )NOPARALLEL;
    My question is :
    1) How to add a partition say P201201 ..
    Since I have already stated PARTITION PMAX can I still add partition?
    2) Can I add partition even though the table has data ?
    ==========================
    I tried to add partition ..say
    ALTER TABLE X_ACC ADD PARTITION P201201 VALUES LESS THAN
    (TO_DATE(' 2012-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    NOLOGGING
    NOCOMPRESS
    TABLESPACE KAW_DATA
    PCTFREE 10
    INITRANS 1
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS 2147483645
    BUFFER_POOL DEFAULT
    but getting the error ..
    "partition bound must collate higher than that of the last partition"
    Thanks/kumar

    You have partitions
    200712
    200812
    200912
    201012
    201112
    PMAX.
    so your condition for partition p201112 is '201012-01-01' to '201112-01-01' i.e the values between these two dates will be in partition p201112. and then everything else will be in PMAX. So now you are splitting your pmax.
    alter table X_acc split partition pmax at ( to_date('2012-01-01 00:00:00','YYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN') )
    into (partition p201201, partition pmax); The condition you have to change. I just showed as an example. It could be the date range between two dates or it could be greater than a date value. It is upto how you want this new partition.
    how to add partition between two partition
    Edited by: pransuj on Mar 25, 2011 11:13 AM
    Edited by: pransuj on Mar 25, 2011 11:14 AM

  • Sql server partition parent table and reference not partition child table

     
    Hi,
    I have two tables in SQL Server 2008 R2, Parent and Child Table.  
    Parent has date time, and it is partitioned monthly,  there is a Child table which just refer the Parent table using Foreign key relation.   
    is there any problem the non-partitioned child table referring to a partitioned parent table?
    Thanks,
    Areef

    The tables will need to be offline for the operation. "Offline" here, means that you wrap the entire operation in a transaction. Ideally, this transaction would:
    1) Drop the foreign key.
    2) Use ALTER TABLE SWITCH to drop the old data.
    3) Use ALTER PARTITION FUNCTION to drop the old empty partition.
    4) Use ALTER PARTITION FUNCTION to add a new empty partition.
    5) Reapply the foreign keys WITH CHECK.
    All but the last operation are metadata-only operation (provided that you do them right). To perform the last operation, SQL Server must scan the child tbale and verify that all keys are present in the parent table. This can take some time for larger tables.
    During the transaction, SQL Server holds Sch-M locks on the table, which means that are entirely inaccessible, even for queries running with NOLOCK.
    You avoid this the scan by applying the fkey constraint WITH NOCHECK, but this can have impact on query plans, as SQL Server will not consider the constraint as trusted.
    An alternative which should not be entirely dismissed is to use partitioned
    views instead. With partitioned views, the foreign keys are not an issue, because each partition is a pair of tables, with its own local fkey.
    As for the second question: it appears to be completely pointless to partition the parent, but not the child table. Or does the child table only have rows for a smaller set of the rows in the parent?
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Update records in huge table

    Hi,
    I need to update two fields in a huge table (> 200.000.000 records). I've created 2 basic update scripts with a where clause. The problem is that there isn't an index on these fields in the where clause. How can I solve this? Creating a new index is not an option.
    An other solution is to update the whole table (so without a where clause) but I don't know if it takes a lot of time, locks records,...
    Any suggestions?
    Thanks.
    Ken

    Ken,
    You may be better off reading the metalink documents. PDML stands for Parallel DML. You can use parallel slaves to get the update done quickly. Obviously this is dependent on the number of parallel slaves you have and the degree you set
    Type PDML on metalink
    G

  • Partitioning of tables  in oracle 1og

    I want to do the partitioning of tables due to increasing their size.Can anyone guide me cn I do it? Is it possible to do it?If possible then how can i do it.plz guide mme with al qeuries.
    thanks.

    While it is certainly possible to partition tables (assuming you have the enterprise edition and the partitioning option), that is not something that you would generally want to take a cookbook approach to. Partitioning tables incorrectly is a great way to slow down the system and make it oodles more difficult to support. Partitioning requires a fair amount of architecture and design to get right, and that, in turn, requires that you understand how partitioning works, how your application works, and what you want partitioning to do to change the way your application works.
    Justin

  • Bitmap index or Composite index better on a huge table

    Hi All,
    I got a question regarding the Bitmap index and Composite Index.
    I got a table which has got only two colums CUSTOMER(group_no NUMBER, order_no NUMBER)
    This is a 100Million+ record table and here I got 100K Group_nos and and unique 100Million order numbers. I.E Each group should have 1000 order numbers.
    I tested by creating a GLOBAL Bitmap index on this huge table(more than 1.5gb in size) and the GLOBAL Bitmap index that got created is under 50MB and when I query for a group number say SELECT * FROM CUSTOMER WHERE group_no=67677; --> 0.5 seconds to retrive all the 1000 rows. I checked for different groups and it is the same.
    Now I dropped the BitMap Index and re-created a Composite index on( group_no and order_no). The index size more than the table size and is around 2GB in size and when I query using the same select statment SELECT * FROM CUSTOMER WHERE group_no=67677; -->0.5 seconds to retrive all the 1000 rows.
    My question is which one is BETTER. BTree or BITMAP Index and WHY?
    Appreciate your valuable inputs on this one.
    Regars,
    Madhu K.

    Dear,
    Hi All,
    I got a question regarding the Bitmap index and Composite Index.
    I got a table which has got only two colums CUSTOMER(group_no NUMBER, order_no NUMBER)
    This is a 100Million+ record table and here I got 100K Group_nos and and unique 100Million order numbers. I.E Each group should have 1000 order numbers.
    I tested by creating a GLOBAL Bitmap index on this huge table(more than 1.5gb in size) and the GLOBAL Bitmap index that got created is under 50MB and when I query for a group number say SELECT * FROM CUSTOMER WHERE group_no=67677; --> 0.5 seconds to retrive all the 1000 rows. I checked for different groups and it is the same.
    Now I dropped the BitMap Index and re-created a Composite index on( group_no and order_no). The index size more than the table size and is around 2GB in size and when I query using the same select statment SELECT * FROM CUSTOMER WHERE group_no=67677; -->0.5 seconds to retrive all the 1000 rows.
    My question is which one is BETTER. BTree or BITMAP Index and WHY?
    Appreciate your valuable inputs on this one.First of all, bitmap indexes are not recommended for write intensive OLTP applications due to the locking threat they can produce in such a kind of applications.
    You told us that this table is never updated; I suppose it is not deleted also.
    Second, bitmap indexes are suitable for columns having low cardinality. The question is how can we define "low cardinality", you said that you have 100,000 distincts group_no on a table of 100,000,000 rows.
    You have a cardinality of 100,000/100,000,000 =0,001. Group_no column might be a good candidate for a bitmap index.
    You said that order_no is unique so you have a very high cardinality on this column and it might not be a candidate for your bitmap index
    Third, your query where clause involves only the group_no column so why are you including both columns when testing the bitmap and the b-tree index?
    Are you designing such a kind of index in order to not visit the table? but in your case the table is made only of those two columns, so why not follow Hermant advise for an Index Organized Table?
    Finally, you can have more details about bitmap indexes in the following richard foot blog article
    http://richardfoote.wordpress.com/2008/02/01/bitmap-indexes-with-many-distinct-column-values-wotsuh-the-deal/
    Best Regards
    Mohamed Houri

  • Partitioning A table on a data column

    Hi,
    My requirement is to partition a table using a column with DATE datatype.
    Example:
    CREATE TABLE parttab
    STATUS CHAR(1) DEFAULT 'a' NOT NULL,
    UPDATER VARCHAR2(55) NOT NULL,
    UPDTIME DATE DEFAULT SYSDATE NOT NULL
    TABLESPACE part_tbs
    Now i want to RANGE partition the above table on the "UPDTIME" column, so that it will look like:
    Partition Value from Value till
    P1 01-Jan 31-Mar
    P2 01-Apr 30-Jun
    P3 01-Jul 30-Sep
    P4 MAXVALUE
    I tried using the below syntax, but failed with error.
    CREATE TABLE parttab
    STATUS CHAR(1) DEFAULT 'a' NOT NULL,
    UPDATER VARCHAR2(55) NOT NULL,
    UPDTIME DATE DEFAULT SYSDATE NOT NULL
    TABLESPACE part_tbs
    LOGGING
    PARTITION BY RANGE (UPDTIME)
    PARTITION P1 VALUES LESS THAN (to_date('04','MM')) LOGGING COMPRESS TABLESPACE part_tbs_P1,
    PARTITION P2 VALUES LESS THAN (to_date('07','DD-MM')) LOGGING COMPRESS TABLESPACE part_tbs_P2,
    PARTITION P3 VALUES LESS THAN (to_date('10','DD-MM')) LOGGING COMPRESS TABLESPACE part_tbs_P3,
    PARTITION P4 VALUES LESS THAN (MAXVALUE) LOGGING COMPRESS TABLESPACE part_tbs_P4
    COMPRESS
    NOCACHE
    PARALLEL ( DEGREE 2 INSTANCES Default )
    ROWDEPENDENCIES
    NOMONITORING
    ENABLE ROW MOVEMENT;
    Please suggest.
    Thanks in advance for the suggestions.

    what is the error message and your Oracle version? this sample may assist I guess -
    CREATE TABLE range_part (
    prof_history_id NUMBER(10),
    person_id       NUMBER(10) NOT NULL,
    organization_id NUMBER(10) NOT NULL,
    record_date     DATE NOT NULL,
    ph_comments     VARCHAR2(200))
    PARTITION BY RANGE (record_date) (
    PARTITION yr0 VALUES LESS THAN (TO_DATE('01-JAN-2000','DD-MON-YYYY'))
    TABLESPACE part1,
    PARTITION yr1 VALUES LESS THAN (TO_DATE('01-JAN-2001','DD-MON-YYYY'))
    TABLESPACE part2,
    PARTITION yr2 VALUES LESS THAN (TO_DATE('01-JAN-2002','DD-MON-YYYY'))
    TABLESPACE part3,
    PARTITION yr9 VALUES LESS THAN (MAXVALUE) TABLESPACE part4);for more examples you may visit - http://psoug.org/reference/partitions.html

  • Deletion from huge table

    hi,
    we need to delete from a huge table (~11 million records) based on a column lookup from another table. Other than general DELETE statement , is there any best way to have fast delete
    thanks.

    SHMYG@rex> create table test (f1 varchar2(10));
    SHMYG@rex> create table test1 (f1 varchar2(10));
    SHMYG@rex> insert into test values ('a');
    SHMYG@rex> insert into test values ('b');
    SHMYG@rex> insert into test1 values ('a');
    SHMYG@rex> select * from test;
    F1
    a
    b
    SHMYG@rex> select * from test1;
    F1
    a
    SHMYG@rex> delete from test where exists (select * from test1 where test.f1 = test1.f1);
    SHMYG@rex> select * from test;
    F1
    b

Maybe you are looking for

  • App store and apps problem when migrated

    I am going to ask this here because Apple support has not been able to fix this. Old computer = iMac core 2 duo 2.4GHz 10.6.7 OK so I just bought a new iMac quad core i7 2.93GHz (2010 model on closeout) and from the start I selected to migrate from a

  • Map ID Processing for a CHM file

    This is just a question so I understand fully how this works... I have created a Map file for my project and assigned numeric map ID's to each topic that needs to be linked from my application to my CHM file. I have a topic with: Topic Title = "Histo

  • Multiple constraining classifiers in generic templates - compiler broken

    can not compile multiple constraining classifiers to a generic template if the classifier is defined in the template:      public <U, T extends U> void a() {} will compile. java language specification: 4.4 Type Variables says:      public <T extends

  • HT4528 phone screen crack not under warranty how much to fix

    how much is the screen replacement goin to cost without warranty or applecarr

  • URGENT: Changing Tab

    Hi all, I was searching the forum, but couldn't find a satisfied anwser on the topic: how to change a tab on page with JPDK. Like I want to have a link in a portlet created with the API (PortletRendererUtil) which specifies a tab on a page. When clic