Alibabacloud.com offers a wide variety of articles about sql query running slow oracle database, easily find your sql query running slow oracle database information here online.
, including average, minimum, maximum, Rows examined, and number of scanned Rows. It can also generate table reports and store analysis results. Here we will not introduce them one by one.
Through these slow log analysis software, you can find that the slow query statement has completed most of the SQL optimization. Ru
limit the number of rows returned by the user or set rowcount to restrict the operation of the line22, in the SQL2000 before, generally do not use the following words: "Is NULL", "23. Use Query Analyzer to view query plans for SQL statements and evaluate whether the analysis is optimized for SQL. The average 20% of th
statement query plan and evaluate and analyze whether the SQL statement is optimized. generally, 20% of the Code occupies 80% of the resources, and our optimization focuses on these slow points.
24. If the in or query is not indexed, use the display statement to specify the index: Select * From personmember (Index = i
Label:This article is a guide: how to find inefficient SQL statements in MySQL? This may be a problem for many people, and when MySQL uses the slow query log to locate those SQL statements that perform less efficiently, and start with the--log-slow-queries[=file_name] option
horizontal partition table, reduce the size of the table (Sp_spaceuse) 3, upgrade hardware 4, based on 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
Analyze the 48 causes of slow SQL query. There are many reasons for slow query speed, which are common in the following ways: 1. No index or no index is used (this is the most common problem of slow
SQL2000, do not use the following words: "Is null", "
23. Use query analyzer to check the SQL statement query plan and evaluate and analyze whether the SQL statement is optimized. Generally, 20%CodeIt occupies 80% of the resources, and our optimization focuses on these slow
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
Oracle user.
Connect the database to the sysdba user.
% Sqlplus/nologSql> Conn/as sysdba;Connected.
Increase the "reserved pool" ratio of the Shared pool .
Sql> alter system set "_shared_pool_reserved_pct" =10 scope=spfile;
Reduce the minimum request size for "Reserved Pool".
Sql
Tags: mysql index data table sql slow query tease brother AutomationWhen the MySQL server is abnormal ( slow ), first of all to consider whether the SQL statement caused the database slow
Reasons for slow query speed in Database Analysis: 1. No index or no index is used (this is the most common problem of slow query and is a defect in programming) 2. Low I/O throughput, resulting in a bottleneck effect. 3. the query
How to query slow SQL statements in MySQL
1. query logs
(1) enabling MySQL slow query in Windows
In Windows, the configuration file of MySQL is usually my. ini. find [mysqld] and add
The code is as follows:
Log-
Tags: SQL statement ASE log HTTP Query general table variables SSL Opening the general log will log all SQL statements that arrive at MySQL server. Generally does not open the function, because the amount of log can be very large. However, in some cases, the general log may be temporarily opened for use by a barrier.The relevant parameters are 3:general_log, Log_
the table vertically and horizontally to reduce the table size (sp_spaceuse) 3) upgrade hardware 4) Create an index based on the query conditions, optimize the index, optimize the access mode, and limit the data volume of the result set. Note that the fill factor should be appropriate (preferably the default value 0 ). The index should be as small as possible. Use a column with a small number of bytes to create an index (refer to the index creati
Tags: index solution based on keyword har results in SQL Server failure efficiencyProblem: There's a lot of data on both tables. The A1 field in a table needs to be associated with the B table primary key query A1 field stores multiple B table primary keys The format is: Format 1:B1,B2,B3 Format 2:B4 Format 3:b5,b6 Comma-delimited minority This leads to the use of like '%...% ', charindex, or replace (A1,B1
' or nid in (11,22,33); REF Find one or more values based on an index SELECT * from tb1 WHERE name = ' seven '; Eq_ref Use primary key or unique type when connecting Select Tb2.nid,tb1.name from TB2 left join tb1 on tb2.nid = Tb1.nid; CONST Constant The table has a maximum of one matching row, because only one row, the column values in this row can be considered constants by the remainder of the optimizer, and the const table is fast because they are read only once. Select Nid from tb1 where
Mysql database enables slow query logs and mysql database logs
Modify configuration file
Add the following two sentences to the configuration file my. ini:
1 log-slow-queries = C: \ xampp \ mysql_slow_query.log2 long_query_time = 3
The first statement is used to define t
], [TYPE] Has SELECT, CREATE, DROP, UPDATE, INSERT, for example, "+ SELECT, INSERT". The default value -, that is, it is not included.Db: the log of the database to be processed.Top: the number of first entries sorted by rules.Sort: sort by certain rules, t_sum: sort by the total time; c_sum: sort by the total number of times; c_sum_p: percentage of the number of SQL statement executions to the total number
slow_query_log,
Log_output = table, File # The log output will write tables and log files. To facilitate program statistics, it is best to write tables.
# General_log_file is not configured here, So general_log will only write the table
# In mysql5.1.29 or later, set the following to enable mysql to record the executed SQL statements in the file
General_log_file =/log/general. log
#5.1.29 previously:
# Log =/var/lib/mysql/
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.