Re: SQL Newbie needs urgently help! [optimizing query]
Posted by:
Toa Sty
Date: January 24, 2007 08:16AM
If I've read your posts correctly, your problem is that your query is having to look at too many rows in the category table, so I wonder if we can get it to use a better index on this table.
Problem is, you only have 25 different values for p_catalogversion so in an 80K row table it's not going to restrict things much. You could try a multi-col index on (p_catalogversion, TypePkString) or the other way round I suppose. I wouldn't expect it to help much though.
Ah - I notice that you said that if you removed the p_catalogversion condition the query is much faster - so what does the explain plan look like in that case?
Toasty
BTW, you seem to have a duplicate key:
Categories_codeIDX covers p_code, but the multi col index
Categories_codeVersionIDX also covers it, which makes Categories_codeIDX redundant.
This shouldn't cause a problem but might save you some space if you remove it :)
-----------------------------------------
email: 'toasty'*3 at gmail
Subject
Views
Written By
Posted
3681
January 24, 2007 05:31AM
2420
January 24, 2007 05:52AM
2298
January 24, 2007 06:07AM
2357
January 24, 2007 06:18AM
2213
January 24, 2007 06:41AM
2267
January 24, 2007 07:16AM
Re: SQL Newbie needs urgently help! [optimizing query]
2319
January 24, 2007 08:16AM
2407
January 24, 2007 08:50AM
2228
January 24, 2007 09:10AM
2395
January 24, 2007 09:24AM
2502
January 24, 2007 10:29AM
2334
January 24, 2007 10:40AM
2225
January 24, 2007 03:19PM
2182
January 25, 2007 07:27AM
2266
January 24, 2007 07:16AM
2383
January 24, 2007 07:32AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.