Type of index for VarChar2

Hello

I have a number of varchar2 fields on my paintings. They are VarChar2 (2000) with an average length between 130 and 290 characters.
I would like to build the index for these fields to improve search performance.
It is on an instance of Oracle9.

Could you recommend a type of index for this field?

Thank you

Death :)

Pavan - a DBA wrote:
According to Oracle,.
If this column contains the low cardinality (less), you can create bitmap indexes
If this column contains the high cardinality (more), you can create the index b-tree (default index type)

It is not so simple.
Please read the following thread, it contains also some interesting links:
Re: index bitmap and distinct keys

Nicolas.

Tags: Database

Similar Questions

  • VARARRAY indexed by VARCHAR2 LOOP

    Hello guys,.

    I was wondering if anyone can help me with this?
    DECLARE 
      TYPE my_type IS RECORD (
        x NUMBER(10), 
        y NUMBER(10)
      );
      
      TYPE list_my_type IS TABLE OF my_type INDEX BY VARCHAR2(30);
      
      aList list_my_type;
    BEGIN
      aList('HELLO').x := 10;
      aList('FOO').x := 15;
      aList('BAR').x := 20;
      
      FOR rec IN aList.FIRST .. aList.LAST
      LOOP
        DBMS_OUTPUT.put_line(aList(rec).x);
      END LOOP;
    END;
    /
    I'm trying to loop through my vararry, but I get this error:
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    ORA-06512: at line 15
    06502. 00000 -  "PL/SQL: numeric or value error%s"
    *Cause:    
    *Action:
    How can I make a loop on this and view the content of each element?

    Thank you

    Navigation in an associative array must be done through the FOLLOWING method:

    SQL> DECLARE
      2    TYPE my_type IS RECORD (
      3      x NUMBER(10),
      4      y NUMBER(10)
      5    );
      6
      7    TYPE list_my_type IS TABLE OF my_type INDEX BY VARCHAR2(30);
      8
      9    aList list_my_type;
     10    idx   VARCHAR2(30);
     11
     12  BEGIN
     13    aList('HELLO').x := 10;
     14    aList('FOO').x := 15;
     15    aList('BAR').x := 20;
     16
     17    idx := aList.first;
     18    LOOP
     19      exit when idx is null;
     20      DBMS_OUTPUT.put_line(idx || ' - x = ' || aList(idx).x);
     21      idx := aList.next(idx);
     22    END LOOP;
     23
     24  END;
     25  /
    
    BAR - x = 20
    FOO - x = 15
    HELLO - x = 10
    
    PL/SQL procedure successfully completed
     
    
  • How to create indexes for the great table of telecom

    Hello

    I'm working on DB 10 G on a 5 REHL for telecommunications company with more than 1 million saved per day, we need speed up the result of the query.
    We know, there are several types of INDEX and I need professional advice to create a suitable,

    many of our requests depend on the MSID (the MAC address of the Modem) column,
       
    Name           Null Type         
    -------------- ---- ------------ 
    STREAMNUMBER        NUMBER(9)    
    MSID                VARCHAR2(20) 
    USERNAME            VARCHAR2(20) 
    DOMAIN              VARCHAR2(20) 
    USERIP              VARCHAR2(16) 
    CORRELATION_ID      VARCHAR2(64) 
    ACCOUNTREASON       NUMBER(3)    
    STARTTIME           VARCHAR2(14) 
    PRIORTIME           VARCHAR2(14) 
    CURTIME             VARCHAR2(14) 
    SESSIONTIME         NUMBER(9)    
    SESSIONVOLUME       NUMBER(9)    
    .
    .
    .
    Please help,

    Hello

    first of all, think of all these SQL for the subquery on MAX (fairy) with analytical functions, the examples given on AskTom of rewriting: http://asktom.oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:9843506698920

    So I'll start with a normal index the MSID (but I think you already have), but provide a compression on the column, I think the same value MSID exist several times in the table. If the performance is not satisfactory or that the plan is not the best, then an option to include more columns can help you.

    I think that the first part of the answer will bring more gain.

    Herald tiomela
    http://htendam.WordPress.com

  • Type of columns for (ROracle)

    Hello

    I use ROracle 1.1 - 11

    I have try to add rows of a data frame R in an Oracle Table.

    I use the following function:

    dbWriteTable (conn = con, schema = "MY_SCHEM" name = "TAB1"

    value = my.df

    row.names = FALSE

    overwrite = FALSE

    Append = TRUE)

    I get the error "ORA-01438: value larger than the precision specified for the column.

    In the help file for dbWriteTable I read that digital maps R to Oracle NUMBER if ora.number argument is TRUE or Oracle BINARY_DOUBLE so FALSE and R character cards for Oracle VARCHAR2 (4000)

    The Oracle Table I want to insert lines in, a column of type VARCHAR2 (32 bytes), VARCHAR2 (64 bytes), and NUMBER (6)

    I suspect this is the cause of my mistake

    How should I set my data frame R column types do not to have an own export/insert in the Oracle Tables?

    For more information, I can't change my Oracle Table structure.

    Thanks a lot for your help!

    It is likely that your data block contains a variable whose decimal values.  To help us identify the cause of the erorr, answer with the data types of R for the variables in your data frame R, the first rows of the data frame.

    For example, for data.frame df:

    R > sapply (df, data.class)

    R > head (df)

    Sherry

  • 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

  • Create indexes for an XMLType column.

    Hello

    I have a table that has a column of XMLType, the XSD is saved in DB. The XML is something like -

    < primary >
    < sub1 >
    < child1_1 / >
    < child1_2 / >
    < child1_3 / >
    < / sub1 >
    < sub2 >
    < child2_1 / >
    < child2_2 / >
    < child2_3 / >
    < / sub2 >
    < sub3 >
    < child31_1 / >
    < child3_2 / >
    < child3_3 / >
    < / sub3 >
    < / elementary school >

    I want to create indexes for child nodes. I read THAT XML structure cannot have collection as index it should be singleton.
    So can someone tell me no work around to create indexes for these nodes, or whatever it is that I missed as follows.

    Thank you

    #1. Since you're on 11g stop using the syntax of depricated... (extractValue, table (xmlsequence))

    SQL> create table PURCHASEORDER_TAB
      2  (
      3    PID number(4),
      4    PURCHASEORDER XMLTYPE
      5  )
      6  xmltype column PURCHASEORDER
      7  store as OBJECT RELATIONAL
      8  XMLSCHEMA "http://localhost:80/publishedContent/SB-XML/xsd/2010/purchaseOrder.xsd" Element "PurchaseOrder"
      9  /
    
    Table created.
    
    SQL> select table_name, table_type_name
      2  from user_nested_tables where parent_table_name = 'PURCHASEORDER_TAB';
    
    TABLE_NAME                     TABLE_TYPE_NAME
    ------------------------------ ------------------------------
    SYS_NTdmDOdAAMQsuXdRy6lc0H/A== Action64442_COLL
    SYS_NT8EIzAbUOQFGN2u6hCXP39g== LineItem64443_COLL
    
    SQL> rename "SYS_NT8EIzAbUOQFGN2u6hCXP39g==" to LINEITEM_NT
      2  /
    
    Table renamed.
    
    SQL> create index QTY_INDEX on LINEITEM_NT ("Quantity");
    
    Index created.
    
    SQL> set autotrace on explain lines 250 pages 50 trimspool on
    SQL> --
    SQL> select t.pid, quantity
      2    from PURCHASEORDER_TAB t,
      3         XMLTABLE
      4         (
      5           '/PurchaseOrder/LineItems/LineItem'
      6           passing t.PURCHASEORDER
      7           columns
      8           QUANTITY number(4) path 'Quantity'
      9         )
     10   where QUANTITY = 3
     11  /
    
    no rows selected
    
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 1929272390
    
    --------------------------------------------------------------------------------------------------
    | Id  | Operation                    | Name              | Rows  | Bytes | Cost (%CPU)| Time     |
    --------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT             |                   |     1 |    46 |     3   (0)| 00:00:01 |
    |   1 |  NESTED LOOPS                |                   |       |       |            |          |
    |   2 |   NESTED LOOPS               |                   |     1 |    46 |     3   (0)| 00:00:01 |
    |*  3 |    TABLE ACCESS FULL         | LINEITEM_NT       |     1 |    23 |     2   (0)| 00:00:01 |
    |*  4 |    INDEX UNIQUE SCAN         | SYS_C00429284     |     1 |       |     0   (0)| 00:00:01 |
    |   5 |   TABLE ACCESS BY INDEX ROWID| PURCHASEORDER_TAB |     1 |    23 |     1   (0)| 00:00:01 |
    --------------------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       3 - filter(CAST(TO_NUMBER(TO_CHAR("Quantity")) AS number(4) )=3)
       4 - access("NESTED_TABLE_ID"="T"."SYS_NC0002900030$")
    
    Note
    -----
       - dynamic sampling used for this statement (level=2)
    
    SQL> select t.pid, quantity
      2    from PURCHASEORDER_TAB t,
      3         XMLTABLE
      4         (
      5           '/PurchaseOrder/LineItems/LineItem'
      6           passing t.PURCHASEORDER
      7           columns
      8           QUANTITY number(12,4) path 'Quantity'
      9         )
     10   where QUANTITY = 3
     11  /
    
    no rows selected
    
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 3093486066
    
    --------------------------------------------------------------------------------------------------
    | Id  | Operation                    | Name              | Rows  | Bytes | Cost (%CPU)| Time     |
    --------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT             |                   |     1 |    46 |     2   (0)| 00:00:01 |
    |   1 |  NESTED LOOPS                |                   |       |       |            |          |
    |   2 |   NESTED LOOPS               |                   |     1 |    46 |     2   (0)| 00:00:01 |
    |   3 |    TABLE ACCESS FULL         | PURCHASEORDER_TAB |     1 |    23 |     2   (0)| 00:00:01 |
    |*  4 |    INDEX RANGE SCAN          | QTY_INDEX         |     1 |       |     0   (0)| 00:00:01 |
    |*  5 |   TABLE ACCESS BY INDEX ROWID| LINEITEM_NT       |     1 |    23 |     0   (0)| 00:00:01 |
    --------------------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       4 - access("Quantity"=3)
       5 - filter("NESTED_TABLE_ID"="T"."SYS_NC0002900030$")
    
    Note
    -----
       - dynamic sampling used for this statement (level=2)
    
    SQL> select t.pid, quantity
      2    from PURCHASEORDER_TAB t,
      3         XMLTABLE
      4         (
      5           '/PurchaseOrder/LineItems/LineItem'
      6           passing t.PURCHASEORDER
      7           columns
      8           QUANTITY path 'Quantity'
      9         )
     10   where QUANTITY = 3
     11  /
    
    no rows selected
    
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 3093486066
    
    --------------------------------------------------------------------------------------------------
    | Id  | Operation                    | Name              | Rows  | Bytes | Cost (%CPU)| Time     |
    --------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT             |                   |     1 |    46 |     2   (0)| 00:00:01 |
    |   1 |  NESTED LOOPS                |                   |       |       |            |          |
    |   2 |   NESTED LOOPS               |                   |     1 |    46 |     2   (0)| 00:00:01 |
    |   3 |    TABLE ACCESS FULL         | PURCHASEORDER_TAB |     1 |    23 |     2   (0)| 00:00:01 |
    |*  4 |    INDEX RANGE SCAN          | QTY_INDEX         |     1 |       |     0   (0)| 00:00:01 |
    |*  5 |   TABLE ACCESS BY INDEX ROWID| LINEITEM_NT       |     1 |    23 |     0   (0)| 00:00:01 |
    --------------------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       4 - access("Quantity"=3)
       5 - filter("NESTED_TABLE_ID"="T"."SYS_NC0002900030$")
    
    Note
    -----
       - dynamic sampling used for this statement (level=2)
    
    SQL> SELECT t.pid, extractValue(Value(sta),'/LineItem/Quantity')
      2    FROM PURCHASEORDER_TAB t,
      3    table(xmlsequence(extract(t.purchaseOrder,'/PurchaseOrder/LineItems/LineItem'))) sta
      4    WHERE extractValue(Value(sta),'/LineItem/Quantity')= 3
      5  /
    
    no rows selected
    
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 3093486066
    
    --------------------------------------------------------------------------------------------------
    | Id  | Operation                    | Name              | Rows  | Bytes | Cost (%CPU)| Time     |
    --------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT             |                   |     1 |    46 |     2   (0)| 00:00:01 |
    |   1 |  NESTED LOOPS                |                   |       |       |            |          |
    |   2 |   NESTED LOOPS               |                   |     1 |    46 |     2   (0)| 00:00:01 |
    |   3 |    TABLE ACCESS FULL         | PURCHASEORDER_TAB |     1 |    23 |     2   (0)| 00:00:01 |
    |*  4 |    INDEX RANGE SCAN          | QTY_INDEX         |     1 |       |     0   (0)| 00:00:01 |
    |*  5 |   TABLE ACCESS BY INDEX ROWID| LINEITEM_NT       |     1 |    23 |     0   (0)| 00:00:01 |
    --------------------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       4 - access("Quantity"=3)
       5 - filter("NESTED_TABLE_ID"="T"."SYS_NC0002900030$")
    
    Note
    -----
       - dynamic sampling used for this statement (level=2)
    
    SQL>
    

    Note the first example XMLTable does not use the index because the data type of AMOUNT is given wrong...

  • need help to determine the type of partition for tables

    Hello

    I have a few tables that have millions of record. In some tables, we have data from previous years, that we do not now use. Can we create a partition of this type of tables table.

    On other tables, how to decide if you should use the range/list/hash partitioning on our tables.

    Do I need to recreate indexes for the tables after you create the partition tables.

    Please guide me.

    Best regards

    Partitioning of decisions are based on how you can access data.

    If you access date then partition by date.
    If you go through a list of values and then use the list.
    If you there is no model and you just need to break the data up into smaller compartments using hash.

    I don't see why, based on what you wrote, partitioning by date range would be not worthy of consideration.

  • Read the index for performance data

    Hello.
    Advice needed.
    I have the table as
    create table test (a varchar2 (20), ch. varchar2 (20), b varchar2 (20), d...)

    I have indexes for the column "a".
    Now when I'm data select 1st three columns (a, b, c) by 'a' of the criteria (select a, b, c fom test where a like '% aa') I'll have the execution of plan:

    1 scan interval Index
    2. access by rowid

    Now, I want to choose without 2nd operation. So I'm adding complex index for a, b, c.
    After that this select (select a, b, c fom test where a like '% aa') will read the index data.

    The question: is it possible to win some perfomance win this way? I mean, it is possible that the research by complex index (a, b, c) will take longer than the search by simple index (a) + access by rowid?
  • Index for the Group of readonly cache table

    Hello

    Suppose I have a table in Oracle which is cached in TT as a readonly cache group.
    The oracle table has a primary key, based on columns (c1, c2, c3).

    Now, the oracle table also has a unique index (for example defined on columns c4, c5) in support of some queries.

    (1) is there a way to propagate this unique index for the cache group? (so that we can perform queries effectively TimesTen)

    (2) is it correct to assume that the group create cache statement MUST have the columns (c1, c2, c3) for the primary key? (that is, exactly the same as the pharmacokinetics of the oracle)


    Thank you!

    (1) after you have created the cache in TimesTen group, simply create the index needed on the tables of cache in TimesTen (using CREATE [UNIQUE] INDEX) as you would for any table.

    (2), it depends. A caching table must have a primary key defined in TimesTen. This PK must map to either a real PK defined in Oracle (same column names, order of the columns, data types, nullability, etc..) or a unique index defined on a set of columns not null (column names of the soul, order of the columns, types of data etc.).

    Chris

  • HP 2000 model 2c32N4 main types of replacement for ABC etc.

    What are the main types of replacement for HP 2000 model 2c32N4?

    Part number:

    For use in the United States 698694-001

    On eBay:

    http://www.eBay.com/ITM/HP-Home-2000-239DX-2000-2A08DX-2000-2A18DX-2000-2A28DX-keyboard-698694-001-new-/321192859318?PT=PCA_Mice_Trackballs&hash=item4ac89616b6

    If it's 'the Answer' please click on 'Accept as Solution' to help others find it.

  • How do write an image bank 2d images using maton indexing or other type of indexation. Please help me, I'm stuck my project with this problem?

    Dear friends,

    I'm in a phase of my project of mtech evil. How can make a large image 2d draws from small images by indexing. (just like arrays\matrix, etc.). I have only 16 small images in my library. I want to do the big picture of mosaic of smaller images with appropriate indexing. I think to make a large image in Formate of table 2d (100 * 100 images) of small images using indexing. Anyone CAN HELP me IT WILL REALLY appreciable

    URS faithfully

    Ragil

    The question is more how you want that they be indexed like that?

    1 > 2 > 3 >... > 15 > 16 > 1 > 2...

    5>6>......

    or

    1 > 2 > 3 > 4 > 5

    2 > 3 > 4 > 5

    3 > 4 > 5

    4 > 5

    5

    or another type of indexing

  • My keyboard problem, do not let me type the accents for my french words

    My keyboard wouldn't let me type the accents for my french words, I'm sure my keyboard's NumLock mode.

    This happened after I pressed the shift key by accident (I think) more than 3 times. is there someone who can help me?

    Hello


    I've seen try pressing {CTRL + SHIFT} and try again.
    Let us know if it works. If this isn't the case, you may need to check in the international settings on the PC.
  • Find out how to type a letter for printing on my Dell Dimension E310 using Windows XP Home Edition

    Hi, I want to know how to start from home screen to type a letter for printing on my Dell Dimension E310 using Windows XP Home Edition... Thank you

    On Saturday, February 5, 2011 14:25:06 + 0000, Clinton Jones 1 wrote:

    Hi, I want to know how to start from home screen to type a letter for printing on my Dell Dimension E310 using Windows XP Home Edition... Thank you

    You type a letter in a word processing program (Microsoft Word, Corel
    WordPerfect, OpenOffice, etc.). Do you have a word processing program
    installed?

    If you have not installed Word processing program, you can use
    WordPad, which ships with Windows. But note that WordPad is a very
    primitive processing program (really more a glorified text)
    Editor in Chief) and gives you much less control over the formatting to a real
    processing.

    Ken Blake (MS-MVP)

  • Should what type of license for Windows I use for a company that will have a Web site?

    Hello

    Could you tell me please what type of license for Windows should I buy for a company that will have a Web site (without space)?

    I mentioned that I'll keep maintaining for her by a CMS, and I bought the hosting and domain.

    Forward to your response.

    Best regards

    F.

    • client Windows (for example, 7, 8, 8.1, 10) Limited has somewhere around 5 concurrent connections. and costs up to $300.
    • Server cost $1000-$1200 and comes with 5 licenses client [connection] or however any extra you pay.
    • You can configure a web server using this (local, apache already sets up LISTENING to hang on to all of the network adapters using the *-http://jesusnjim.com/web-design/setup-test-server.html)
  • How to print an index for a directory?

    original title: print the directory

    How to print an index for a directory?  At home I run Windows 7, but I really want to do this at work - OS is Vista Business

    You mean "how to print a list of the directories?
    http://www.Google.com/search?q=how+do+I+print+a+directory+listing

    How to add the feature print directory for files in Windows XP, Windows Vista, in Windows 7
    http://support.Microsoft.com/kb/321379

    HTH

Maybe you are looking for

  • How to delete recently deleted?

    I've looked everywhere but I don't see the button thing 'show recently deleted' on macbook pro retina in photos I don't know if it's gone or if theres a new way to do it. Thank you!

  • Satellite A110 - 228 LAN not working after hibernation

    Well, subject says it all, really. Network (wired) LAN does not work after hibernate. It seems that it cannot find the DHCP server, so after a while, he gets a 169.* address. After a reboot, the network works as usual (Gets an IP address from the DHC

  • Cannot install hard disk Portable Toshiba on HP20 - 2105A

    I bought a Toshiba 1 TB USB 3.0 portable hard drive (model No. DTB310) and when I plug the USB 3.0 cable, the computer shows that the folder is empty, i.e. There is no setup.exe file. I use a HP20 - 2105A with 8.1-64-bit Windows computer (bought in S

  • Stop: 0 x 00000124 (0x00000000, 0x86dbf1e4, 0xb200000, 0x00070f0f)

    Everyone knows this before stop code? My desktop computer running Windows 7 Pro will sometimes lock shortly after the start and usually will be OK after restarting it a 2nd or 3rd time and will remain OK for several days until I reboot again.  I thin

  • How to see several audio tracks?

    I have a mov file which has two tracks - music and a voice-over.  When I export PR it exports only the music.How can I get both channels to be seen and exported?(Ironically, Premiere CS3 shows all audio tracks, 2 channels stereo, default - no work re