Home » SQL & PL/SQL » SQL & PL/SQL » Analyze table
Analyze table [message #240705] Fri, 25 May 2007 09:52 Go to next message
lamnguyen14
Messages: 119
Registered: March 2007
Location: Virginia
Senior Member
Good Morning

Can anybody please tell me what do the commands Analyze Table and Compute Statistics really do and how helpful are they in speeding up the queries?

Thank you very much
Re: Analyze table [message #240711 is a reply to message #240705] Fri, 25 May 2007 10:00 Go to previous messageGo to next message
DreamzZ
Messages: 1666
Registered: May 2007
Location: Dreamzland
Senior Member
analyze table mytable compute statistics;

exec dbms_stats.gather_table_stats ('username','tablename');


check for full details on dbsm_stats.
http://www.psoug.org/reference/dbms_stats.html AND
http://otn.oracle.com/docs/products/oracle8i/doc_library/817_doc/server.817/a76956/general.htm#11880

[Updated on: Fri, 25 May 2007 10:08]

Report message to a moderator

Re: Analyze table [message #240714 is a reply to message #240705] Fri, 25 May 2007 10:02 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
They generate a set of data for each table and index in the system.
This data lets the optimiser know things like:
How many rows there are in each table
How unique each index is
How many rows share each value for a given column

Without this data, the CBO is unable to generate effective execution plans for queries, so I'd rate them as very important.
Re: Analyze table [message #240721 is a reply to message #240705] Fri, 25 May 2007 10:11 Go to previous message
lamnguyen14
Messages: 119
Registered: March 2007
Location: Virginia
Senior Member
Thank you
Previous Topic: Trigger Help
Next Topic: find out which job is calling particular package
Goto Forum:
  


Current Time: Fri Dec 09 07:36:35 CST 2016

Total time taken to generate the page: 0.09303 seconds