Learn about sql query tuning techniques in oracle, we have the largest and most updated sql query tuning techniques in oracle information on alibabacloud.com
Essential SQL query optimization techniques to speed up Website access and SQL access
In this article, I will introduce how to identify queries that cause performance problems, how to locate their problems, and how to quickly fix these problems and other methods to speed up the que
requires a sort operation, while the others need to perform at least two sorting. Typically, SQL statements with union, minus, and intersect can be overridden in other ways. If your database is well-sort_area_size, using union, minus, intersect can also be considered, but they are very readable.(34) Optimize GROUP by: Increase the efficiency of the group BY statement by filtering out unwanted records before group by. The following two queries return
Tags: Wildcard time example log action single quote use Cape includesReprint: http://new-restart.iteye.com/blog/1416765 SQL like wildcard character fuzzy query techniques and special charactersSQL like wildcard character fuzzy query techniques and special characters How to d
.24. If a temporary table is used, be sure to explicitly delete all temporary tables at the end of the stored procedure, TRUNCATE table first, and then drop table, which avoids longer locking of the system tables.25. Avoid using cursors as much as possible, because cursors are inefficient and should be considered for overwriting if the cursor is manipulating more than 10,000 rows of data.26. Before using a cursor-based method or temporal table method, you should first look for a set-based soluti
'! 'Select 1 where '%abcde ' like ' #%abcde ' escape ' # 'Select 1 where '%abcde ' like ' @%abcde ' escape ' @ 'Select 1 where ' [ABCDE ' like '![ ABCDE ' escape '! 'Select 1 where ']abcde ' like '!] ABCDE ' escape '! 'The rule is to make escape characters with the characters immediately following the escape. The character after escape is equivalent to the escape character '/' in the C language string.Finally, look at a more complex match.Select 1 where ' [^a-z]abcde ' like '/[/^a/-z/]% ' escap
Tags: RAC single quotation mark contains Val data dash ast AC wildcardTransfer from http://new-restart.iteye.com/blog/1416765SQL like wildcard character fuzzy query techniques and special charactersHow to deal with time query by 1,sql likeThere are savetime (smalldatetime type) fields in the
After sqlserver2005, MSSQL began to use the recursive query method. Compare the methods for writing stored procedures or functions at the beginning. This method is simpler and more flexible.
Oracle also has its own tree structure recursive query method, connect
Next I will write a piece of SQL code by myself, and b
First, simple query
A simple Transact-SQL query includes only a picklist, a FROM clause, and a WHERE clause. They describe the query column, the table or view of the query, and the search criteria, and so on.
For example, the following statement queries the nickname field
31514.27 optimizing multiple subqueries with LEFT JOIN (i) 31714.28 optimizing multiple subqueries with LEFT JOIN (ii) 32014.29 optimizing multiple subqueries with LEFT JOIN (iii) 32214.30 removing the filter 324 caused by the exists14.31 Overlap Time Count 32514.32 overriding optimizations with analytic functions 32814.33 parts Suppliers of equal set 33414.34 Hangar of equal sets with pilot 33514.35 overriding the maximum filter condition with an analytic function 33814.36 finding data at a sp
example:
SELECT/*+full (BSEMPMS) Cahe (BSEMPMS) * * Emp_nam from Bsempms;
/*+nocache (TABLE) * *
When a full table scan is performed, the cache hint can place the retrieved block of the table in the buffer cache with the most recent LRU of the least list
For example:
SELECT/*+full (BSEMPMS) Nocahe (BSEMPMS) * * Emp_nam from Bsempms;
/*+append*/.
You can increase the speed by inserting it directly into the end of the table.
Insert/*+append*/into test1 select
= NULL; SET @Name = ' Ja '; SELECT * from studentwhere (@ID = 1 OR stuid = @ID) and (@Sex are null or stusex = @Sex) and (@Name is null or stuname like '% ' + @Name + '% ')Here declare three variables, as passed parameters, passed parameters have a default value, or NULL, we add in where to use or add judgment, first Judge @ID =-1, if the condition is established, or will not judge the condition after or, to here (@ID = 1 OR stuid = @ID) Returns a true, equivalent to where true and ..., so it i
more time will be spent
(4) Reduce the number of accesses to the database:
Oracle has done a lot of work internally: Parsing SQL statements, estimating index utilization, binding variables, reading chunks, etc.
(5) Reset the arraysize parameters in Sql*plus, sql*forms and pro*c to increase the amount of retrieved d
How does the column selection differ when Oracle queries are converted to SQL queries? The following describes how to select columns from Oracle query to SQL query. We hope that you can have a deeper understanding of
. The WHERE and order statements of the LEFT join can be written after the on statement9, the internal connection is equivalent to the direct where two table fields are equal, only two tables matching data appearsFully connected two tables all records appear, mismatched items are displayed as nullThe left and right connections can be written in the where association, just like the normal two tables, but with the (+) in front of the table condition:Select a.code_id,b.* from AD_HP A, Bureau bwhere
How can I convert Oracle queries to queries in the SQL database? The following describes how to convert an Oracle query to an SQL query. If you are interested in Oracle
When converting Oracle queries to SQL queries, you need to pay attention to a lot of issues. The following gives you a detailed analysis of the number trade-offs in converting Oracle queries to SQL queries for your reference.
Number trade-offs
Oracle Database has a TRUNC f
First, simple query
SQL (structured query Language) Structured Query language is a database query and programming language for accessing data and querying, updating, and managing relational database systems. ANSI (American National Standards Institute) claims that
Optimization tips for SQL statements with millions of records in ORACLE 1. To optimize queries, try to avoid full table scanning. First, you should consider creating an index on the columns involved in where and order. Www.2cto.com 2. try to avoid null value determination on the field in the where clause. Otherwise, the engine will discard the index and perform full table scanning, for example: select id fr
Steps for Oracle to execute SQL query statements and oraclesql query statements
Steps for Oracle to execute SQL query statements
If you enter the following
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.