SQL statement optimization improves database performance and SQL statement database performance
In systems with unsatisfactory performance, apart from the fact that the application load exceeds the server's actual processing capacity, it is more
MS SQL Server Query optimization methodThere are many reasons for the slow speed of queries, which are common1, no indexes, or no indexes (this is the most common problem with query slowness, is the flaw in programming)2, I/o throughput is small,
The number of records in the database table is:
Sql> Select COUNT (*) from table_name t;
COUNT (*)----------6873
1, using the statistical results of COUNT (*):
Sql> alter session Set Nls_language = "American";
Session altered.
Sql> set timing on;Sql>
Recently, I encountered an ultra-poor SQL statement. The table name is processed because the SQL statement involves data from a certain tax bureau.
The original SQL statement is as follows:
Select * from (select T. zxid, T. GH, T. XM, T. BM, T.
The optimization of SQL statements is to convert poorly performing SQL statements into the same performance SQL statements with the same purpose.AI automatic SQL optimization uses AI technology to automatically rewrite SQL statements to find the
1. The difference between count (1), COUNT (*), and count (column name)Believe that you are always at work, or in the study of Count () in the end how to use faster. There has been a lot of doubt, some people say that count (*) faster, some people
First, let's look at the sample SQL statement to be parsed:
Copy codeThe Code is as follows: select * from dual
SELECT * frOm dual
Select C1, c2 From tb
Select c1, c2 from tb
Select count (*) from t1
Select c1, c2, c3 from t1 where condi1 = 1
Select
The optimization of SQL statements is to reduce the performance of SQL statementsConversionSQL statements with the same performance as the target. Artificial Intelligence automatic SQL optimization is the use of artificial intelligence technology,
In cases where null is not considered, if NULL participates in the aggregation operation, the aggregate function except COUNT (*) ignores null.Count (1) and count (primary key) both scan the primary key index to get the data,COUNT (*) is the scan
https://blogs.msdn.microsoft.com/apgcdsd/2011/01/10/sql-1/First, IntroductionA problem that is highlighted in front of many developers or database administrators is the performance of the database system. The performance of the system is not ideal
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.