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.
follows
Copy Code
Mysqladmin-uroot--password= ' password ' status
The results shown are as follows:
The code is as follows
Copy Code
uptime:87117 threads:1 questions:5481626 Slow queries:16 opens:2211 Flush tables:1 Open tables:512 queries per Seco nd avg:62.923
You can also add the-I 5 parameter to automatically refresh every five seconds.
The code is as follows
Copy C
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
Tags: using ar sp data div art on BS sizePaged query statements that are used in different databases:Current page: CurrentPagePage Size: pagesize1. Oracle DatabaseSELECT * FROM (select A.*,rownum rn from (query_sql) A) where Rn Note: query_sql is a query SQL statement.OrSELECT * FROM (select RowNum rn,id from TABLENAME
', ' 11451 ') and (g.user_id = U.useridand g.is_up = ' true ' and g.checks = 1AND g.disabled = ' false ' And u.disabled = ' false ' and U.checkid = 2) LIMIT 50The above SQL runs for dozens of seconds because the data is a bit more, and then I use Explan.The index of walking is IND_IS_UPAnd then look at the is_up of how much data, in fact, are all true, so the ind_is_up here is not really interesting.So we're going to go back to the
=4254 DEFAULT CHARSET=utf8;
Index Optimization: G table mid plus index; M table status and WID index; slow query to see if the index is used, try to make the rows count small dot
Build an index
To index (ID,WID,WXID,WID_WXID) in the member table
To index (ID,WID,MID,AUTH_WID,WXID) in the gift table
If you often have fields in the Where condition, you also need to index them.
Label:Objective
On a relational database commonly used SQL statement syntax is mainly relational database general structure, this paper discusses the relational database query SQL syntax.
Grammar Review
Run the status command to view the Slow queries item. If the value is greater than 0 for a long time, the query execution time is too long.Copy codeThe Code is as follows:Reference content is as follows:Mysql> status;--------------Mysql Ver 11.18 Distrib 3.23.58, for redhat-linux-gnu (i386)Connection id: 53Current database: (null)Current user: root @ localhostCur
Now we have a situation ~ In master-slave synchronization, the slave database always has slow query logs on the slave database.
For example, 1000 people run this program.
There will always be a few that will take 2 seconds to run, and other people will be seckilling ..
Have you ever encountered this kind of si
AskSQL Server database queries are slow for a number of reasons, and are common in the following ways: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 n
Phenomenon:PHP query database is slow, about 60s after Nginx return 504:sorry, the page you are looking for is currently unavailable.Check log:Find/var/log/nginx/access.log and/var/log/nginx/error.log from/etc/nginx/nginx.confLog display upstream timed out (110:connection timed out) while reading response headers from upstreamWorkaround:Nginx upstream timed out (
Objective
In the last article, we analyzed how the query optimizer works, including: detailed operation steps of the query optimizer, filtering condition analysis, index item optimization, and so on.
In this article we analyze the detection of several key metric values during the course of our operation.
The operation problem of the statement is analyzed by these index values, and the optimization method
Oracle DatabaseWhat is the reason for the slow execution of GUID as the primary key? Next we will start to introduce it. First, introduce the environment. The database uses Oracle10g. All character fields are varchar2 [1]. All primary keys use Guid, which is of the varchar2 (36) type in the database. Corresponding, the
Label: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, Mysqld writes a full execution time of more than Long_ Query_time The log file of the SQL statement for the second,
beginning of all stored procedures and triggers, and set nocount off at the end. You do not need to send the DONE_IN_PROC message to the client after executing each statement of the stored procedure and trigger.29. Avoid large transaction operations as much as possible to improve the system concurrency capability.30. Avoid returning a large amount of data to the client as much as possible. If the data volume is too large, consider whether the corresponding requirements are reasonable.
Articles
ObjectiveRecently help the company to optimize the database, with the previous learning, step-by-step learning knowledge for practice, finally is the speed rub up, a query originally to execute more than 1 minutes now only need 3 seconds.Now the study of what they think and use to summarize, on the one hand to consolidate knowledge, on the other hand to the vast number of students to reference.This set of t
SelectTest1.*,test2.* fromTest1Inner JoinTest2 onTest1.1=Test2.1//Internal connection
Select test1.*,test2.* fromTest1 Right outer JoinTest2 onTest1.1=Test2.1//Outer connection 1.1 right outer connection, the display of the Test2 table data is the main, the left side of the table without restrictions usually omitted outer
Selecttest1.*,test2.* fromTest1 Left outer JoinTest2 onTest1.1=Test2.1//1.2 left outer connection
Selecttest1.*,test2.* fromTest1 Full outer JoinTest2 onTest1.1=Test2.1//1.3
party)))'
The Data Link name is the service name of the Tree node added to the local Oracle Database Console (Oracle Enterprise Manager Console ).The TableName statement is as follows:SELECT field name FROM TableName @ Data Link name;
Copy table data:
Insert into Table Name (field name) (SELECT field name FROM TableName @ Data Link name );
View DBLINK:
Select ow
Through the status command, view slow queries this item, if the value is long >0, the query execution time is too long
Copy Code code as follows:
The following are the referenced contents:mysql> status;
--------------
MySQL Ver 11.18 distrib 3.23.58, for Redhat-linux-gnu (i386)
Connection id:53
Current database: (NULL)
Current User:r
Tester email feedback: the connection to the database order is very slow, or even cannot be connected. I want to check it. See Oracle @ wdatest11 :~ Appadminwdadb
Tester email feedback: the connection to the database order is very slow, or even cannot be connected. I want to
Oracle Database Console (Oracle Enterprise Manager Console ).The TableName statement is as follows:SELECT field name FROM TableName @ Data Link name;
Copy table data:
Insert into Table Name (field name) (SELECT field name FROM TableName @ Data Link name );
View DBLINK:
Select owner, db_link from dba_db_links;
Delete:
Drop d
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.