当前位置:网站首页>Database tuning solution
Database tuning solution
2022-07-05 21:58:00 【Short section senior】
Factors affecting system performance
There are many factors that affect system performance , In order to better analyze these factors that affect the system performance , These factors can be divided into 6 Categories: :
Server hardware class
Operating system class
Network class
SQL Server System class
Database application class
Customer application class
Strategies for performance monitoring and tuning
Monitoring and adjusting system performance is a comprehensive problem , There is no fixed pattern . however , It is necessary to understand and master the framework steps of monitoring and adjusting the system .
The framework steps of monitoring and adjusting the system are as follows :
Develop strategies for monitoring and adjusting the system
Choose a scheme to adjust performance
Develop specific methods for performance monitoring and tuning
Establish the performance baseline of the system
Detect performance bottlenecks
Understand common monitoring tasks
SQL Server Profiler
SQL Server Profiler Tools can be used to track various activities of servers and databases . These activities can be captured in the table 、 File or a script file , For later analysis .
Use SQL Server Profiler The process of the tool includes creating a trace 、 Run and reproduce tracking, etc .
Common monitoring and adjustment tasks
Common monitoring and adjustment tasks include monitoring memory usage 、 Monitor thread and processor usage 、 Monitor the input of the hard disk / Output 、 Monitor lock information and query statements with poor performance . Commonly used counters for monitoring system performance .
Methodology of performance tuning

How to design a good relational database architecture
Judgment of data hot area
Define the index according to the data hot area 、 Table split definition
Optimize SELECT Inquire about
Try to store data in the same table
Use index and index coverage policy
Optimize UPDATE Business
Try to put the data that needs to be updated in a smaller table
Optimize DELETE Business
Evaluate the effect of partitions in large-scale deletion
Optimize INSERT Business
Reduce dependence on automatic numbering
Use valid query parameters
SARGs( Valid format of query parameters )
Limit to full compliance 、 A range of values 、 Or with AND Connect more than two items to define the search .
Format
Data field Partial operators < Constant or variable >
< Constant or variable > Partial operators Data field
accord with SARGs Example of
FirstName=‘ king ’
6000060000
Easy mistakes
Operate on data fields
Select * from Employees where LastName+’,’+FirstName=‘Davolio,Nancy
Make a negative query
Not、Exists、Not IN、Not Like、!= <> !> !< etc.
stay where Use functions for data fields in statements
Select * from [order details] where ABS(quantity-100)<1
Use OR Operator
Use OR Do operators , You need all fields to have available indexes
Query optimization
Use T-SQL Precautions for
Select grammar
Try not to return all fields in the data table without configuring filter conditions
If composite index is used , Then the first field in the index order is suitable for filtering
Distinct,Order by Wait for the syntax to be used when the query results are needed
Union All than Union good
If the connection transaction level is not reduced to Read Uncommited, Or through the lock prompt NOLOCK To reduce the chance of congestion , Best configuration SET LOCK_TIMEOUT Options , Avoid users' endless waiting
Insert、Delete and Update
When a large number of batch data operations , nothing Log The behavior must be better than writing data twice ( First record Log Write the database again ) fast .
stay Update and Delete use Where When clause , Remember to meet the conditions SARGs Format
Query tuning options
Use OPTION Clause call table prompt or view prompt
OPTION (TABLE OPTION(dbo.Orders, IDNEX(IX_OrderID)))
FORCESEEK Tips
FROM Orders WITH (FORCESEEK)
OPTION (TABLE HINT(dbo.Orders, IDNEX(0), FORCESEEK))
sys.fn_validate_plan_guide Function is used to verify the effectiveness of the mandatory plan
Program guide support XML ShowPlan Parameters
A new event class is designed for monitoring mandatory plans (Plan Guide Successful and Plan Guide Unsuccessful) And performance counters (SQL Server SQL Statistics Under the object Guided Plan Executions/sec The counter and Misguided Plan Executions/sec Counter )
Welcome to join me for wechat exchange and discussion ( Please note csdn Add )
边栏推荐
- The American Championship is about to start. Are you ready?
- HDU 4391 Paint The Wall 段树(水
- ICMP introduction
- The real situation of programmers
- How can Huawei online match improve the success rate of player matching
- MySQL disconnection reports an error MySQL ldb_ exceptions. OperationalError 4031, The client was disconnected by the server
- oracle 控制文件的多路复用
- Regular expressions and re Libraries
- HDU 4391 paint the wall segment tree (water
- Daily question brushing record (XIV)
猜你喜欢

Ethereum ETH的奖励机制

Parker driver maintenance COMPAX controller maintenance cpx0200h

怎么利用Tensorflow2进行猫狗分类识别

Oracle checkpoint queue - Analysis of the principle of instance crash recovery

Shell script, awk uses if, for process control

Making global exception handling classes with aspect

Experienced inductance manufacturers tell you what makes the inductance noisy. Inductance noise is a common inductance fault. If the used inductance makes noise, you don't have to worry. You just need

MMAP learning

How to view Apache log4j 2 remote code execution vulnerability?

AD637使用筆記
随机推荐
sql常用语法记录
SQL knowledge leak detection
HYSBZ 2243 染色 (树链拆分)
Hysbz 2243 staining (tree chain splitting)
Implementing Lmax disruptor queue from scratch (IV) principle analysis of multithreaded producer multiproducersequencer
EL与JSTL注意事项汇总
Huawei fast game failed to call the login interface, and returned error code -1
Parker driver maintenance COMPAX controller maintenance cpx0200h
微服務鏈路風險分析
How can Huawei online match improve the success rate of player matching
Recursive query of multi-level menu data
Matlab | app designer · I used Matlab to make a real-time editor of latex formula
华为云ModelArts文本分类–外卖评论
AD637使用笔记
Implementing Lmax disruptor queue from scratch (IV) principle analysis of multithreaded producer multiproducersequencer
Robot framework setting variables
Decorator learning 01
AD637使用筆記
Advantages and disadvantages of the "Chris Richardson microservice series" microservice architecture
About the writing method of SQL field "this includes" and "included in" strings