Full-text query performance

Consider a table (textable) with at least 2 fields.
1 field docid is long and is indexed. It is not unique.
Textclob field 2 is a Clob and contains text.


Queries

Select * from textable where contains (textclob, "DOG") > 0;

and

Select * from textable where docid = 12345 and contains (textclob, "DOG") > 0;

both take the same time to run even if first of all to limit the query to the docid relevatn will reduce the necessary lines text search
by orders of magnitude

How to evaluate the docid where before you start searching for the query text

You cannot create an index on a long data type, so I don't know what makes you think that the long column is indexed. Long columns are deprecated. For most of the things the long columns were used for, you must now use a clob column instead. For a digital ID column, you must use a number data type, which can then indexed. You must have current statistics so that the optimizer to choose the best execution plan. You can use dbms_stats.gather_table_stats to obtain these statistics, after having inserted your data and created your index. It is possible to use views inline and the index indicators, etc. to influence the optimizer, but generally the optimizer knows best.

In the example below, I made the docid one column type data number, inserted enough data for testing, created the index on two columns, allowing you to collect statistics, set the timing and autotrace on dbms_stats.gather_table_stats, ran both queries and the second ran faster, query using the index on the docid column first then the index on the textclob column.

SCOTT@orcl_11gR2> alter system flush shared_pool
  2  /

System altered.

SCOTT@orcl_11gR2> create table textable
  2    (docid       number,
  3       textclob  Clob)
  4  /

Table created.

SCOTT@orcl_11gR2> insert into textable values (12345, 'DOG')
  2  /

1 row created.

SCOTT@orcl_11gR2> insert into textable
  2  select object_id, object_name
  3  from   all_objects
  4  /

75596 rows created.

SCOTT@orcl_11gR2> create index textable_docid_idx
  2  on textable (docid)
  3  /

Index created.

SCOTT@orcl_11gR2> create index textable_textclob_idx
  2  on textable (textclob)
  3  indextype is ctxsys.context
  4  /

Index created.

SCOTT@orcl_11gR2> exec dbms_stats.gather_table_stats (user, 'TEXTABLE')

PL/SQL procedure successfully completed.

SCOTT@orcl_11gR2> set timing on
SCOTT@orcl_11gR2> set autotrace on explain
SCOTT@orcl_11gR2> Select * from textable where contains(textclob, 'DOG') >0
  2  /

     DOCID
----------
TEXTCLOB
------------------------------------------------------------------------------------------------------------------------
     12345
DOG

1 row selected.

Elapsed: 00:00:00.11

Execution Plan
----------------------------------------------------------
Plan hash value: 2944576608

-----------------------------------------------------------------------------------------------------
| Id  | Operation                   | Name                  | Rows  | Bytes | Cost (%CPU)| Time     |
-----------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT            |                       |     1 |   155 |     0   (0)| 00:00:01 |
|   1 |  TABLE ACCESS BY INDEX ROWID| TEXTABLE              |     1 |   155 |     0   (0)| 00:00:01 |
|*  2 |   DOMAIN INDEX              | TEXTABLE_TEXTCLOB_IDX |       |       |     0   (0)| 00:00:01 |
-----------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - access("CTXSYS"."CONTAINS"("TEXTCLOB",'DOG')>0)

SCOTT@orcl_11gR2> Select * from textable where docid = 12345 and contains(textclob, 'DOG') >0
  2  /

     DOCID
----------
TEXTCLOB
------------------------------------------------------------------------------------------------------------------------
     12345
DOG

1 row selected.

Elapsed: 00:00:00.01

Execution Plan
----------------------------------------------------------
Plan hash value: 566902540

----------------------------------------------------------------------------------------------------------
| Id  | Operation                        | Name                  | Rows  | Bytes | Cost (%CPU)| Time     |
----------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                 |                       |     1 |   155 |     1   (0)| 00:00:01 |
|   1 |  TABLE ACCESS BY INDEX ROWID     | TEXTABLE              |     1 |   155 |     1   (0)| 00:00:01 |
|   2 |   BITMAP CONVERSION TO ROWIDS    |                       |       |       |            |          |
|   3 |    BITMAP AND                    |                       |       |       |            |          |
|   4 |     BITMAP CONVERSION FROM ROWIDS|                       |       |       |            |          |
|   5 |      SORT ORDER BY               |                       |       |       |            |          |
|*  6 |       DOMAIN INDEX               | TEXTABLE_TEXTCLOB_IDX |     1 |       |     0   (0)| 00:00:01 |
|   7 |     BITMAP CONVERSION FROM ROWIDS|                       |       |       |            |          |
|*  8 |      INDEX RANGE SCAN            | TEXTABLE_DOCID_IDX    |     1 |       |     1   (0)| 00:00:01 |
----------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   6 - access("CTXSYS"."CONTAINS"("TEXTCLOB",'DOG')>0)
   8 - access("DOCID"=12345)

SCOTT@orcl_11gR2>

Tags: Database

Similar Questions

  • CIS - how to make a java using CIS full text search

    Hello

    I installed CIS CIS - admin - Server on the OC4J instance and configured an adapter for UCM. I am able to access the CIS GUI and retrieve documents using controls browse-> Active-> research methods.

    From there, I'm able to run queries like dDocTitle < match > "report". I get the correct results.

    I need to do a search of text here. Is there a method that supports research in full text from here?

    From my Java code I am able to get the results of queries like above. When I try to give a setting of text like "XYZ" instead of the query text search, it's during extraction all documents available in the content server. I'm facing the same problem of GUI of CIS, when I give a text like "XYZ" search in the query text field, he's back all the documents in the content server.

    I enabled the search in full text on AAU and it works fine. Takes a string and the text search research 2 docs back to the Complutense University of MADRID. The string even when I used it with the GUI of CIS or Java Code is back total documents at the Complutense University of MADRID.
    -Class type for the parameter name
    Search ISCSSearchResponse SCSContext com.stellent.cis.client.api.scs.context.ISCSContext
    -searchQuery com.stellent.cis.client.api.scs.search.ISCSSearchQuery


    -Class type for the parameter name
    Search ISCSSearchResponse SCSContext com.stellent.cis.client.api.scs.context.ISCSContext
    -queryText java.lang.String
    -resultCount int


    These two methods are return total number of documents HTML in Complutense University of MADRID when the fulltext search passed as parameter for argument in bold above.

    Plese help me.
    Thank you

    Hi Agnes,.

    Do a full-text query using the syntax of Verity by CIS what you need to do is place your string in .

    For example: test dDocTitle 'test '.

    Hope that helps,

    Andy Weaver - Senior Consultant software
    Fishbowl Solutions< http://www.fishbowlsolutions.com?wt.mc_id="L_Oracle_Consulting_amw">

    Published by: Andy Weaver on May 21, 2009 10:50

  • Full text search

    I use the specific to Oracle orardf:textContains function of FILTER of SPARQL to search for full text on the MDSYS. Table RDF_VALUE of $.

    Following the space and RDF graph semantic graph 12 c Developer's Guide to creating the index:

    EXECUTE SEM_APIS.ADD_DATATYPE_INDEX('http://xmlns.oracle.com/rdf/text');

    It works as expected, but I would like to be able to perform searches "accents". I found that when you create the index with 'CREATE INDEX', a custom lexer can be passed in parameters. Something like that:

    BEGIN
    CTX_DDL.create_preference( 'my_lexer', 'BASIC_LEXER');
    CTX_DDL.set_attribute('my_lexer', 'BASE_LETTER', 'true');
    CTX_DDL.set_attribute('my_lexer', 'OVERRIDE_BASE_LETTER', 'true');
    END;
    /
    
    CREATE INDEX my_index on TABLE (COLUMN)
      indextype is ctxsys.context
      parameters ( 'LEXER my_lexer' );
    
    

    I can't understand how to get the same result when the index was created with 'SEM_APIS.» ADD_DATATYPE_INDEX".» Is this possible?


    Thank you

    Hello

    This customization is not supported through add_datatype_index, but you can directly create a text index on MDSYS. RDF_VALUE$ and the use with orardf:textContains in SPARQL queries. In other words, you don't have to go through add_datatype_index to create the index. As long as VNAME_PREFIX is included in the set of columns that are indexed, then orardf:textContains should work.

    For example:

    SQL > create index mdsys.rdf_v$ text_idx on mdsys.rdf_value$ (vname_prefix) indextype is ctxsys.context;

    The index is created.

    SQL > select s, o

    table (sem_match)

    "SELECT? s? o

    "WHERE {? s rdfs:label? o FILTER (orardf:textContains(?o,_"New_York"))}"

    sem_models ('lgd_historic'),

    null, null, null, null

    ,' '));

    2 3 4 5 6 7

    S

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

    O

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

    http://LinkedGeoData.org/triplify/node358960285

    25 New York Volunteer Cavelry Monument

    http://LinkedGeoData.org/triplify/node879249295

    Regiment of New York

    http://LinkedGeoData.org/triplify/node358239660

    New York State Monument

    http://LinkedGeoData.org/triplify/node1251645997

    New York Life Insurance Company War Memorial

    http://LinkedGeoData.org/triplify/node1242148250

    New York Viet Nam Veterans Memorial

    http://LinkedGeoData.org/triplify/node2971826546

    Glocke aus New York

    http://LinkedGeoData.org/triplify/node358960283

    122nd voluntary Mounment in New York

    http://LinkedGeoData.org/triplify/node1040277511

    New York State Viet Nam War Memorial

    http://LinkedGeoData.org/triplify/node1251645998

    Memorial of the New York Life Insurance Company

    http://LinkedGeoData.org/triplify/node427545363

    New York Central Roundhouse

    10 selected lines.

    SQL >

    Hope this helps,

    -Matt

  • Unable to see the full text of SQL in the sessions of the monitor

    Hi guys,.

    I use SQL Developer 3.2 and when I followed sessions.

    I'm unable to see the full text of sql. Can someone guide me what setting do I do to see the full text of sql.

    Thank you

    Deepak

    you do not see the full text of design, this data dictionary that col stores only the first 1000 characters of the query

    You can Customize this report to get the full text if you wish... just read the column full_text instead, which is a CLOB

    in fact, this is the story in v3.2 - If you upgrade to version 4.0, we wonder SQL_FULLTEXT, and also make it more enjoyable to read code, throwing in a code editor

  • How to add the default value for the "Full - Text Search" box

    Hi all

    I am looking for the ability to add a default value for the "Full text search" box in the search form.

    Example:

    When the user accesses the search page it get default values for some fields (defined in the rule as default values) such as

    xField1 = txt1 and xFiel2 = txt2.

    and Furthermore we need full-text = Hello world.

    Is this possible?

    Another way that we use is to open the search by URL with coreContentOnly = 1 as a form:

    http:// < Server >/cs/idcplg? IdcService = GET_DOC_PAGE & to Action = GetTemplatePage & to Page = STANDARD_QUERY_PAGE & coreContentOnly = 1 & to xField1 = txt1 & to xFiel2 = txt2

    It is possible to add full-text criteria here? Somethig like: & text = Hello World

    Thank you

    Leon

    It is not possible in a very obvious way, not to mention that it is a rather strange request.  I can't really imagine a realistic use for this case.

    Anyway, without a messy customization, you should provide a default query with an FTX inside element text setting (i.e. "IdcService = GET_DOC_PAGE & Action = GetTemplatePage & Page = STANDARD_QUERY_PAGE & QueryText =Hello World" "")

    To do this in a profile in the secondary effects of the profile section, add the following:

    <$dpPromote("QueryText",>Hello everyone") $>.

  • Query performance

    CURSOR c_exercise_list IS
           SELECT
                  DECODE(v_mfd_mask_id ,'Y',' ',o.opt_id) opt_id,
                  DECODE(v_mfd_mask_id ,'Y',' ',o.soc_sec) soc_sec,
                  P.plan_id plan_id, E.exer_id exer_id, E.exer_num,
                  DECODE(G.sar_flag, 0, DECODE(G.plan_type, 0, '1', 1, '2', 2, '3', 3, ' ', 4,'5', 5, '6', 6, '7', 7, '8', 8, '9', '0'), ' ') option_type,
                  TO_CHAR(G.grant_dt, 'YYYYMMDD') grant_dt, TO_CHAR(E.exer_dt, 'YYYYMMDD') exer_dt,
                  E.opts_exer opts_exer,
                  E.mkt_prc   mkt_prc,
                  E.swap_prc  swap_prc,
                  E.shrs_swap shrs_swap, decode(e.exer_type,2,decode(xe.cash_partial,'Y','A','2'),TO_CHAR(E.exer_type)) exer_type,
                  E.sar_shrs  sar_shrs,
                  NVL(ROUND(((xe.sar_shrs_withld_optcost - (e.opts_exer * g.opt_prc) / e.mkt_prc) * e.mkt_prc),2),0)+e.sar_cash sar_cash,
                  NVL(f.fixed_fee1,0) fixed_fee1,
                  NVL(f.fixed_fee2,0) fixed_fee2,
                  NVL(f.fixed_fee3,0) fixed_fee3,
                  NVL(f.commission,0) commission,
                  NVL(f.sec_fee,0)    sec_fee,
                  NVL(f.fees_paid,0)  fees_paid,
                  NVL(ct.amount,0)     cash_tend,
                  E.shrs_tend  shrs_tend, G.grant_id grant_id, NVL(G.grant_cd, ' ') grant_cd,
                  NVL(xg.child_symbol,' ') child_symbol,
                  NVL(xg.opt_gain_deferred_flag,'N') defer_flag,
                  o.opt_num opt_num,
                  --XO.new_ssn,
                  DECODE(v_mfd_mask_id ,'Y',' ',xo.new_ssn) new_ssn,
                          xo.use_new_ssn
                  ,xo.tax_verification_eligible tax_verification_eligible
                  ,(SELECT TO_CHAR(MIN(settle_dt),'YYYYMMDD') FROM tb_ml_exer_upload WHERE exer_num = E.exer_num AND user_id=E.user_id AND NVL(settle_dt,TO_DATE('19000101','YYYYMMDD'))>=E.exer_dt) AS settle_dt
                  ,xe.rsu_type  AS rsu_type
                  ,xe.trfbl_det_name AS trfbl_det_name
                  ,o.user_txt1,o.user_txt2,xo.user_txt3,xo.user_txt4,xo.user_txt5,xo.user_txt6,xo.user_txt7
                  ,xo.user_txt8,xo.user_txt9,xo.user_txt10,xo.user_txt11,
                  xo.user_txt12,
                  xo.user_txt13,
                  xo.user_txt14,
                  xo.user_txt15,
                  xo.user_txt16,
                  xo.user_txt17,
                  xo.user_txt18,
                  xo.user_txt19,
                  xo.user_txt20,
                  xo.user_txt21,
                  xo.user_txt22,
                  xo.user_txt23,
                  xo.user_dt2,
                  xo.adj_dt_hire_vt_svc,
                  xo.adj_dt_hire_vt_svc_or,
                  xo.adj_dt_hire_vt_svc_or_dt,
                  xo.severance_plan_code,
                  xo.severance_begin_dt,
                  xo.severance_end_dt,
                  xo.retirement_bridging_dt
                  ,NVL(xg.pu_var_price ,0) v_pu_var_price
                  ,NVL(xe.ficamed_override,'N') v_ficmd_ovrride
                  ,NVL(xe.vest_shrs,0) v_vest_shrs
                  ,NVL(xe.client_exer_id,' ') v_client_exer_id
                  ,(CASE WHEN xg.re_tax_flag = 'Y' THEN pk_xop_reg_outbound.Fn_GetRETaxesWithheld(g.grant_num, E.exer_num, g.plan_type)
                         ELSE 'N'
                     END) re_tax_indicator -- 1.5V
                  ,xe.je_bypass_flag
                  ,xe.sar_shrs_withld_taxes   --Added for SAR july 2010 release
                  ,xe.sar_shrs_withld_optcost --Added for SAR july 2010 release
            FROM
            (SELECT exer.* FROM exercise exer WHERE NOT EXISTS (SELECT s.exer_num FROM suspense s
                WHERE s.exer_num = exer.exer_num AND s.user_id = exer.user_id AND exer.mkt_prc = 0))E,
                grantz G,  xop_grantz xg, optionee o, xop_optionee xo, feeschgd f, cashtendered ct, planz P,xop_exercise xe
            WHERE
                  E.grant_num  = G.grant_num
            AND   E.user_id    = G.user_id
            AND   E.opt_num    = o.opt_num
            AND   E.user_id    = o.user_id
            AND   (G.grant_num = xg.grant_num(+) AND G.user_id=xg.user_id(+))
            AND   (o.opt_num   = xo.opt_num(+)   AND o.user_id=xo.user_id(+))
            AND   E.plan_num = P.plan_num
            AND   E.user_id = P.user_id
            AND   E.exer_num = f.exer_num(+)
            AND   E.user_id = ct.user_id(+)
            AND   E.exer_num = ct.exer_num(+)
            AND   E.user_id = ct.user_id(+)
            AND   E.exer_num=xe.exer_num(+)
            AND   E.user_id=xe.user_id(+)
            AND   G.user_id = USER
            AND NOT EXISTS (
                        SELECT tv.exer_num
                          FROM tb_xop_tax_verification tv--,exercise ex
                         WHERE tv.exer_num = e.exer_num
                           AND tv.user_id = e.user_id
                           AND tv.user_id = v_cms_user
                           AND tv.status_flag IN (0,1,3,4, 5)) -- Not Processed
            ;
    How to tune the query performance, any1 help me to impropve... Thanks in advance

    Published by: BluShadow on February 21, 2013 08:14
    corrected {noformat}
    {noformat} tags. Please read {message:id=9360002} and learn how to post code correctly.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                

    956684 wrote:
    I got the cost of CPU: 458.50 time: 1542.90 therefore anything can capture to improve performance, but there is no applied full table scan to put nothing in the mentioned table. . and most of the columns are index unique scan takes place... someone can help me to find the solution

    His request as "my car doesn't work, care color is gray. Can solve you this problem? »

    Please read the FAQ, I already posted and follow the instructions.

  • can I get the full text of sql from aud$ data table

    Hi gems... good afternoon...

    We try to understand the name of the tables and actions associated with their subject (select, insert, update, delete) what we will do with our application.
    So I enabled the audit parameter audit_trail = db, extended. After that I can get the records required of the dba_audit_trail_view by the following query:
    select d.entryid, d.timestamp, d.obj_name, d.action_name, d.sql_text
    from dba_audit_trail d 
    where d.username='TEST_SCHEMA'
    and d.obj_name not like '%$%'
    and d.obj_name not in ('_CURRENT_EDITION_OBJ','ALL_OBJECTS','_ACTUAL_EDITION_OBJ','ALL_SYNONYMS','_ALL_SYNONYMS_TREE',
    '_ALL_SYNONYMS_FOR_AUTH_OBJECTS','_ALL_SYNONYMS_FOR_SYNONYMS','ALL_SYNONYMS','DBA_SYNONYMS','PLSQLDEV_AUTHORIZATION',
    'USER_OBJECTS','_ALL_SYNONYMS_FOR_AUTH_OBJECTS','DUAL','_BASE_USER','ALL_TAB_COLUMNS','ALL_COL_COMMENTS','ALL_TAB_COLS',
    'NLS_DATABASE_PARAMETERS','ALL_SOURCE','ALL_ERRORS')
    order by d.timestamp desc;
    I'm satisfactory output by that. But the problem is that some of the requests in hibernation is too large (maybe 10000 characters... "I'm not sure), these queries do not come completely. This is why I don't get some important information such as the WHERE the FROM clause condition, etc.
    There is no sql_id column in the table of $ aud.

    Is it possible to get the full text of sql... Please help...

    for this view sql_text column is different... try column sql_text a60000 and answer format which is the result

  • on the full-text index

    Hi Experts,

    My client 2 issues that I am not clear about the answer, could you give me a tip?

    This client uses ECM11.1.1.1.5 with text oracle as full text index engine, the questions are:
    1. is it possible to build indexes full text at a later rather than building when the consignment of a doc? for example, the user checkin a doc in ecm, at that time, ecm does not full text index, in the night, we use the api / script to build the full text for new documents created.
    2. it takes 15 s consignment to a word file of 50 m in ecm, with or without construction of full text index, we use MaxIndexableFileSize in config.cfg to the control's text index full is built for the 50 M word file, the client wonder with a bandwidth of 200 K between the server of the University Complutense of Madrid and ucm db why there is no latency performance for the construction of the full text, by a common index, ucm will send the text in doc ucm DB file to generate full text indexes, in this file of Word of 50 m, we appear 9 of 10 text pages, admittedly, most of the content is repeatable.

    Best regards

    LAN

    A story behind this request is the customer has a slow network between the server of the University Complutense of Madrid and db of the Complutense University of Madrid, it is 200Kbit/s, customer wants to improve the speed of creation of doc, so asked me to do a test of performance for the delayed construction of fulltext index.

    If you know what the problem is, it would be more logical to put the efforts to solve the cause, rather than a clumsy workaround solution.

    Your other questions, read the Metalink Note 865713.1 as he explains how database. FULL-text indexing jobs. "Offshoring" indexing to ITS could solve the problem, but I just don't believe it is - also note that even if you find a workaround for "creation of doc" solution, you will have to deal with the problem, every time that you press on the database, so sooner or later it will appear somewhere else.

  • JavaHelp full text search does not work

    I create a project of JavaHelp with 8 HR and have the option of full text search introduced on the market. However, when I run the project and try to use the search function, the hourglass appears and the search is not performed.

    Marion

    I solved the problem!

    Research couldn't perform because HR not create JavaHelpSearch files on my system. I have not found the reason why, but I solved the problem by a work around with a batch file that is bound to the jhindexer. After generating all help I create JavaHelpSearch files using this batch file.

    Thanks to Pierre for his information on his page for JavaHelp. I already knew this page before, when you search for information on javahelp.

    If you have problems with the javahelp you will also find useful information on the website javahelp.java.net/ and in the javahelp http://download.java.net/javadesktop/javahelp/jhug.pdftutorial.

    Marion

  • Query performance poor when they join CONTAINS to another table

    We just recently started evaluation Oracle Text for a search solution. We must be able to find a table which can have over 20 million lines. Each user can have visibility to a very small part of these lines. The goal is to have a single Oracle text index that represents all the columns of research in the table (multi column datastore) and provide a score for each search result so that we can sort the search results in descending score order. What we see is that the performance of the queries of TOAD are extremely fast, when we write a simple CONTAINS query against the table indexed Oracle text. However, when we first try reduce the lines from that CONTAINS query must search using a we find the query performance degrades significantly.

    For example, we can find all the records that a user has access from our base table of the following query:

    SELECT d.duns_loc
    DUNS d
    JOIN primary_contact pc
    ON d.duns_loc = pc.duns_loc
    AND pc.emp_id =: employeeID;

    This query may run in < 100 m in the example, this query returns close to 1200 lines of the duns_loc of primary key.

    Our search query looks like this:

    SELECT score (1), d.
    DUNS d
    WHERE CONTAINS (TEXT_KEY,: research, 1) > 0
    ORDER BY score (1) DESC;

    The: Find value in this example will be 'Highway '. The query can return 246 k lines in about 2 seconds.

    2 seconds is good, but we should be able to have a much quicker response if the request did not have to search the entire table, right? Since each user can only records from 'view' that they are assigned to as us if the search operation had to be analysed a tiny tiny percentage of the TEXT index, we should see results faster (and more relevant). If we now write the following query:

    WITH the subset
    AS
    (SELECT d.duns_loc
    DUNS d
    JOIN primary_contact pc
    ON d.duns_loc = pc.duns_loc
    AND pc.emp_id =: employeeID
    )
    SELECT score (1), d.
    DUNS d
    JOIN the subset s
    ON d.duns_loc = s.duns_loc
    WHERE CONTAINS (TEXT_KEY,: research, 1) > 0
    ORDER BY score (1) DESC;

    For reasons that we have not been able to identify this query actually takes longer to run than the sum times the contributing elements. This query takes more than 6 seconds to run. We, or our DBA can understand why this query runs worse than a large open research. Open research is not ideal because the query eventually folders back to the user, they do not have access to view.

    Has anyone ever encountered something like that? Any suggestions on what to watch or where to go? If someone wants more information to help diagnosis to let me know, and I'll be happy to produce it here.

    Thank you!!

    Since you're using two tables, you will get probably better performance on an index that uses a section group and a user_datastore that uses a procedure. He should be able to recover all the data with a simple query, and hit a single index. Please see the demo below. Indexing can be slower, but research should be faster. If you have your primary and foreign keys in place and current statistics before you create the index, it should speed up indexing.

    SCOTT@orcl_11gR2> -- tables:
    SCOTT@orcl_11gR2> CREATE TABLE duns
      2    (duns_loc       NUMBER,
      3       business_name  VARCHAR2 (15),
      4       business_name2 VARCHAR2 (15),
      5       address_line   VARCHAR2 (30),
      6       city            VARCHAR2 (15),
      7       state            VARCHAR2 (2),
      8       business_phone VARCHAR2 (15),
      9       contact_name   VARCHAR2 (15),
     10       contact_title  VARCHAR2 (15),
     11       text_key       VARCHAR2 (1),
     12       CONSTRAINT     duns_pk PRIMARY KEY (duns_loc))
     13  /
    
    Table created.
    
    SCOTT@orcl_11gR2> CREATE TABLE primary_contact
      2    (duns_loc       NUMBER,
      3       emp_id            NUMBER,
      4       CONSTRAINT     primary_contact_pk
      5                   PRIMARY KEY (emp_id, duns_loc),
      6       CONSTRAINT     primary_contact_fk FOREIGN KEY (duns_loc)
      7                   REFERENCES duns (duns_loc))
      8  /
    
    Table created.
    
    SCOTT@orcl_11gR2> -- data:
    SCOTT@orcl_11gR2> INSERT INTO duns (duns_loc, address_line) VALUES (1, 'highway')
      2  /
    
    1 row created.
    
    SCOTT@orcl_11gR2> INSERT INTO duns (duns_loc, address_line) VALUES (2, 'highway')
      2  /
    
    1 row created.
    
    SCOTT@orcl_11gR2> INSERT INTO primary_contact VALUES (1, 1)
      2  /
    
    1 row created.
    
    SCOTT@orcl_11gR2> INSERT INTO primary_contact VALUES (2, 2)
      2  /
    
    1 row created.
    
    SCOTT@orcl_11gR2> INSERT INTO duns (duns_loc, address_line)
      2  SELECT object_id, object_name
      3  FROM   all_objects
      4  WHERE  object_id > 2
      5  /
    
    76029 rows created.
    
    SCOTT@orcl_11gR2> INSERT INTO primary_contact
      2  SELECT object_id, namespace
      3  FROM   all_objects
      4  WHERE  object_id > 2
      5  /
    
    76029 rows created.
    
    SCOTT@orcl_11gR2> -- gather statistics:
    SCOTT@orcl_11gR2> EXEC DBMS_STATS.GATHER_TABLE_STATS (USER, 'DUNS')
    
    PL/SQL procedure successfully completed.
    
    SCOTT@orcl_11gR2> EXEC DBMS_STATS.GATHER_TABLE_STATS (USER, 'PRIMARY_CONTACT')
    
    PL/SQL procedure successfully completed.
    
    SCOTT@orcl_11gR2> -- procedure:
    SCOTT@orcl_11gR2> CREATE OR REPLACE PROCEDURE duns_proc
      2    (p_rowid IN ROWID,
      3       p_clob     IN OUT NOCOPY CLOB)
      4  AS
      5  BEGIN
      6    FOR d IN
      7        (SELECT duns_loc,
      8             '' ||
      9             business_name     || ' ' ||
     10             business_name2  || ' ' ||
     11             address_line  || ' ' ||
     12             city  || ' ' ||
     13             state     || ' ' ||
     14             business_phone  || ' ' ||
     15             contact_name  || ' ' ||
     16             contact_title ||
     17             ''
     18             AS duns_cols
     19         FROM      duns
     20         WHERE  ROWID = p_rowid)
     21    LOOP
     22        DBMS_LOB.WRITEAPPEND (p_clob, LENGTH (d.duns_cols), d.duns_cols);
     23        FOR pc IN
     24          (SELECT '' || emp_id || '' AS pc_col
     25           FROM   primary_contact
     26           WHERE  duns_loc = d.duns_loc)
     27        LOOP
     28          DBMS_LOB.WRITEAPPEND (p_clob, LENGTH (pc.pc_col), pc.pc_col);
     29        END LOOP;
     30    END LOOP;
     31  END duns_proc;
     32  /
    
    Procedure created.
    
    SCOTT@orcl_11gR2> SHOW ERRORS
    No errors.
    SCOTT@orcl_11gR2> -- user datastore, section group with field section:
    SCOTT@orcl_11gR2> begin
      2    ctx_ddl.create_preference ('duns_store', 'USER_DATASTORE');
      3    ctx_ddl.set_attribute ('duns_store', 'PROCEDURE', 'duns_proc');
      4    ctx_ddl.set_attribute ('duns_store', 'OUTPUT_TYPE', 'CLOB');
      5    ctx_ddl.create_section_group ('duns_sg', 'BASIC_SECTION_GROUP');
      6    ctx_ddl.add_field_section ('duns_sg', 'emp_id', 'emp_id', true);
      7  end;
      8  /
    
    PL/SQL procedure successfully completed.
    
    SCOTT@orcl_11gR2> -- text index with user datastore and section group:
    SCOTT@orcl_11gR2> CREATE INDEX duns_context_index
      2  ON duns (text_key)
      3  INDEXTYPE IS CTXSYS.CONTEXT
      4  FILTER BY duns_loc
      5  PARAMETERS
      6    ('DATASTORE     duns_store
      7        SECTION GROUP     duns_sg
      8        SYNC          (ON COMMIT)')
      9  /
    
    Index created.
    
    SCOTT@orcl_11gR2> -- variables:
    SCOTT@orcl_11gR2> VARIABLE employeeid NUMBER
    SCOTT@orcl_11gR2> EXEC :employeeid := 1
    
    PL/SQL procedure successfully completed.
    
    SCOTT@orcl_11gR2> VARIABLE search VARCHAR2(100)
    SCOTT@orcl_11gR2> EXEC :search := 'highway'
    
    PL/SQL procedure successfully completed.
    
    SCOTT@orcl_11gR2> -- query:
    SCOTT@orcl_11gR2> SET AUTOTRACE ON EXPLAIN
    SCOTT@orcl_11gR2> SELECT SCORE(1), d.*
      2  FROM   duns d
      3  WHERE  CONTAINS
      4             (text_key,
      5              :search || ' AND ' ||
      6              :employeeid || ' WITHIN emp_id',
      7              1) > 0
      8  /
    
      SCORE(1)   DUNS_LOC BUSINESS_NAME   BUSINESS_NAME2  ADDRESS_LINE                   CITY            ST BUSINESS_PHONE
    ---------- ---------- --------------- --------------- ------------------------------ --------------- -- ---------------
    CONTACT_NAME    CONTACT_TITLE   T
    --------------- --------------- -
             3          1                                 highway
    
    1 row selected.
    
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 2241294508
    
    --------------------------------------------------------------------------------------------------
    | Id  | Operation                   | Name               | Rows  | Bytes | Cost (%CPU)| Time     |
    --------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT            |                    |    38 |  1102 |    12   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| DUNS               |    38 |  1102 |    12   (0)| 00:00:01 |
    |*  2 |   DOMAIN INDEX              | DUNS_CONTEXT_INDEX |       |       |     4   (0)| 00:00:01 |
    --------------------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       2 - access("CTXSYS"."CONTAINS"("TEXT_KEY",:SEARCH||' AND '||:EMPLOYEEID||' WITHIN
                  emp_id',1)>0)
    
    SCOTT@orcl_11gR2>
    
  • Unable to full-text index content in Oracle 11 g UCM

    Hello

    I am new to Oracle 11g UCM.

    I can't make it to the full-text index, the content files that are archiving in the Oracle UCM.

    I added entries in the config.cfg file below:

    SearchIndexerEngineName = OracleTextSearch
    IndexerDatabaseProviderName = SystemDatabase
    AdditionalEscapeChars =. #

    While performing the indexing Repository Manager only operation, the metadata of the content files are indexed, but text is not get indexed.

    What missing here in Oracle UCM for fulltext indexing not content? Should what configurations I do for that I can search to search in full text on the Oracle UCM content?

    Thanks in advance
    Dipesh

    Hello

    :-) Points.

    Thank you
    Srinath

  • In SQL Server 2008 full-text search engine

    I want to write queries by using the full text on the AdventureWorks2008 database search tool in SQL Server 2008.

    When I right click on the affected table the full text index option is grayed out.

    When I questioned sys.dm_fts_index_population to display tables with full-text indexes populated that it showed me that there is none and yet when I tried to create a single showed me an error message saying that there was already a full text index.

    What happens here?

    E-mail address is removed from the privacy *.

    You may find that you will get a better/more response if you post in dedicated SQL Server official forums from Microsoft here:

    http://social.technet.microsoft.com/Forums/en-us/category/sqlserver .

    Thank you.  :)

    (I'm sorry, but I can't move this thread for you because the two forums are working on separate platforms)

  • The BLASTP_ALIGN query performance decreases as increases the size table Ref?

    Newbie here.

    I'm using Oracle 11.2.0.3.

    I am currently running and a loop through the cursor according to who uses the tool BLASTP_ALIGN from Oracle:

    FOR MyALIGN_TAB IN

    (

    Select a.query_string, H.AA_SEQUENCE target_string, t_seq_id, pct_identity, alignment_length, incompatibilities, positive, gap_openings, gap_list, q_seq_start, q_frame, q_seq_end, t_seq_start, t_seq_end, t_frame, score, wait

    from (select t_seq_id, pct_identity, alignment_length, incompatibilities, positive, gap_openings, gap_list, q_seq_start, q_frame, q_seq_end, t_seq_start, t_seq_end, t_frame, score, wait

    table (BLASTP_ALIGN ((p_INPUT_SEQUENCE SELECT query_string FROM DUAL),

    CURSOR (Select GB_ACCESSION, AA_SEQUENCE from HUMAN_DB1. HUMAN_PROTEINS),

    1-1, 0, 0, 'PAM30',. 1, 10, 1, 2, 0, 0)

    )

    ),

    (SELECT p_INPUT_SEQUENCE FROM DUAL Query_string).

    HUMAN_DB1. HUMAN_PROTEINS H

    WHERE UPPER (t_seq_id) = UPPER (H.gb_accession) and gap_openings = 0

    )

    LOOP


    This initial query works relatively well (about 2 seconds) on a table target of approximately 20,000 documents (reproduced above, as the HUAMN_DB1. Table HUMAN_PROTEINS. However, if I had to choose a selected target table that contains approximately 170 000 records, the query performance are significantly reduced in about 45 seconds. The two tables have identical ratings.


    I was wondering if there are ways to improve the performance of BLASTP_ALIGN on large tables? There only seems to be a lot of documentation on BLASTP_ALIGN. I could find this (http://docs.oracle.com/cd/B19306_01/datamine.102/b14340/blast.htm), but it wasn't that useful.


    Any ideas would be greatly appreciated.



    In case one is interested... it looked like the AA_SEQUENCE column in the following slider: SLIDER (Select GB_ACCESSION, AA_SEQUENCE from HUMAN_DB1. HUMAN_PROTEINS) was a CLOB field. In my second target, my column correspodoning table was VARCHAR2. One hypothesis is that BLASTP_ALIGN made a VARCHAR2-> CLOB conversion internally. I changed the table to have a CLOB column and with success against BLASTP_ALIGN 170 000 documents about 8 seconds (not much, but better than 45).

    I will mark it as answered.

  • RH11 Webhelp full-text research question

    I built a project for several months. A year ago, we went from RH9 to RH11 without any problem. We just found out that there are now problems with full-text search. Survey shows anything loaded before a month ago back in the search, but whatever it is loaded after that which is not running. I checked the whxdata file in the files published and found that the packagexx_xml.js files are all dated 3 February 2016, even if it has been published since then. Should I delete the whxdata files and let them recreate? If I look in project files there is no package file, and if I open index.htm and do a search, I get "null" for everything. I do not understand that these files contain the text search information? Obviously something went haywire. Could I have the JavaScript problems? Any suggestions?

    After much digging and checking that I finally solved the problem. First know that I updated to Java, I installed the new MSXML Service Packs. I uninstalled and reinstalled 11 HR. None of these actions makes no difference. I decided to go back to basic troubleshooting. I went back what files changed on 3 February, which was the last day, the 'package' of the files updated. I had downloaded the two files PDF luggage. I uninstalled both and compiled the project. Success - "package" files updated and the search function has been restored. I installed each PDF individually and updated after each and found out who was the author of the offence. I still don't know why this particular PDF file was causing problems. There is no feature of security enabled on the document - however, it's 35 pages of very detailed drawings. In any case-, the problem is resolved and the end was just the PDF file causing problems.

    Thanks again for the reply Rick.

    Russ

  • There is no issue of full text search IdcColl2 table

    Hello

    I tried to activate full-text indexing and searching. So I changed the value of the property SearchIndexerEngineName of the DATABASE of DATABASE. Text FULL, I have restarted the UCM, disabled the automatic update of the cycle and ran a collection rebuild cycle, as stated in section 4.2.2.2 of this document: management system - 11 g Release 1 (11.1.1) parameters

    First of all, I met a problem with restarting the round of automatic update. I ran a collection complete reconstruction cycle once again, who seemed resolved that.

    But now the problem is, I can't do your research. I get the error "unable to retrieve theresearch results. Error occurred during processing. Unable to return results'and saves the State IdcColl2 table or view does not exist. Indeed, I have only an IdcColl1 in my database schema.

    What should I do?

    How is there is no table of IdcColl2?

    Accompaniment I want not, I wouldn't have to rerun a reconstruction of the collection. I have several documents of 4 tha Millon and the previous ones were extremely long...

    Thank you for your help.

    In this file, there are 2 entries that are on IdcColl2. This is why the research of the Complutense University of Madrid is looking for IdcColl2 tables, this should have been created during a reconstruction of the collection.

    Replace IdcColl2 in this file (both locations) with IdcColl1 and restart the server, test.

    Thank you

    Srinath

Maybe you are looking for