Slow spatial query execution

"Jessica Clarke" <[email protected]>
Newsgroups gmane.comp.python.db.cx-oracle
Message-ID <[email protected]>
Hi, 
I've been banging my head for a week trying to figure out why this query is running so slow. 
The query is complex and the data set is quite large. 
Simpler queries also take a long time,  but this one in particular takes 11 hours. So I thought if I could figure this one out, I could figure out the formula for the rest. 
 
SELECT count(*)
from (select b.* from PI.PITYPE b, coupe.base_pc_a c where c.provcoupe = 'coupe1' AND SDO_RELATE(b.shape, SDO_GEOM.SDO_BUFFER(c.shape, -1, 1), 'MASK=ANYINTERACT')='TRUE') a
 WHERE a.PITYPE like 'ER5%'
 or a.PITYPE like 'ER6%'
 or a.PITYPE like 'coER5%'
 or a.PITYPE like 'coER6%' OR 
 (SUBSTR(a.concisepi,1,1) IN ('A','B','D','G','H')
 AND SUBSTR(a.concisepi,4,1) in ('1','2','3','6','7')
 and SUBSTR(a.concisepi,5,1) in ('A','B','C','D'))
 
Thanks, 
 
Jess Clarke
 

---------------------------------------------------------------
Forestry creates regional employment:
 http://youtu.be/UBIUGiCiX00
Growing tomorrow's high conservation value forests:
 http://www.youtube.com/watch?v=wP6XCailI-A
---------------------------------------------------------------
This transmission is intended solely for the person or organisation to whom it is addressed.
It is confidential and may contain legally privileged information.
If you have received this transmission in error, you must not keep, forward, copy, use, save or rely on this communication. Any such action is unauthorised and prohibited.Please reply to this email to notify the sender of its incorrect delivery, and then delete both it and your reply.
No liability is accepted for any unauthorised use of the information contained in this transmission.
Despite our use of anti-virus software, Forestry Tasmania cannot guarantee that this transmission is virus-free.

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk

_______________________________________________
cx-oracle-users mailing list
cx-oracle-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/cx-oracle-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.