To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here

HOME News MS SQL Oracle DB2 Access MySQL PHP Scripts Books Links DBA Talk


Go Back   Database Journal Forums > Miscellaneous > Ask an Expert

Ask an Expert Ask our SQL experts the tough questions that have you stumped. Members are limited to one question a week, so ask your questions wisely!

Reply Post New Thread
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 10-30-2003, 09:16 AM
prasen999 prasen999 is offline
Junior Member
 
Join Date: Jul 2003
Location: India
Posts: 8
tuning a query

hi folks,

i have a query as below:-


select r.parentid parentid,r.id ownid,sum(a.amount)/10000000 rcptcuryr, 0 rcptlstyr
from rcpt_rep_master r,rcpt_rep_link b,rcpt_2002 a
where substr(a.majorhead||a.SUBMAJORHEAD||a.MINORHEAD||a .scheme||a.GRPSUBHEAD||a.subhead,b.start_len,b.end _len) between trim(b.from_sh) and trim(b.to_sh)
and a.rcpdate between '01-sep-2003' and '30-oct-2003'
and b.add_sub = 'A'
and r.goi = 'N'
and r.id = b.id
group by r.parentid,r.id



the database is maintained by someone else, so plzz i have nothing to do with such messy table structure...plzz bear.

rcpt_2002 doesnt have ne index.
rcpt_rep_master,rcpt_rep_link r snapshots in my databse.( i have created composite function based index on trim(b.from_sh),trim(b.to_sh) in the remote databse).


the execution time of this query is 6secs.
the plan is attached.

can u plzz help me tune this.

thanks and regards,
Prasen
Attached Files
File Type: txt xplainplan.txt (648 Bytes, 56 views)
Reply With Quote
Reply Post New Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 05:36 AM.


DatabaseJournal Recent Articles


 » Configuring Oracle as a Data Source for SQ...

 » Tips for Simplifying Crosstab Query Statem...

 » Redmond exploits MySQL uncertainty

 » Oracle Launches Oracle Global Trade Manage...

 » SQL Server 2008 RTM Support Ends April 13,...

Search Database Journal:
 








Acceptable Use Policy


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.