SQL statement execution sequence

A, sql statement the implementation of these steps:
1) Syntax analysis syntax statement with the norms, measured statement of the meaning of the expression.
2) semantic analysis, to check all statements relating to the existence of database objects, and users have the appropriate permissions.
3) view of conversion, will involve the view query is converted to the corresponding base form of the query.
4) The expression of conversion, complex SQL expression is converted to a simpler expression equivalent connection.
5) Select Optimizer, Optimizer different in general have a different "implementation plan"
6) Select connection, ORACLE there are three connections on the multi-table connection ORACLE way to choose the appropriate connection.
7) Select the order to connect to multi-table select which ORACLE connection to connect to the table, select the two tables in which the source table as a data table.
8) Select the data search path, select the appropriate conditions for the basis of the above data search path, in the case of selection or use of the entire search index table or in other ways.
9) run "implementation plan"
Second, oracle shared principles of:
ORACLE will be implemented over the SQL statements stored in the shared memory pool (shared buffer pool), you can by all users to share the database when you implement a SQL statement (sometimes called a cursor), if it is before carried out exactly the same statement, ORACLE has been able to quickly resolve the statement, as well as the implementation of the best path. This feature greatly enhance the performance of the SQL and save the use of memory, oracle statement to increase the efficiency of the method of inquiry : 1: where column in (select * from ... where ...); 2: ... where exists (select 'X' from ... where ...); the second format to the first than efficient formats. Oracle can be in almost all of the IN operator subquery rewritten to use the EXISTS subquery use EXIST, Oracle will first check the system operator, and then run until it subquery to find the first match, which saves time Oracle system IN subquery in the implementation, the first implementation of sub-queries, and results in a list stored in a temporary increase in the index table to avoid the use of words to avoid having to use HAVING clause, HAVING retrieved only after all records should filter the result set. this sort to deal with the need for a total of such operations. If the WHERE clause can limit the number of records that will be able to reduce spending in this area

SQL Select statement complete the implementation of the order of:

1, from clause assemble data from different data sources;
2, where clause based on the conditions specified on the record to carry out screening;
3, group by clause will be sub-divided into a number of data;
4, calculated using the aggregation function;
5, the use of having sub-clause filter;
6, the calculation of all the expressions;
7, using the order by sorting on the result set.
  • del.icio.us
  • StumbleUpon
  • Digg
  • TwitThis
  • Mixx
  • Technorati
  • Facebook
  • NewsVine
  • Reddit
  • Google
  • LinkedIn
  • YahooMyWeb

Related Posts of SQL statement execution sequence

  • ORACLE10G full version centos5 installed (the installation has passed)

    ORACLE10G full version centos5 installed (the installation has passed) 1. Centos 5.0 install rn GUI must be installed, it is best not to start selinux rn rn rn 2. . Ready to install the software: (this is very important, is the first installation fai ...

  • SGA extended the principle of 32bit oracle

    SGA extended the principle of 32bit oracle From: http://www.itpub.net/247048.html Because the median 32bitrnoracle restrictions can only visit the oracle process 4g (2 of 32 power) following virtual memory address, the time at a lot of people this is ...

  • Dbms_obfuscation_toolkit use of Oracle's encryption and decryption of data (to)

    In order to protect sensitive data, oracle start from 8i to provide a data encryption package: dbms_obfuscation_toolkit. Take advantage of this package, our data can be DES, Triple DES or MD5 encryption. This article on the use of this and the use of ...

  • Oracle XDB relax resolve port conflict of 8080

    In this paper, carried: http://www.enet.com.cn/article/2008/0306/A20080306175452.shtml Oracle 9i from the start, Oracle includes the installation of the default XDB. After starting the database, Oracle XDB's http service will automatically take u ...

  • Oracle in the relationship between User and Schema

    If we want to know the database and the User What is the relationship between Schema, we must first know about User and Schema database What is the concept in the end. In SQL Server2000 in architecture because of the reason, User and Schema there is ...

  • High Availability Oracle Flashback

    Brief introduction Flashback Database is a point in time (PIT) restore the database approach. This incomplete recovery strategy can be used to restore the logic because of human error cause damage to the database. At the introduction of 10g, it is de ...

  • An example of the use of TKPROF

    First, view and edit parameters SQL> show parameter max_dump_file_size NAME TYPE VALUE ------------------------------------ ----------- --- --------------------------- max_dump_file_size string UNLIMITED SQL> show parameter user_dump_dest NAME TYPE

  • Diagnosis and principles of order

    SQL> select disk.value "Disk", mem.value "Mem", 2 (disk.value / mem.value) * 100 "Ratio" 3 from v $ sysstat mem, v $ sysstat disk 4 where mem.name = 'sorts (memory)' 5 and disk.name = 'sorts (disk)'; D ...

  • ORACLE 10G dataguard configuration Step by Step

    oracle dataguard

Leave a Reply

Recent
Recent Entries
Tag Cloud
Random Entries
Latest Comments