SQL query tunning [message #239486] |
Tue, 22 May 2007 08:47 |
manjiri
Messages: 6 Registered: May 2007 Location: Mumbai
|
Junior Member |
|
|
Dear All,
Unable to tune attached two queries. Eventhough query is written properly it takes lot of time for execution. Query includes function also. This query is used for generating report in crystal report.
Please suggest how do I tune this query.
|
|
|
|
|
|
|
|
|
Re: SQL query tunning [message #239925 is a reply to message #239906] |
Wed, 23 May 2007 12:15 |
skooman
Messages: 913 Registered: March 2005 Location: Netherlands
|
Senior Member |
|
|
The FTS's are kind of coherent with the hash joins. You might want to try to hint it into using nested loops.
[Edit] Oops, forgot that there are no indexes, nested loops won't do you any good. Forget I mentioned this. Maybe without indexes this is as fast as it gets (or add more hardware...).
[end edit]
Just out of curiosity: what does the following where clause do:
AND h.holdings_ason_date BETWEEN
to_date('01/01/1900'
,'dd/mm/yyyy') AND
to_date('12/07/2006'
,'dd/mm/yyyy')
Is this to keep any records BC out of the resultset? How many of those do you have?
And this one is even more intriguing:
WHERE h.holdings_to_date >= to_date('01/12/2099'
,'DD/MM/YYYY')
Either this is a mistake or there is some dummy value involved...
[Updated on: Wed, 23 May 2007 12:17] Report message to a moderator
|
|
|