50 methods to skillfully optimize your SQL Server database
There are many reasons for slow query speed. The following are common causes:
1. No index or no index is used (this is the most common problem of slow query and is a defect in programming)
We know that statistics directly determine the execution plan produced by the relational engine.ArticleTwo examples are demonstrated.
1,Impact of statistical information on connection modes
2,Impact of statistical information on data acquisition
Specifies whether Microsoft SQL Server automatically rolls back the current transaction when a running error occurs in a Transact-SQL statement.
SyntaxSet xact_abort {on | off}
NoteWhen set xact_abort is on, if a running error occurs in a
1. No index or no index is used (this is the most common problem of slow queryProgramDesign defects)2. Low I/O throughput, resulting in a bottleneck effect.3. the query is not optimized because no computing column is created.4. Insufficient memory5.
Default behavior
The default value is set xact_abort off, with no transaction behavior.
Set
Xact_abort
On
Set xact_abort on can be divided into two types:
1. Overall commit or overall rollback as a transaction, in the format:
Syntax
Set xact_abort {on | off} Note
When set xact_abort is on, if a running error occurs in a Transact-SQL statement, the entire transaction is terminated and rolled back. When it is off, only the wrong Transact-SQL statement is returned, and
A person asked me a few days ago about the duplicate serial number. I thought about it. Although it is simple but extensive, I wrote this blog to introduce it and hope it will help you.
When developing database applications, you will often encounter
The paging stored procedure for SQL Server 2005 is divided into 3 versions, one that has not been optimized, one that is optimized, the last to support join, the SQL Server 2000 paging stored procedure, or run on SQL Server 2005, but the performance
Deadlock in SQL Server refers to a state of permanent blocking between processes, and the following will show you how to detect SQL Server deadlocks in the hope of helping you.
Deadlock (deadlock) refers to a state where processes are permanently
Similarly, backing up the transaction log only truncates the part of the transaction log for inactive transactions, so open transactions can cause more logs (or even physical limitations) until the transaction is committed or rolled back.
To find
A database is a shared resource that is used by multiple users, and when more than one user accesses the data concurrently, multiple transactions are generated in the database and the same data is accessed at the same time. Without control of
Http://www.diybl.com/course/7_databases/oracle/oraclejs/20100713/436400.html
There are a number of reasons why queries are slow, often as follows:
1, no index or no index (this is the most common problem of query slow, is the defect of program
server| Data | database | optimization
There are a number of reasons why queries are slow, often as follows:
1, no index or no index (this is the most common problem of query slow, is the defect of program design)
2, I/O throughput is small,
Myth #26: There is a real "transaction nesting" in SQL Server
Error
Nested transactions do not appear to allow transaction nesting as their syntax behaves. I don't know why anyone would write code like that, and the only thing I could think of was
The garden has a very good article about SQL Server transaction isolation, feeling a lot of the introduction from the concept, for those beginners, see the touch of understanding is profound, so no longer repeat, the emphasis is on the example
Data manipulation language (manipulation Language,dml) includes insert, delete, and update statements for adding, deleting, and modifying data.
This article uses the following table Tb_employeeinfo as an example to illustrate:
CREATE TABLE
Q. How do I solve one of the problems that the database is marked as "suspect" (general solution)?
A. Phenomenon: Error 926
Severity Level 14
Error message Text
Database ' xx ' cannot be opened-it has been marked suspect by recover explanation
(
A well-designed, performance-capable database engine can easily serve thousands of users at the same time. And the "weak" database system with more users to access the system will greatly reduce its performance. In the worst case, it could even
See title
Prerequisites Autocommit=false Melt-off level is read commit, do not use statement lock
When a sentence goes wrong, it does not change the data itself, it does not change the data, there is no lock resources, so do not rollback
This is
1, no index or no index (this is the most common problem of slow query, is the defect of program design)2, I/O throughput is small, forming a bottleneck effect.3. No computed columns are created, resulting in queries not being optimized.4.
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.