From: http://www.iteye.com/topic/508161
Recently, javaeye found that many comrades know little about SQL optimization. Recently, I have summarized several articles for reference only. However, a few of them may depend on the situation, most of them are quite effective.
[Note: (inefficiency) and (efficiency) are both equivalent .]
1. Connection sequence in the WHERE clause:Oracle uses the bottom-up sequence to parse the WHERE clause.According to
The ORACLE tutorial is: Oracle SQL Performance Optimization Series 2.
4. Select the most efficient table name sequence (only valid in the rule-based Optimizer)
The ORACLE parser processes the table names in the FROM clause in the order FROM right to left. Therefore, the tab
The ORACLE tutorial is commonly used SQL statements in oracle. SQL * Plus system/manager2. display the current connected userSQL> show user3. view the users in the systemSQL> select * from all_users;4. Create and authorize a userSQL> create user a identified by a; (created i
Ubuntu 10.10 Oracle 10g graphic tutorial
Environment: Host XP, 3 GB memory, VMware: Ubuntu10.10, hard disk 30 GB, memory 1024 MB
The installation of virtual machines is not described.
2. Update ubuntuSudo apt-get updateSudo apt-get upgradeOracle is written in java, so JDK is required. You can search for jdk in [Ubuntu Software Center]. After installing OpenJDK, you do not need to set the path.
3. Install t
(' Los Angeles ', ' jan-10-1999 ');The second INSERT into allows us to enter more than one pen at a time. Unlike the example above, we are now going to use the SELECT command to specify the data to be entered into the table. If you want to say that this is not to say that the information is from another form, then you want to be right. The syntax for entering more than one pen at a time is:INSERT into "Table 1" ("Field 1", "Field 2", ...)Select "Field 3", "Field 4", ...From "Form 2";The above s
Windows 10 x64 installation and configuration of Oracle 11g process records (Graphic tutorial), Windows 10 11g
Note: I want to install an oracle exercise on my computer, but I am afraid of problems during the installation process, and oracle uninstallation is notoriously troublesome, therefore, a system with the same v
Tags: start input trail Mat Average SQL function tin padded user1.SQL function(1) Character function: mainly manipulating strings(2) Number function: The number of numeric types is mainly manipulated(3) Conversion functions: These functions convert data from one data type to another data type(4) Date function: processing date and Time(5) Regular expression functions: These functions use regular expressions
If you have more than 3 table join queries, you need to select the Crosstab table (intersection table) as the underlying table, which is the table referenced by the other tables.
For example:
The EMP table describes the intersection of the location table and the category table.
SELECT *
From LOCATION L,
CATEGORY C,
EMP E
WHERE e.emp_no BETWEEN 1000 and 2000
and e.cat_no = C.cat_no
and E.LOCN = L.LOCN
will be more efficient than the following
execution plans. However, in practice we have also found a lot of such scenarios: sub-query speed, the amount of data is not small, but the slow after the connection, the result is to find the execution plan subquery is opened.By default, Oracle has a "small compute" feature when estimating the number of result sets for a multi-conditional statement. That is, the estimated number of result sets is less than the actual number, this is because the defa
In the SQL statement optimization process, we often use hint, and now summarize the use of Oracle hint in the SQL optimization process:
1./*+all_rows*/
It is shown that the cost-based optimization method is chosen for the statement block, and the optimal throughput is achieved to minimize resource consumption.
For example:
SELECT/*+all+_rows*/emp_no,em
The ORACLE tutorial is: Oracle SQL Performance Optimization Series 2.4. Select the most efficient table name sequence (only valid in the rule-based Optimizer)The ORACLE parser processes the table names in the FROM clause in the order FROM right to left. Therefore, the table
oracle| optimization
1. The statements that have been validated are exactly the same as those already in the shared pool
2. Variable names as consistent as possible
3. Rational use of outer joins
4. Use fewer layers of nesting
5. Multi-use concurrency
The optimization steps for a statement are generally:
1. The SGA area is adjusted so that the SGA area is optimally used.
2. optimization of the
joins the video club. The owner or administrator can enter, save, and query related information of each album and each member as needed. Use Oracle SQL developer data modeler design to generate code.Because images and other content cannot be inserted, only generated code is published first.The first time the content was published, the Experts laughed.
SQL Getting Started Tutorial
1) from phase
This phase is the first step in the query logic processing. Thinking of this, I think the LINQ expression is not from the beginning, it seems to be quite reasonable. The From phase is responsible for representing the table or the table to query. If you specify table operators, you also need to process the operators individually, in left-to-right order. Table oper
Oracle multi-Table query, as its name implies, queries the data you want from multiple tables. Here we will test the emp table and dept table under the scott user. The structure of the two tables is as follows:SQL> select * from dept;DEPTNO DNAME LOC-------------------------------------10 ACCOUNTING NEW YORK20 RESEARCH DALLAS30 SALES CHICAGO40 OPERATIONS BOSTON
SQL> select * from emp;
EMPNO ENAME JOB MGR HI
Common Oracle SQL skills (conversion) and oraclesql skills
1. Avoid "*" in the SELECT clause.When you want to list all columns in the SELECT clause, using dynamic SQL COLUMN reference '*' is a convenient method. unfortunately, this is a very inefficient method. in fact, ORACLE converts "*" into all column names in sequ
:
SELECT * FROM(SELECT z.type , z.code ,ROW_NUMBER()OVER(PARTITION BY z.type ORDER BY z.code) AS code_idFROM group_info z)WHERE code_id =1;
The over () mentioned here is an oracle analysis function.
Refer to the SQL reference document:
Analytic functions compute an aggregate value based on a group of rows. They differ from aggregate functions in that they return multiple rows for each group.Analytic functi
perform organizational connections in the memory.
Finally, we would like to discuss the subquery unnested feature. In most cases, we think that Oracle can generate better execution plans. However, in practice, we have also found many such scenarios: The subquery speed is very fast and the data volume is small, but the speed is slow after the connection. The result is that the subquery in the execution plan is opened.
By default,
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.