Detailed description of oracle table preparation, index testing, SQL query execution times, And tablespace creation methods. oraclesql

Source: Internet
Author: User

Detailed description of oracle table preparation, index testing, SQL query execution times, And tablespace creation methods. oraclesql

Put a system diagram first,

Table preparation
Create table t as select * from all_objects;
Index test
Create index idx_object_id on t (object_id );
Query
Select * from t where object_id = 29

View execution plan: cost 2

In the second query, the hash value of this command will exist in the shared zone, and the data will be cached in the data buffer zone of sga.

Add HINT to force full table Scan

Select/* + full (t) */* from t where object_id = 29;

View execution plan: cost 287

Queries the number of SQL executions
SELECT t. SQL _text,t. SQL _id,t.parse_calls,t.exe cutionsfrom v $ SQL twhere SQL _text like '% insert into T values % 'order BY t.exe cutions desc
Create a tablespace
Create tablespace TBS_LJB_Adatafile 'f: \ oracle_data \ tbs_ljb_a_01.dbf' size 1 Mautoextend ONuniform size 64 K
Create a table in the specified tablespace
Create table t_a (id int) tablespace TBS_LJB_A
Insert Test Data
Insert into t_a select rownum from dual connect by level <= 10000000

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.