Skip to Main Content
  • Questions
  • Full-Text Index (Table, Index and LOB files) Size Creep

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Robert.

Asked: December 12, 2018 - 7:34 pm UTC

Last updated: December 19, 2018 - 1:53 am UTC

Version: Application Express 5.1.0.00.45

Viewed 1000+ times

You Asked

Q: How do we "manage" the size of a table's associated SYS_LOB files?

Background: I have a table [SRCH_CACHE] that was setup as a lookup table, because the two base tables could not be joined/filtered with sufficient speed. The table is pretty simple. A redacted CREATE TABLE is provided here with the pertinent columns, for clarity:

CREATE TABLE APEX_EBS_DEV.SRCH_CACHE 
  (
    INVENTORY_ITEM_ID NUMBER, 
    SHORT_DESCRIPTION VARCHAR2(240 BYTE), 
    LONG_DESCRIPTION VARCHAR2(4000 BYTE), 
    PRIMARY KEY (INVENTORY_ITEM_ID)
  );
    
   CREATE INDEX APEX_EBS_DEV.SRCH_CACHE_TXT1 ON APEX_EBS_DEV.SRCH_CACHE (SHORT_DESCRIPTION) 
   INDEXTYPE IS CTXSYS.CONTEXT ;

  CREATE INDEX APEX_EBS_DEV.SRCH_CACHE_TXT2 ON APEX_EBS_DEV.SRCH_CACHE (LONG_DESCRIPTION) 
   INDEXTYPE IS CTXSYS.CONTEXT ;



This table fills up with 950K records, with an average Short Description length of 71 characters and Long Description length of 138 characters. Mostly, the Long Description is null.

All told, there are 65,600,598 characters in the Short Description and 11,029,843 characters in the Long Description. So, about 77MB worth of data, if I calculated it correctly.

The problem is, we end up with table, index and LOB files that are 70GB+ in size. This only happens in PRODUCTION. Our DEV and TEST environments see the table created, the indexes populated and then they remain reasonably stable is size. In production, with the same number of records, they seems unreasonably large and continue to grow. In particular, we don't understand why the SYS_LOB table is growing so big.

T-SPACE   SEGMENT_NAME              SEGMENT_TYPE      SIZE(GB)
APEX        SYS_LOB0012174458C00002$$     LOBSEGMENT        38.644710
APEX        DR$SRCH_CACHE_TXT1$I          TABLE             17.901370
APEX        DR$SRCH_CACHE_TXT1$X          INDEX              4.817383
APEX        DR$SRCH_CACHE_TXT2$I          TABLE              2.958008
APEX        SYS_LOB0012174445C00002$$     LOBSEGMENT         2.890808
APEX        SYS_IOT_TOP_12174462          INDEX              2.812500
APEX        SYS_IOT_TOP_12174449          INDEX              2.800781
APEX        DR$SRCH_CACHE_TXT2$X          INDEX              0.756836
APEX        SRCH_CACHE                    TABLE              0.218750


Can you provide any insight into why the LOB tables are so big? And, is there a way to periodically "compress" the indexes, as they are creeping up in size on a regular basis as data is merged?

Rob


Application Express 5.1.0.00.45
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
PL/SQL Release 12.1.0.2.0 - Production

and Connor said...

Text index size is governed not just be the data, but the way it comes in, the sync frequency, etc. You can see some good information on that here

https://docs.oracle.com/en/database/oracle/oracle-database/12.2/ccapp/indexing-with-oracle-text.html#GUID-4313B6A6-510F-41E8-9B5C-3559F42742D4

So the first thing I'd perhaps look at is whether an optimize corrects the issue, although I must concede - the kind of growth you've described does seem out of the ordinary.

Rating

  (2 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Lobbying for Lobs

Racer I., December 18, 2018 - 10:58 am UTC

Hi,

We generally observe excessive growth with LOB segments that undergo updates. I guess its something to do with their different UNDO handling.

Maybe regular reorgs are the way to go here?

ALTER TABLE TTT move /*PARTITION ppp*/ ONLINE UPDATE INDEXES lob(ccc) STORE AS SECUREFILE (TABLESPACE ddd) PARALLEL 16;

regards,
Connor McDonald
December 19, 2018 - 1:53 am UTC

This is different though because the lobs here are in the underlying text index tables.

You don't want to be running explicit commands on *those* tables.

rrribbitt

Racer I., December 18, 2018 - 2:57 pm UTC

More to Explore

Design

New to good database design? Check out Chris Saxon's full fundamentals class.