|
-
Hi all, I'm transferring an application from access to oracle. As I re-write some of my queries to fix the way joins are done, i'm noticing that my access db queries are almost 2x as fast as my oracle! Can anyone see something wrong with how I'm writing them?
ACCESS:
SELECT distinct a.sceneid
FROM ((z_scenes a LEFT JOIN scenekw ON a.sceneid = scenekw.sceneid) LEFT
JOIN admin_comments ON a.sceneid = admin_comments.sceneid
WHERE ((scenekw.scene_key_word LIKE '%tara%'
OR a.scenename LIKE '%tara%'
OR a.scenedescription LIKE '%tara%')
AND (scenekw.scene_key_word LIKE '%atlanta%'
OR a.scenename LIKE '%atlanta%'
OR a.scenedescription LIKE '%atlanta%'))
ORACLE (indexes and primary/foreign keys defined on all id's):
SELECT distinct a.sceneid
FROM z_scenes a, scenekw b, admin_comments c
WHERE a.sceneid = b.sceneid(+)
AND a.sceneid = c.sceneid(+)
AND ( (b.scene_key_word LIKE '%Tara%'
OR a.scenename LIKE '%Tara%'
OR a.scenedescription LIKE '%Tara%')
AND (b.scene_key_word LIKE '%Atlanta%'
OR a.scenename LIKE '%Atlanta%'
OR a.scenedescription LIKE '%Atlanta%') )
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|