Common SQL Performance Statistics code

Source: Internet
Author: User


1 BEGIN2Dbms_stats. Gather_table_stats (ownname=>'Teledb', tabname=>'wfgtest', partname=>NULL);3 END;4 ALTER TABLE wfgtest deallocate UNUSED;5 COMMIT;6 7 SELECT table_name,num_rows,blocks,empty_blocks8 From user_tables9WHERE table_name='wfgtest';Ten OneSELECT COUNT (1) from Wfgtest; A - DELETE from Wfgtest; - COMMIT; the - TRUNCATE TABLE wfgtest; - COMMIT; - +SELECT *From Wfgtest; - + DECLARE ANUM Number ( -); at DT1 DATE; - BEGIN -NUM: =1; -DT1: =sysdate (); -For NUM in1..1000000 - LOOP in INSERT into Wfgtest VALUES (To_char (num), to_char (num), num); - END LOOP; to COMMIT; + -Dbms_output. Put_Line (Floor (To_number (SYSDATE-DT1) * -* -* -)); the *END;

Common SQL Performance Statistics code

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.