Read about how to optimize sql query using execution plan, The latest news, videos, and discussion topics about how to optimize sql query using execution plan from alibabacloud.com
SQL query optimizes the where condition sorting fields and the mysteries of using the index by limit.Strange slow SQL
Let's take a look at two SQL statements.Article 1:
Select * from acct_trans_log WHERE acct_id = 1000000000009000757 order by create_time desc limit 100000000
Label:Believe a lot of friends in Plsql Developer debugging Oracle , often encountered in Plsql developer execution of a certain SQL statement is not saved, then we in Plsql Developer how to find the SQL statements we executed, in fact, by the following methods are easy to achieve.First open the Plsql developer tool and create a new
Transact-SQL command:
SET STATISTICS IO ON
SET STATISTICS TIME ON
Once the preceding preparation is complete, run the following query:
SELECT * FROM [order details]
Display result:
SQL Server parse and compile time: (SQL Server Parsing and Compilation time :)CPU time = 10 ms, elapsed time
Recently has been studying the blog, in fact, is now a popular self-media, it is interesting that the netizens have written their own blog, the establishment of a small station, and now went to the platform for others to work free, but also enjoy themselves, do not know what the situation.Blog information:Topics: Learning topics related to reading notes.Web site: Use a. NET domain name as the URL.Content: Writing and contributing, such as: Camel Xiangzi good word good wordsThis system uses
Analysis of SQL statement execution time and resource consumption using profilessql
Open profiling, which is disabled by default.
mysql> set profiling=1;
Execute the SQL statement to be analyzed
mysql> select count(1) from wechat_employee,Employee;
Show profiles table
mysql> show profiles;
Statement | Execution after learning the structure and purpose of a SELECT statement, you should learn how to use it. Under the database tools you have, this may mean that you have to press a button that says "execute." On an ASP Web page, you can execute an SQL statement immediately or as a stored procedure call.
Once you have created the SQL statement, you mus
Label:Use the following statement to find the most frequently executed SQLDB2 SELECT * FROM Sysibmadm. Snapdyn_sql ORDER BY Num_executions Desc,total_sys_cpu_time_ms desc FETCH first 205 rows only >>D:\NUM_EXECUTIONS.T XtThe file that opens the output appears as follows:Determine if there is a problem based on the number of executions. If you find that the number of executions is significantly higher, you should see if there is a problem in the program. In general, the basic data will be more th
Problem
Previously, we learned how to grant permissions using the EXECUTE AS command in SQL Server 2005, and you've seen how to grant granularity permissions with the EXECUTE AS clause. It is important to switch contexts within a programmable object such as a stored procedure or function, especially if the user accessing the stored procedure does not have sufficient permissions to run a block of code. But
Query Analysis | server | script
I like to think of the tools bundled with SQL Server as inverted pyramid, the tools for diagnosing and checking general problems at the top, looking for and diagnosing specific areas of problems at the bottom. In addition to providing a convenient way to write SQL scripts, Query Analyze
I gave you an introduction to WinDbg in the previous article and how you can attach to SQL Server. Today's article, we go ahead and I'll show you the steps required to debug a SQL Server query using WinDbg. Sounds interesting? Here we go!Suppose you have a simple query in fr
Tags: _id repos query Statement automatic learning experience query logs SQL definitionFirst, in the @entity annotated class to write a good foreign key relationship.This @ManyToOne annotation can establish a foreign key relationship, not in their own silly write a private int grades_id; After writing this note, it automatically adds the Classes table to the grad
Users use email as a user name landing, you need to check out an email corresponding to a record. Each user's email is unique.SELECT * from T_user WHERE email=?;The above statement implements a query email corresponding to a user information, but because the email column is not indexed , will result in a full table scan , the efficiency will be very low.SELECT * from T_user WHERE email=? LIMIT 1;Plus limit 1, as long as a corresponding record is found
methods just one more column of Rewnumber? Of course not, look at the internal differences:
On two SQL, add the following SQL separately, and use MS's include execution plan to facilitate viewing execution details:
SET STATISTICS time on
Oracle version: 10.2.0.1
OS: Linux 64-bit
Regular expressions are used in SQL:
Select count (*)
From t
Where regexp_like (T. Note, '^ (. | +) * (\ (either \) +', 'I ')
The first execution can be performed, the second execution reports ORA-7445, session interruption.
The records in the trace file are as follows:
Exception signal: 11 (SIGSEGV), Code: 1 (address
Tutorial on using the SQL search 1.1.6.1 edition SQL query and analysis tool in red gate Series
Red Gate SeriesArticle:
SQL compare 10.2.0.1337 edition, one of the red gate series, database comparison tool, complete cracking + tutorial
Red Gate Series ii
things to do all kinds of optimization, have not been how to improve Later, for the second way, the physical table is treated like this: use Column2 and #t共同去过滤TableA, wait until an intermediate result set, and then go to drive the other table Generated graphical execution plan, estimated two screens are not displayed, through step by step observation, looked for a long time, only to find that this differe
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.