Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> SQL tuning question.

SQL tuning question.

From: Jibo John <jijohn_at_cisco.com>
Date: Wed, 18 Dec 2002 11:26:08 -0800
Message-ID: <F001.0051D4D7.20021218112608@fatcity.com>


Hello DBAs,

I am currently involved in improving the search performance for a tool which queries a table having a million records (and the table is growing at a rate of 3000 records per day).

Thought of introducing Intermedia search for 4 columns in the search table.

Created CONTEXT indexes to three varchar (4000) columns as well as a varchar(500) column and used the CONTAINS keyword.

This has really improved the performance speed (5 times improvement) than the previous LIKE clause query if the number of records returned are less than 2000.
How ever, for those search criteria which returns more than 10,000 records, the query with CONTAINS clause is slower than the query with LIKE clause :(
I thought it can never go worse :)

Here are the two queries:
1. using index



SELECT id FROM search_table WHERE contains (product, '{product_name}') > 0 and (contains (VERSION1, '{ 11.0(1) }') > 0 OR contains (VERSION2, '{ 11.0(1) }') > 0 OR contains (VERSION3, '{ 11.0(1) }') > 0)

2. Without using index



SELECT /*+ PARALLEL(SEARCH_TABLE, 10) */ id FROM search_table WHERE PRODUCT like '%product_name%' and (VERSION1 like '% 11.0(1) %' OR VERSION2 like '% 11.0(1) %' OR VERSION3 like '% 11.0(1) %')

Few facts


I am a new-comer in the field of sql tuning and I presume I am really missing some thing here.
Is there any restriction that I cannot use Intermedia search for too many columns in a table?
Is the order in which the query formed makes any difference?

Oracle version is Oracle8i Enterprise Edition Release 8.1.7.4.0.

Any help regarding this is highly appreciated.

Thank you,
-Jibo

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Jibo John
  INET: jijohn_at_cisco.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Wed Dec 18 2002 - 13:26:08 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US