Home » Server Options » Text & interMedia » optimizing iFS text query
optimizing iFS text query [message #110252] Fri, 04 March 2005 11:41 Go to previous message
swarris
Messages: 3
Registered: March 2005
Junior Member
L.S.

We've been using Oracle 9i for quite some time now. But after a year the java iFS text became very slow. As the database grew the performance fell significantly, up to a point where an avarage query resulted in a database time out...
We started analysing the iFS text query and much to our suprise, the text index is fast enough:
select /*+ INDEX(ODMZ_CONTEXT_ROUTER IFS_TEXT) */
 count(*)
from ODMZ_CONTEXT_ROUTER
where
  CTXSYS.CONTAINS(ODMZ_CONTEXT_ROUTER.CONTENTPROCEDURE,'search text', 1) > 0;

usually returns in less than a second.

Further analyses revealed that the default iFS text query uses many views on many table, although only a few tables where needed for the result. These views where the real cause of the performance degradation. We've managed to remove the views and added optimizer hints:
select /*+ INDEX(ODMZ_CONTEXT_ROUTER IFS_TEXT) USE_HASH(SC1 SC0 p a) */
 distinct SC0.id, CTXSYS.SCORE(1)/(0.3*log(10, SC1.contentsize)) score
from ODMZ_CONTEXT_ROUTER, odm_contentobject SC1, odm_document SC0
 join odm_relationship r on (SC0.id = r.rightobject)
  join
   (select fi.rightid
     from odmz_folderindex fi
     where fi.lev = 0 and fi.leftid in
      (select fi2.rightid
        from odmz_folderindex fi2
        where fi2.lev = 1 and fi2.leftid =36128
      )
    union
    select fi.rightid
     from odmz_folderindex fi
     where fi.lev = 1 and fi.leftid =36128
   ) f
  on (f.rightid = r.leftobject), odm_publicobject p, odmz_acl_discoverer a, odmz_class_hierarchy ch
 where
  CTXSYS.CONTAINS(ODMZ_CONTEXT_ROUTER.CONTENTPROCEDURE,'search text', 1) > 0 AND
  ODMZ_CONTEXT_ROUTER.id = SC1.content AND
  SC0.CONTENTOBJECT = SC1.ID AND
  SC0.id = p.id AND
  p.acl = a.aclid AND
  ((p.owner =1074 and a.userid = 0) OR ( p.owner != 1074 and a.userid = 1) OR ( p.owner != 1074 and a.userid = 1074)) AND
  p.deletor = 0 AND
  p.classid = ch.subclassid and
  ch.classid=182209
ORDER BY score DESC;


Still, in some cases this query takes about 24 seconds to complete (of which 1.2 seconds is spend on the text index).
The text query results in 9000 documents, whereas the overal result contains about 5000 documents...

Can anybody help us with increasing the performance of this query?? Again, the database keeps growing...

Thanx,
Sven

 
Read Message
Read Message
Read Message
Previous Topic: Enable InterMedia option - replacement script for dr0inst.sql in 10g?
Next Topic: SYNC INDEX runs forever
Goto Forum:
  


Current Time: Tue Apr 23 05:06:11 CDT 2024