-
makif
Junior Member
-
Posts: 31
Threads: 8
Joined: Jan 2019
Reputation:
0
02-17-2019, 11:55 PM
(This post was last modified: 02-17-2019, 11:56 PM by makif.)
(02-11-2019, 01:44 PM)php_rocs Wrote: @makif,
If queries are taking a long time then we need to look at whether or not the used tables need indexes. What queries are taking a long time to execute? Can you run an Explain on them?
for example count queries takes long time, query has joins and where and it locked all sessions.
and i check explaion other queries
-
makif
Junior Member
-
Posts: 31
Threads: 8
Joined: Jan 2019
Reputation:
0
(02-18-2019, 12:08 AM)php_rocs Wrote: @makif,
Can you show us examples of the queries that are running long? What tables are being used in the queries? What information did the explain give you on the queries?
t1 table has 22 millions rows
Code: EXPLAIN
SELECT COUNT(1) AS total
FROM t1 p FORCE INDEX (PRIMARY)
INNER JOIN t2 e ON p.c2= e.c1
WHERE `e`.`Type` IN ("PARKINGLOT","PARKINGVIOLATION","REDLIGHTVIOLATION","FORBIDDENTURN","ALPR","EMBEDDEDALPR","SECTIONSPEED","SENSOR_REDLIGHT","SENSOR_SPEED")
explanation show me, p not use key
-
makif
Junior Member
-
Posts: 31
Threads: 8
Joined: Jan 2019
Reputation:
0
(02-19-2019, 01:19 AM)php_rocs Wrote: @makif,
How long does it take for the query to run?
it takes more than a minute and it locked all session again.
does it suppose to lock just session which send request? or am i wrong
|