Home » RDBMS Server » Performance Tuning » How to tune a slow query
icon5.gif  How to tune a slow query [message #624870] Fri, 26 September 2014 15:41 Go to next message
oasisin2014
Messages: 8
Registered: September 2014
Junior Member
Any suggestions to speed up a query with union all?

The query is:
Table1 union all Table2 union all Table 3 .

Re: How to tune a slow query [message #624871 is a reply to message #624870] Fri, 26 September 2014 15:43 Go to previous messageGo to next message
oasisin2014
Messages: 8
Registered: September 2014
Junior Member
Please give some suggestions. Thanks
Re: How to tune a slow query [message #624872 is a reply to message #624870] Fri, 26 September 2014 15:43 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
Welcome to this forum.

Please read and follow the forum guidelines, to enable us to help you:

http://www.orafaq.com/forum/t/88153/0/ and read http://www.orafaq.com/forum/t/174502/

Since NOBODY can optimize SQL just by looking at it, we need a few more details.
http://www.orafaq.com/forum/m/433888/136107/#msg_433888
Please refer to URL above & be sure to provide the details requested:
1) DDL for all tables & indexes
2) EXPLAIN PLAN
3) output from SQL_TRACE & tkprof
Re: How to tune a slow query [message #624875 is a reply to message #624870] Sat, 27 September 2014 01:02 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Quote:
Any suggestions to speed up a query with union all?


Truncate the tables.

Re: How to tune a slow query [message #624889 is a reply to message #624875] Sat, 27 September 2014 11:22 Go to previous message
Lalit Kumar B
Messages: 3174
Registered: May 2013
Location: World Wide on the Web
Senior Member
Or, add Where clause to filter the data for individual tables Smile And create respective indexes as and when required.

Since, in a production enviroment, nobody wants entire data from the tables.

[Updated on: Sat, 27 September 2014 11:24]

Report message to a moderator

Previous Topic: Db servers capacity
Next Topic: Data PERFORMANCE ISSUES
Goto Forum:
  


Current Time: Thu Mar 28 17:00:49 CDT 2024