Databases
cancel
Showing results for 
Search instead for 
Did you mean: 

Oracle 9i and indexing CLOBS

Henrique Silva_3
Regular Advisor

Oracle 9i and indexing CLOBS

Our application used to have a field that was too small, so, they changed that fields to a CLOB and now, we can do string searches within that field.

Now, I know/think, that we can not use LIKE operator on LOBs, so, I assume that internally, the app is using DBMS_LOB package to do these searches, assuming all it is entering on these fileds are strings.

How have you experience been on adding indeces on CLOBs, especifically ? The data lives withing the DB, so we ar enot talking BFILES here.

Any issues with performance ( we are trying to improve the searches by adding the indeces ), operability ? What happens if we have something other then a string on these fields ?
We are going to do any modifications on our staging environment, at first, and then, understand what the issues are, and go from there.

Any info would be appreciated !!

Thanks,

Henrique Silva
"to be or not to be, what was the question ???? "
1 REPLY
Indira Aramandla
Honored Contributor

Re: Oracle 9i and indexing CLOBS

Hi Henrique Silva,

LOB indexes are also similar to normal indexes except that they always reside in the same tablespace as the LOB locator. You can use alter index rebuild for the LOB index and see if it improves the performance.

There are 4 types of LOB:
CLOB, BLOB, NCLOB stored internally to Oracle
BFILE stored externally

CLOB - Character LOB (single byte characters only), <= 4Gig.

When a LOB is stored in a table the data (LOB VALUE) and a pointer to that data, called a LOB LOCATOR, are held separately. The data may be stored along with the locator in the table itself or in a separate table.
lob_index_clause is deprecated as of Oracle8i. Oracle generates an index for each LOB column. Oracle names and manages the LOB indexes internally. Although it is still possible for you to specify this clause, Oracle strongly recommends that you no longer do so. In any event, do not put the LOB index in a different tablespace from the LOB data.
The LOB index is located in the same tablespace as the LOB segment with the same storage values, except the NEXT and MAXEXTENTS values.
· the NEXT value of the lobindex = INITIAL default value of the tablespace (LOB segment)
· the MAXEXTENTS value of the lobindex = unlimited value (2Gb)
All storage modifications are based on this original table t_lob.
Regarding performance, working with LOBs generally requires more than one round trip to the database. The application first has to obtain the locator and only then can perform operations against that locator. This is true for inline or out of line LOBS. The buffer size used to read / write the LOB can have a significant impact on performance.

BFILEs are quite different to internal LOBS as the only real storage issue is the space required for the inline locator. This is about 20 bytes PLUS the length of the directory and filename elements of the BFILENAME.

Attaches is note from metalink "Note 66431.1" describing the storage, redo and performance issues of LOBS.

Indir
Never give up, Keep Trying