|
-
=========
SELECT/*+ RULE */MAX(cheeseid) FROM cheese
WHERE typeid <> 0
GROUP BY currency, cost, smell, classification, typeid, creationdate
HAVING count(cheeseid) > 1;
=======
<> condition stops using index.
You could rewrite the query as given below:
SELECT MAX(cheeseid) FROM cheese
WHERE (typeid > 0 or typeid < 0)
GROUP BY currency, cost, smell, classification, typeid, creationdate
HAVING count(cheeseid) > 1;
Create an index on typeid column. Check the plan.
Tamil
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
|