Alibabacloud.com offers a wide variety of articles about sql server responding slow, easily find your sql server responding slow information here online.
(OrdID, ordRow, Item, Qty) VALUES ('20170901', '01', 'g4385', 5) \ n'; strSQL = 'Insert INTO OrderRows (OrdID, OrdRow, Item, qty) VALUES ('20170101', '02', 'g4726', 1) \ n'; strSQL = 'commit TRANSACTION \ n '; StrSQL = 'set XACT_ABORT OFF \ n'; objDBC. execute (strSQL); where the SET XACT_ABORT OFF statement tells SQL Server that if an error occurs during the following transaction processing, the completed
, the second is to not destroy the index)3. Too much data (sub-database table)4. Server tuning and individual parameter settings (adjustment my.cnf)Second, when analyzing the reasons, we must find the starting point:1. First observe, turn on the slow query log, set the appropriate thresholds (for example, more than 3 seconds is slow
reverse DNS resolution in the configuration file by simply adding the following line to the MY.CNF [MYSQLD] paragraph:Skip-name-resolve (Windows is the same as Linux)
Table Cache
--View the number of open tables show global status like ' open%tables% ';--View cache's upper limit value show variables like ' Table_open_cache ';Open_tables: Is the number of tables currently open in the cache.Opened_tables: Is the number of open tables since MySQL started.When the Opened_tables value
Label:Written in the first About the start and configuration of slow SQL before I clean up the article: Http://www.cnblogs.com/hanxiaobei/p/5515624.html Prerequisite Preparation: tomcat7.x Mysql--perfteach Jmeter Test interface: 192.168.1.102:8081/perfteach/slowquery?cardno=1000009 Script writing: Single interface test JMeter is more convenient, so this article is tested with JMeter Environment Constructio
Label:Environment: Server-side SDE 10.0 Oracle 11.2, client plsql 11,oracle 11.2 For debugging convenience, the following test is to extract SQL to do on the Plsql
Demand is known as the point coordinate of a polygon, to be in a line layer, do relational intersect spatial query, the original SQL is this Select LNO from
hsline T
where Sde.st_intersect
internal control of MySQL, a lot of data is not very prepared, now generally used to check the historical dataThe disadvantage of the second approach: because it is only run once a week, a lot of things can not find and alarmThe downside of the third approach: when the nodes are slowlog very much, top10 becomes meaningless, and often gives you the regular task statements that are sure to run. Reference is of little valueSo how do we solve and query these problems?
For troubleshooting problem f
When the slow_query_log value is on (the default value is off, the default value is 10 s, and accurate to microseconds), the default value (when the log_output value is fifl) will record this slow query: the slow_query_log_file value is specified in the file.Mysql> select @ Global. log_output;+ --------------------- +| @ Global. log_output |+ --------------------- +| File |+ --------------------- +1 row in SET (0.00 Sec)
Note that mysql5.1 supports st
Unlocked update NOLOCK unlocked unlocked unlocked unlocked HOLDLOCK shared share share update UPDLOCK error update update update TABLOCKX error unlocked Lock updates Other unlocked unlocked unlocked updates * Specifies that the NOLOCK prompt will cause the table specified for that hint to be read-only in Gianpene.
16, with Profiler to track the query, get the time required to find out the problem of SQL; optimizing indexes with the index optimizer
17
| | ' | ' | | Fcm_recv_wait_time | | ' | ' | | Fcm_send_wait_time from (SELECT * from TABLE (mon_get_pkg_cache_stmt (null, NULL, ' Script descriptionThis script is a script that crawls slow SQL and needs to be executed every 5 minutes on the database server.
Each execution of the script fetches an SQL s
(Sp_spaceuse)3) Upgrading hardware4) According to the query criteria, index, optimize the index, optimize access mode, limit the data volume of the result set. Note that the fill factor is appropriate (preferably using the default value of 0). The index should be as small as possible, using a Lie Jian index with a small number of bytes (refer to the creation of the index), do not Jianjian a single index on a limited number of values such as the gender field5) Improve speed;6) Expand the memory
Label:
1. Using SQL Dynamic View
As follows: Select Top B.text, A.total_worker_time,a.total_logical_reads,a.total_elapsed_time,execution_count
from sys.dm_exec_query_stats a
Cross as b
Order by Total_worker_time/desc View the online Help document view: Sys.dm_exec_query_stats can get all the field meanings, mainly Total_worker_time: Total CPU consumption time Total_logical_reads: Number of logical Reads Total_elapsed_time:
Why write through the linked server, the speed is very slow because when the link server is written, line-by-row write to the database, row by line INSERT, trigger trigger, and so on, write a few lines of data, triggered several triggers, inserted,deleted and other system tables each time only one row of data If the same serv
Mysql uses profiling to analyze the causes of slow SQL statements.
CleverCode colleagues recently recommended a mysql SQL statement analysis tool profiling, and found that this tool is very good, it can accurately analyze the specific time spent on SQL statements during the Query Process. CleverCode will be summarized
Tags: query statement default query delete MyISAM status join file pictureFor slow SQL optimizations, you can generally follow the following steps:1, turn on slow query log, set more than a few seconds for slow SQL, crawl slow SQL
in the internal control of MySQL, a lot of data is not very prepared, now generally used to check the historical data
The disadvantage of the second approach: because it is only run once a week, a lot of things can not find and alarm
The downside of the third approach: when the nodes are slowlog very much, top10 becomes meaningless, and often gives you the regular task statements that are sure to run. Reference is of little value
So how do we solve and query these problems?
For troubleshoot
the internal control of MySQL, a lot of data is not very prepared, now generally used to check the historical data
The disadvantage of the second approach: because it is only run once a week, a lot of things can not find and alarm
The downside of the third approach: when the nodes are slowlog very much, top10 becomes meaningless, and often gives you the regular task statements that are sure to run. Reference is of little value
So how do we solve and query these problems?
For troubleshooting pr
Label:These two days encounter a problem in the. NET developed Web site, execute SQL queries, monitor the card from SQL Profiler to see, execution time 22s.But the copied SQL is executed directly in Management Studio with a time of only 4ms.The solution is as follows, adding "SET ARITHABORT on;" in the SQL statement.So
Label:Today, I ran into a problem with a Sybase database query. A simple SQL, but do not know why the query does not come out, resulting in the production of the production server frequently hang out. Scared my little heart to bang. Select as Fcilcde from dnd_event_log A WHERE a.doc_ref =? and A.doc_type =? ' S ' Later, the network Operations Manager, the original customer passed the parameter contai
Label:A MySQL database has several configuration options to help us capture inefficient SQL statements in a timely manner1,slow_query_logThis parameter is set to on to capture an SQL statement that executes longer than a certain number.2,long_query_timeWhen the SQL statement execution time exceeds this value, it is recorded in the log and is recommended to be set
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.