Database Tuning (MOSC)

MOSC Banner

SQL query slow

edited Dec 9, 2009 6:55AM in Database Tuning (MOSC) 3 commentsAnswered
 Hi,
Problem:
The following SQL stmt caused tremedous io and cpu usage and took a long long time to finish.
SELECT SUM(BYTES) FROM USER_FREE_SPACE F, USER_USERS T WHERE F.TABLESPACE_NAME = T.DEFAULT_TABLESPACE
The original explain plan shows total cost=14089.
After implementing a new plan suggested by the SQL tuning advisor and exectued following suggested by tuning advisor,
BEGIN
Dbms_Stats.gather_table_stats(ownname => 'SYS', tabname => 'FET$', estimate_percent => Dbms_Stats.AUTO_SAMPLE_SIZE, method_opt=>'FOR ALL COLUMNS SIZE AUTO');
Dbms_Stats.gather_table_stats(ownname => 'SYS', tabname => 'UET$', estimate_percent => Dbms_Stats.AUTO_SAMPLE_SIZE, method_opt=>'FOR ALL COLUMNS SIZE AUTO');

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center