Data deletion on primary index and secondary index

Hello, I have a question regarding data deletion in BDB-JE.
Suppose I have an Entity class which has a primary index and a secondary index, the secondary key does not have outer related entity. So when I want to delete this entity, is it correct we only need to remove the entity from primary index? or I also need to do it for secondary index or just remove it from secondary index and internally BDB_JE will remove it from primary index?
Thanks
Anfernee

You can delete an Entity using the delete method for primary index or the secondary index. When an entity is deleted, secondary index records are automatically deleted. The primary and secondary indices are always kept in sync.
--mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • Difference between primary eindex and secondary index?

    hi experts
    pls answer me
    difference between primary eindex and secondary index?
    rewads apply.
    thanks.
    naresh.

    hi,
    check this link.
    http://help.sap.com/saphelp_47x200/helpdata/en/cf/21eb2d446011d189700000e8322d00/frameset.htm
    A difference is made between Primary & Secondary indexes to a table. the primary index consists of the key fields of the table and a pointer to the non-keys-fields of the table. The Primary index is generated automatically when a table is created and is created in the datebase as the same times as the table. It is also possible to define further indexes to a table in the ABAP/4 dictionary, which are then referred to as Secondary indexes.
    Always it is not mandatory that an index should have all the key fields of a table. To see the index of a table
    goto SE11->specify table name->click on the indexes... button on the application toolbar.
    Based on your requirement you can you any of those index fields in the where clause of your query. Always its a better practice to use the index fields in the order specified. While selecting the records from a table it is always better to select the fields in the same order as specified in the table.

  • Primary index and secondary index in a select query

    Hii,
    How to use a primary or secondary  index in a select query?  How does this indexes actually work?
    Moderator message: please search for available information/documentation.
    Edited by: Thomas Zloch on Jan 21, 2012 8:38 PM

    rajan please just google or search SDN. there are large number of post for this..
    to give you a head start: for using a particular index in the select query a %_HINTS ORACLE 'INDEX clause is added

  • Identifying primery and secondary Indexes in ABAP Programs

    Hi all,
    i have used primary Index and Secondary Indexes in my ABAP program. my question is i want to identify Indexes which i used in my programs. how can i identify them? is there any method.tell me with great details.

    Switch on SQL trace (ST05), run the program, study the SQL trace.
    Thomas
    Good blog on the topic: The SQL Trace (ST05) – Quick and Easy

  • Access path difference between Primary Key and Unique Index

    Hi All,
    Is there any specific way the oracle optimizer treats Primary key and Unique index differently?
    Oracle Version
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE    11.2.0.3.0      Production
    TNS for IBM/AIX RISC System/6000: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
    SQL> Sample test data for Normal Index
    SQL> create table t_test_tab(col1 number, col2 number, col3 varchar2(12));
    Table created.
    SQL> create sequence seq_t_test_tab start with 1 increment by 1 ;
    Sequence created.
    SQL>  insert into t_test_tab select seq_t_test_tab.nextval, round(dbms_random.value(1,999)) , 'B'||round(dbms_random.value(1,50))||'A' from dual connect by level < 100000;
    99999 rows created.
    SQL> commit;
    Commit complete.
    SQL> exec dbms_stats.gather_table_stats(USER_OWNER','T_TEST_TAB',cascade => true);
    PL/SQL procedure successfully completed.
    SQL> select col1 from t_test_tab;
    99999 rows selected.
    Execution Plan
    Plan hash value: 1565504962
    | Id  | Operation         | Name       | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |            | 99999 |   488K|    74   (3)| 00:00:01 |
    |   1 |  TABLE ACCESS FULL| T_TEST_TAB | 99999 |   488K|    74   (3)| 00:00:01 |
    Statistics
              1  recursive calls
              0  db block gets
           6915  consistent gets
            259  physical reads
              0  redo size
        1829388  bytes sent via SQL*Net to client
          73850  bytes received via SQL*Net from client
           6668  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
          99999  rows processed
    SQL> create index idx_t_test_tab on t_test_tab(col1);
    Index created.
    SQL> exec dbms_stats.gather_table_stats('USER_OWNER','T_TEST_TAB',cascade => true);
    PL/SQL procedure successfully completed.
    SQL> select col1 from t_test_tab;
    99999 rows selected.
    Execution Plan
    Plan hash value: 1565504962
    | Id  | Operation         | Name       | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |            | 99999 |   488K|    74   (3)| 00:00:01 |
    |   1 |  TABLE ACCESS FULL| T_TEST_TAB | 99999 |   488K|    74   (3)| 00:00:01 |
    Statistics
              1  recursive calls
              0  db block gets
           6915  consistent gets
              0  physical reads
              0  redo size
        1829388  bytes sent via SQL*Net to client
          73850  bytes received via SQL*Net from client
           6668  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
          99999  rows processed
    SQL> Sample test data when using Primary Key
    SQL> create table t_test_tab1(col1 number, col2 number, col3 varchar2(12));
    Table created.
    SQL> create sequence seq_t_test_tab1 start with 1 increment by 1 ;
    Sequence created.
    SQL> insert into t_test_tab1 select seq_t_test_tab1.nextval, round(dbms_random.value(1,999)) , 'B'||round(dbms_random.value(1,50))||'A' from dual connect by level < 100000;
    99999 rows created.
    SQL> commit;
    Commit complete.
    SQL> exec dbms_stats.gather_table_stats('USER_OWNER','T_TEST_TAB1',cascade => true);
    PL/SQL procedure successfully completed.
    SQL> select col1 from t_test_tab1;
    99999 rows selected.
    Execution Plan
    Plan hash value: 1727568366
    | Id  | Operation         | Name        | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |             | 99999 |   488K|    74   (3)| 00:00:01 |
    |   1 |  TABLE ACCESS FULL| T_TEST_TAB1 | 99999 |   488K|    74   (3)| 00:00:01 |
    Statistics
              1  recursive calls
              0  db block gets
           6915  consistent gets
              0  physical reads
              0  redo size
        1829388  bytes sent via SQL*Net to client
          73850  bytes received via SQL*Net from client
           6668  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
          99999  rows processed
    SQL> alter table t_test_tab1 add constraint pk_t_test_tab1 primary key (col1);
    Table altered.
    SQL> exec dbms_stats.gather_table_stats('USER_OWNER','T_TEST_TAB1',cascade => true);
    PL/SQL procedure successfully completed.
    SQL> select col1 from t_test_tab1;
    99999 rows selected.
    Execution Plan
    Plan hash value: 2995826579
    | Id  | Operation            | Name           | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT     |                | 99999 |   488K|    59   (2)| 00:00:01 |
    |   1 |  INDEX FAST FULL SCAN| PK_T_TEST_TAB1 | 99999 |   488K|    59   (2)| 00:00:01 |
    Statistics
              1  recursive calls
              0  db block gets
           6867  consistent gets
              0  physical reads
              0  redo size
        1829388  bytes sent via SQL*Net to client
          73850  bytes received via SQL*Net from client
           6668  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
          99999  rows processed
    SQL> If you see here the even though statistics were gathered,
         * In the 1st table T_TEST_TAB, the table is still using FULL table access after creation of index.
         * And in the 2nd table T_TEST_TAB1, table is using PRIMARY KEY as expected.
    Any comments ??
    Regards,
    BPat

    Thanks.
    Yes, ignored the NOT NULL part.Did a test and now it is working as expected
    SQL>  create table t_test_tab(col1 number not null, col2 number, col3 varchar2(12));
    Table created.
    SQL>
    create sequence seq_t_test_tab start with 1 increment by 1 ;SQL>
    Sequence created.
    SQL> insert into t_test_tab select seq_t_test_tab.nextval, round(dbms_random.value(1,999)) , 'B'||round(dbms_random.value(1,50))||'A' from dual connect by level < 100000;
    99999 rows created.
    SQL> commit;
    Commit complete.
    SQL>  exec dbms_stats.gather_table_stats('GREP_OWNER','T_TEST_TAB',cascade => true);
    PL/SQL procedure successfully completed.
    SQL>  set autotrace traceonly
    SQL>  select col1 from t_test_tab;
    99999 rows selected.
    Execution Plan
    Plan hash value: 1565504962
    | Id  | Operation         | Name       | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |            | 99999 |   488K|    74   (3)| 00:00:01 |
    |   1 |  TABLE ACCESS FULL| T_TEST_TAB | 99999 |   488K|    74   (3)| 00:00:01 |
    Statistics
              1  recursive calls
              0  db block gets
           6912  consistent gets
              0  physical reads
              0  redo size
        1829388  bytes sent via SQL*Net to client
          73850  bytes received via SQL*Net from client
           6668  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
          99999  rows processed
    SQL>  create index idx_t_test_tab on t_test_tab(col1);
    Index created.
    SQL>  exec dbms_stats.gather_table_stats('GREP_OWNER','T_TEST_TAB',cascade => true);
    PL/SQL procedure successfully completed.
    SQL>  select col1 from t_test_tab;
    99999 rows selected.
    Execution Plan
    Plan hash value: 4115006285
    | Id  | Operation            | Name           | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT     |                | 99999 |   488K|    63   (2)| 00:00:01 |
    |   1 |  INDEX FAST FULL SCAN| IDX_T_TEST_TAB | 99999 |   488K|    63   (2)| 00:00:01 |
    Statistics
              1  recursive calls
              0  db block gets
           6881  consistent gets
              0  physical reads
              0  redo size
        1829388  bytes sent via SQL*Net to client
          73850  bytes received via SQL*Net from client
           6668  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
          99999  rows processed
    SQL>

  • Difference bet cube indexes and dso indexes

    hi,
    1.can any tell me the difference between cube indexes and dso indexes?
    if we have aggregates on the cube it improves the performce of the query created on it
    2.so why to create indexes on the cube?
    for creating indexes on the dso i right click on dso and click create indexes
    it is asking two options
    1.unique key 2.non unique
    4.what is the functionality of these two?
    i will assign points if ur answers clear my questions

    The BW automatically defines multiple indexes on your cubes, based on the dimensions you have defined.  You do not need to create any additional indexes on your Fact tables.  It can somtimes be helpful to create a secondary index on dimension tables or master data tables depending on their size and the queries.  There is not BW wkbench tool to do this, it usually requires a DBA in most shops.
    Secondary indexes on DSO/ODS can help some queries substantially, again, depending on the data and the queries.  You can define secondary indexes on DSO/ODS from the BW workbench.
    Aggregates are another tool for query performance, by summarizing the data, it can reduce the number of rows that must be read by a query.  Again, it dpends on the query and the data as to how much an aggregate helps.

  • CDS-18010 Error:A Index and a index with the same name

    Hi
    I am facing strange error is some one expert there to help me to get rid of this error.
    CDS-18010 Error:A Index and a index with the same name 'LA_SP_FK_1' have been asked to be created.
    I am generating tables from Data model diagram & getting this error.
    Thanks,
    Vijay

    Your Right!!
    Designer does not like 2 of the same name.
    there are several bugs on the same name issue and CDS-18010
    Bug.3973155/3443005 (92) CDS-18010 IN CAPTURING A TYPE WITH CONSTRUCTOR FUNTIONS IN ITS BODY:
    Bug.2586582 (93) CDS-18010 A DOMAIN AND A DOMAIN WITH THE SAME NAME 'D1' BEEN ASKED TO CREATE:
    Bug.2561625 (15) CDS-18010 GENERATION OF TWO SYNONYMS WITH SAME NAME BUT DIFFERENT SCOPE:
    Bug.2072505 (93) CDS-18010 CAPTURING 2 TRIGGERS WITH SAME NAME ON ONE TABLE SHOULD BE A WARNING:
    Bug.1689800 (90) CDS-18010 PLSQL WITH THE SAME PROCEDURE NAME ALREADY EXISTS:
    Bug.1073311/1029997 (96) CDS-18010 ERROR ATTEMPTING TO CREATE 2 PROCEDURES WITH SAME NAME:
    Just to name a few.
    I would suggest you change the name.
    Michael

  • JTable SelectionModel - first Index and Las Index giving incorrect values

    Hi Guys,
    When i added a ListSelectionListener to the JTable's selectionModel, and tried to get the first index and last index values. The goofy thing i noticed is when you select different rows, the indexes are correct,but when you switch between the same rows, then indexes provided by the ListSelectionListener are always the same. Example : if you switch between 3 and 4 rows first index is 2 and last index is 3 which is correct, but if you go back 3rd row from 4th row, the first index is still 2 and last index is 3... which is kind of weird.
    Any ideas about this, and why this is happenning.
    I am pasting my sample code here any explanation is very helpfull to understand this behavior
    Thanks
    Nicedude
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.JComponent;
    import javax.swing.ListSelectionModel;
    import javax.swing.event.ListSelectionEvent;
    import javax.swing.event.ListSelectionListener;
    import java.awt.Dimension;
    import java.awt.GridLayout;
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;
    * SimpleTableSelectionDemo is just like SimpleTableDemo,
    * except that it detects selections, printing information
    * about the current selection to standard output.
    public class SimpleTableSelectionDemo extends JPanel {
         private boolean DEBUG = false;
         private boolean ALLOW_COLUMN_SELECTION = false;
         private boolean ALLOW_ROW_SELECTION = true;
         public SimpleTableSelectionDemo() {
              super(new GridLayout(1,0));
              final String[] columnNames = {"First Name",
                        "Last Name",
                        "Sport",
                        "# of Years",
              "Vegetarian"};
              final Object[][] data = {
                        {"Mary", "Campione",
                             "Snowboarding", new Integer(5), new Boolean(false)},
                             {"Alison", "Huml",
                                  "Rowing", new Integer(3), new Boolean(true)},
                                  {"Kathy", "Walrath",
                                       "Knitting", new Integer(2), new Boolean(false)},
                                       {"Sharon", "Zakhour",
                                            "Speed reading", new Integer(20), new Boolean(true)},
                                            {"Philip", "Milne",
                                                 "Pool", new Integer(10), new Boolean(false)}
              final JTable table = new JTable(data, columnNames);
              table.setPreferredScrollableViewportSize(new Dimension(500, 70));
              table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
              if (ALLOW_ROW_SELECTION) { // true by default
                   ListSelectionModel rowSM = table.getSelectionModel();
                   rowSM.addListSelectionListener(new ListSelectionListener() {
                        public void valueChanged(ListSelectionEvent e) {
                             //Ignore extra messages.
                             if (e.getValueIsAdjusting()) return;
                             ListSelectionModel lsm = (ListSelectionModel)e.getSource();
                             if (lsm.isSelectionEmpty()) {
                                  System.out.println("No rows are selected.");
                             } else {
                                  int selectedRow = lsm.getMinSelectionIndex();
                             System.out.println("Row " + selectedRow + " is now selected.");
                                  int first = e.getFirstIndex();
                                                            int last = e.getLastIndex();
                              System.out.println(" First Index is : " + first);
                              System.out.println(" Last Index is : " + last );
              } else {
                   table.setRowSelectionAllowed(false);
              if (ALLOW_COLUMN_SELECTION) { // false by default
                   if (ALLOW_ROW_SELECTION) {
                        //We allow both row and column selection, which
                        //implies that we *really* want to allow individual
                        //cell selection.
                        table.setCellSelectionEnabled(true);
                   table.setColumnSelectionAllowed(true);
                   ListSelectionModel colSM =
                        table.getColumnModel().getSelectionModel();
                   colSM.addListSelectionListener(new ListSelectionListener() {
                        public void valueChanged(ListSelectionEvent e) {
                             //Ignore extra messages.
                             if (e.getValueIsAdjusting()) return;
                             ListSelectionModel lsm = (ListSelectionModel)e.getSource();
                             if (lsm.isSelectionEmpty()) {
                                  System.out.println("No columns are selected.");
                             } else {
                                  int selectedCol = lsm.getMinSelectionIndex();
                                  System.out.println("Column " + selectedCol
                                            + " is now selected.");
              if (DEBUG) {
                   table.addMouseListener(new MouseAdapter() {
                        public void mouseClicked(MouseEvent e) {
                             printDebugData(table);
              //Create the scroll pane and add the table to it.
              JScrollPane scrollPane = new JScrollPane(table);
              //Add the scroll pane to this panel.
              add(scrollPane);
         private void printDebugData(JTable table) {
              int numRows = table.getRowCount();
              int numCols = table.getColumnCount();
              javax.swing.table.TableModel model = table.getModel();
              System.out.println("Value of data: ");
              for (int i=0; i < numRows; i++) {
                   System.out.print("    row " + i + ":");
                   for (int j=0; j < numCols; j++) {
                        System.out.print("  " + model.getValueAt(i, j));
                   System.out.println();
              System.out.println("--------------------------");
          * Create the GUI and show it.  For thread safety,
          * this method should be invoked from the
          * event-dispatching thread.
         private static void createAndShowGUI() {
              //Make sure we have nice window decorations.
              JFrame.setDefaultLookAndFeelDecorated(true);
              //Create and set up the window.
              JFrame frame = new JFrame("SimpleTableSelectionDemo");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              //Create and set up the content pane.
              SimpleTableSelectionDemo newContentPane = new SimpleTableSelectionDemo();
              newContentPane.setOpaque(true); //content panes must be opaque
              frame.setContentPane(newContentPane);
              //Display the window.
              frame.pack();
              frame.setVisible(true);
         public static void main(String[] args) {
              //Schedule a job for the event-dispatching thread:
              //creating and showing this application's GUI.
              javax.swing.SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        createAndShowGUI();
    }

    >
    I was (maybe wrongly) under the impression that, last index will give the last selected value and first index will give me the currect selected value. Not maybe - your impression sure is wrong. Honestly can't understand how it's possible to mis-interpret the api doc of ListSelectionEvent (except not reading it ;-)
    "Represents a change in selection status between firstIndex and
    lastIndex, inclusive. firstIndex is less than or equal to
    lastIndex. The selection of at least one index within the range will
    have changed."
    Jeanette

  • How get column index and row index in gridpane of javafx

    how get column index and row index in gridpane of javafx. see the code below
    Text text1 = new Text("Text 1");
    Text text2 = new Text("Text 2");
    StackPane root = new StackPane();
    GridPane gridPane = new GridPane();
    gridPane.add(text1, 0, 0);
    gridPane.add(text2, 1, 0);
    When Mouse Entered On text1 i want to get the column index and row index of GridPane
    text1.setOnMouseEntered(new EventHandler<MouseEvent>() {
                @Override
                public void handle(MouseEvent e) {
                    //want to get column index =0 and row index=0
    Please let me know.

    Hi,
    If I remember well:
    [code]
    text1.setOnMouseEntered(new EventHandler<MouseEvent>() {
                @Override
                public void handle(MouseEvent e) {
                    //want to get column index =0 and row index=0
                    System.out.println("Column: " + GridPane.getColumnIndex(text1));
    [/code]
    -- daniel

  • Differences between function based index and normal index

    Hi,
    Please Give me some differences between function based index and normal indexes.
    1. Is there any performance gain in function based index?
    2. Why indexes created in DESC are treated as function based?
    3. Every DESC index is b-tree index?
    Thanks

    check this link. This would give u a basic idea of what a function based index is .
    http://www.oracle-base.com/articles/8i/FunctionBasedIndexes.php
    --Prasad                                                                                                                                                                                                                                                                                                                                       

  • How to combine spatial and secondary index, when extracting?

    Hi spatiallers,
    vers.: (32 bit) Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production on Sun/SunOS 5.8 (64 bit)
    In our DataWarehouse the table topo_geodata stores all topographic data in Denmark. The table has a spatial index (QT) on its SDO_geometry column named utm_geo as well as a primary key on the column topo_geo_id and 4 secondary indexes on other columns.
    The query to find all geomtries in a given munipalicy is as follows
    select count(*) as antal_AnyInteract_topo_geodata
    from topo_geodata k, topo_geodata tg
    where SDO_RELATE(tg.utm_geo, k.utm_geo, 'mask=AnyInteract querytype= WINDOW') = 'TRUE'
    and k.topo_geo_id = 961 -- geometry of a municipality
    and it returns a count of 19445 in 4 minuttes. However our users are only interested in extracting certain object types, that is a very small subselection of the 19445 geometries. The subselection is typically based on some value or a range of values in the secondary indexed columns.
    Question: How can I make the SELECT use a combination of the spatial index index and a secondary index?
    Only when a pinpoint 1 particular value of the primary key do I get fast response. When pinpointing 1 value in a secondary index as in
    select count(*) as antal1
    from topo_geodata k, topo_geodata tg
    where SDO_RELATE(tg.utm_geo, k.utm_geo, 'mask=AnyInteract querytype= WINDOW') = 'TRUE'
    and k.topo_geo_id = 961 -- Gladsaxe
    and tg.mtk_obj_id = 58476 -- has secondary index
    the performance deteriorates back to 4 min., and the queryplan shows some weird bitmap conversion followed by a bitmap-and operation.
    - Thanks in advance,
    Jens Ole Jensen
    Kort & MatrikelStyrelsen (WWW: http://www.kms.dk)
    Danmark

    Hi Jens,
    I'm not sure I understand the question, or what it is that works fast.
    In this case, the SDO_RELATE with the anyinteract mask has to be done first.
    If this takes 4 minutes, then adding additional criteria to reduce the amount of
    data returned from that subset will only add time.
    The spatial portion of the query has to be done using the spatial index, which is
    a monolithic index for the whole table, so all of the geometry data has to be searched,
    and the anyinteract applied to all of this data.
    After that set of rows comes back, then the additional predicate is applied.
    I'm not sure what this means:
    Only when a pinpoint 1 particular value of the primary key do I get fast response. You do have a few options to try to make things work faster:
    If queries included additional predicates on mtk_obj_id, you might try
    to use range partitioning.
    If the predicates on mtk_obj_id is very selective, then you might want to select
    values based on that column, then use sdo_geom.relate between that very
    small subset and the query window.
    Hope this helps, and all is well with you.
    Dan

  • Primary Barcode and Secondary Barcode

    Hi Experts ,
    Please let me know if its a good practice to have a Primary Barcode with with product number and a secondary barcode with fields of batch number,Expiration date and quantity in the product label.
    Also<b> i would like to know</b> if we need to have a <b>secondary barcode </b>if we have a Storage unit number Barcode on the pallet . Will the storage unit barcode give the information of materials or will the fields get populated in the RF device once we scan the SU barcode .
    If its possible to populate the fields (material number,batch,quantity and expiration date ) once we scan the SU Barcode then i ll just give a <b>proposal </b>to have only a primary barcode and a SU barcode.
    Your advise will be appreciated.
    Regards
    Albert.

    Then I'm going to stick with my original response.
    Looking at the documentation:
    http://www.oracle.com/pls/db102/print_hit_summary?search_string=%22secondary+index%22
    the term "secondary index" seems to be used primarily in conjunction with index-organised tables (where the primary key / primary index is part and parcel of the table) and with xpath.

  • Prefix Index and Substing Index not working

    Dear all,
    I'm trying to set the following preference to create my index:
    begin
    ctx_ddl.create_preference('substring_pref', 'BASIC_WORDLIST');
    ctx_ddl.set_attribute('substring_pref','PREFIX_INDEX','TRUE');
    ctx_ddl.set_attribute('substring_pref','PREFIX_MIN_LENGTH',3);
    ctx_ddl.set_attribute('substring_pref','PREFIX_MAX_LENGTH',15);
    ctx_ddl.set_attribute('substring_pref','SUBSTRING_INDEX','TRUE');
    end;
    create index artikel_test_idx
    on artikel_test (art_content)
    indextype is ctxsys.context
    parameters ( 'WORDLIST substring_pref' )
    The index is created sucessfully.
    Here is the data I have in my table:
    ART_INHOUD ART_TITEL ART_CONTENT
    1 Titel1 prion alzheimer
    2 Titel2 prion word1 alzheimer
    3 Titel3 prion word2 word3 alzheimer
    4 Titel4 prion
    5 Titel5 alzheimer
    6 Titel6 alzheimer prion
    7 Titel7 alzheimer word1 prion
    8 Titel8 something else
    9 Titel9 prion alzheimer prion alzheimer
    10 Title10 i am theree
    11 Title11 contract initiation work
    12 Title12 oracle university else
    12 rows selected.
    I test the substring feature by searching for "alz". It should returns me all lines that contains "alzheimer". Am I right? But the result show nothing:
    select art_titel, score(1) as score
    from artikel_test
    where contains (art_content, 'alz', 1) > 0
    no rows selected
    If I search for the entire word, it works:
    select art_titel, score(1) as score
    from artikel_test
    where contains (art_content, 'alzheimer', 1) > 0;
    ART_TITEL SCORE
    Titel9 7
    Titel7 4
    Titel6 4
    Titel5 4
    Titel3 4
    Titel2 4
    Titel1 4
    7 rows selected.
    I look at the table DR$ARTIKEL_TEST_IDX$I and all works are in it:
    TOKEN_TEXT
    ALZ
    ALZH
    ALZHE
    ALZHEI
    ALZHEIM
    ALZHEIME
    ALZHEIMER
    ALZHEIMER
    AM
    CON
    CONT
    CONTR
    CONTRA
    CONTRAC
    CONTRACT
    CONTRACT
    Why there is no result when I search for 'alz'?
    Regards,
    Yanick
    Message was edited by:
    yankee75

    The prefix_index and substring_index do not make the substrings searchable as individual words. They just speed up wildcard queries. If you search for "alt" you will only get rows that have the word "alt" in it. If you search for "alt%" you will get all rows that contain words that begin with "alt". Here are some quotes from the Oracle Text Reference, which is part of the Oracle online documentation:
    "substring_index      Specify TRUE for Oracle Text to create a substring index. A substring index improves left-truncated and double-truncated wildcard queries such as %ing or %benz%. Default is FALSE."
    "prefix_index      Specify TRUE to enable prefix indexing. Prefix indexing improves performance for right truncated wildcard searches such as TO%. Defaults to FALSE."

  • What is the difference between the drop and create the index and rebuild index ?

    Hi All,
    what is the difference between drop and create index & rebuild index ? i think both are same...Please clarify if both are same or any difference...
    Thanks in Advance,
    rup

    Both are same. Rebuilding an index drops and re-creates the index. 
    Ref:
    SSMS - https://technet.microsoft.com/en-us/library/ms187874(v=sql.105).aspx
    TSQL - https://msdn.microsoft.com/en-us/library/ms188388.aspx
    I would suggest you to also refer one of the best index maintenance script as below:
    https://ola.hallengren.com/sql-server-index-and-statistics-maintenance.html

  • Can I have a primary email and secondary email on my ipad

    How do I set-up a primary email and a secondary email on my new ipad?

    If the primary email is my apple ID connected with an icloud account will the secondary apple email account also allow file pictures and itunes from the new ipad into the original icloud account. Confused. Maybe my ipad should just have a separate account

Maybe you are looking for

  • How can I get the audio only from a home made video

    I have several home videos saved on my iPhone and I am wondering if I can get the audio off of the videos to make an audio CD. I have a PC. Windows 7

  • ClickListener in ADF Line graph

    Hello, Is it possible to get the x-axis and y-axis values (i.e.coordinates) of the line graph if user clicks in a line area between points (not the point itself)? I can get the x-axis and y-axis values if I click on point in a line as follows:     pu

  • Finished FCP file too big to burn and quality is needed.. Please helpp me

    I've just completed a 40 minute project that i've been working on for months on Final Cut Pro 5.1.4. I exported it as a Quicktime movie and the finished product is 8.8 GIGS. I have both iDVD and Toast, and have tried for the last two days straight to

  • Bug in developer

    1. if we select value from list item by mouse and after selection .press enter. NOTHING HAPPEN CURSOR STILL ON LIST ITEM. whats the reason? is it bug? (use tab or mouse to move to another field.why not enter. ) 2.in tabular forms you will copy a valu

  • THIS CURRENTLY POSSIBLE?? - Displaying multiple psd inside editor??

    Not sure how well I can explain this. This is an idea that I would THINK photoshop would have but perhaps I am not aware and have been doing this the HARD way?? * Let's say I am creating a website template which usually consists of a HEADER, FOOTER,