Keyword

Please help, locked querries in db-->time outs

  • Dimitris Tsaknakis
  • Dimitris Tsaknakis's Avatar Topic Author
  • Offline
  • New Member
More
11 years 4 months ago #113991 by Dimitris Tsaknakis
Please help, locked querries in db-->time outs was created by Dimitris Tsaknakis
The hosting company said that there are querries creating that blocked all the database connection.

Particularly they said

That is the query that your developer needs to review.
That is what is causing the lock

3025410 680368_briefing 10.187.248.40:53345 680368_briefingnews Query 15
Sending data SELECT COUNT(*) FROM ere_k2_items as i LEFT JOIN
ere_k2_categories c ON c.id = i.catid LEFT JOIN ere_k2_tags_xref tags_xref
ON tags_xref.itemID = i.id LEFT JOIN ere_k2_tags tags ON tags.id =
tags_xref.tagID WHERE i.published = 1 AND i.access <= 0 AND

i.trash = 0 AND c.published = 1 AND c.access <= 0 AND c.trash = 0 AND (
i.publish_up = '0000-00-00 00:00:00' OR i.publish_up <= '2013-06-05
09:53:29' ) AND ( i.publish_down = '0000-00-00 00:00:00' OR i.publish_down
>= '2013-06-05 09:53:29' ) AND (tags.name) = '???????????'


This is probably the culprit
SELECT DISTINCT\n\t\t\t\tcats.title AS cat, \n\t\t\t\tusers.name AS
author,\n\t\t\t\tusers.email AS author_email,\n\t\t\t\tcats.section AS SID,
\n\t\t\t\tcontent.title AS title, \n\t\t\t\tcontent.introtext AS text,
\n\t\t\t\tcontent.created AS date, \n\t\t\t\tcontent.publish_up AS
date_publish,\n\t\t\t content.images AS images, \n\t\t\t\tcontent.id AS
IID,\n\t\t\t\tcontent.hits AS hits,\n\t\t\t\tcontent_rating.rating_sum AS
rating_sum,\n\t\t\t\tcontent_rating.rating_count AS
rating_count,\n\t\t\t\tCASE WHEN CHAR_LENGTH(content.alias)
\n\t\t\t\t\tTHEN CONCAT_WS(":", content.id, content.alias)
\n\t\t\t\t\t\tELSE content.id END as ID, \n\t\t\t\tCASE WHEN
CHAR_LENGTH(cats.alias) \n\t\t\t\t\tTHEN CONCAT_WS(":", cats.id,
cats.alias) \n\t\t\t\t\t\tELSE cats.id END as CID \t\t\t\t\t\n\t\t\tFROM
\n\t\t\t\tjos_content AS content \n\t\t\t\tLEFT JOIN
\n\t\t\t\t\tjos_categories AS categories \n\t\t\t\t\tON categories.id =
content.catid \n\t\t\t\t\n\t\t\t\tLEFT JOIN \n\t\t\t\t\tjos_sections AS
sections \n\t\t\t\t\tON sections.id = content.sectionid \n\t\t\t\tLEFT JOIN
\n\t\t\t\t\tjos_users AS users \n\t\t\t\t\tON users.id =
content.created_by\n\t\t\t\tLEFT JOIN \n\t\t\t\t\tjos_content_frontpage AS
frontpage \n\t\t\t\t\tON content.id = frontpage.content_id
\t\t\t\n\t\t\t\tLEFT JOIN \n\t\t\t\t\tjos_categories AS cats
\n\t\t\t\t\tON content.catid = cats.id \t\n\t\t\t\tLEFT JOIN
\n\t\t\t\t\tjos_content_rating AS content_rating \n\t\t\t\t\tON
content_rating.content_id = content.id\n\t\t\tWHERE \n\t\t\t\tcontent.state
= 1 \n\t\t\t\t\tAND categories.access <= 0 \n\t\t\t\t\tAND content.access
<= 0 \n\t\t\t\t \tAND categories.published = 1 \n\t\t\t\t\tAND (
content.publish_up = '0000-00-00 00:00:00' OR content.publish_up <=
'2013-06-05 10:03:53' )\n\t\t\t\t\tAND ( content.publish_down = '0000-00-00
00:00:00' OR content.publish_down >= '2013-06-05 10:03:53' )\n\t\t\t\tAND (
content.catid = 91 OR content.catid = 94 OR content.catid = 99 OR
content.catid = 100 OR content.catid = 101 OR content.catid = 104 OR
content.catid = 106 OR content.catid = 107 OR content.catid = 108 OR
content.catid = 109 OR content.catid = 110 OR content.catid = 112 OR
content.catid = 113 OR content.catid = 115 OR content.catid = 116 OR
content.catid = 117 OR content.catid = 118 OR content.catid = 119 OR
content.catid = 126 OR content.catid = 130 OR content.catid = 133 OR
content.catid = 140 OR content.catid = 141 OR content.catid = 144 OR
content.catid = 188 OR content.catid = 190 OR content.catid = 195 OR
content.catid = 197 OR content.catid = 198 OR content.catid = 201 OR
content.catid = 202 OR content.catid = 203 OR content.catid = 208 OR
content.catid = 209 OR content.catid = 210 OR content.catid = 211 OR
content.catid = 212 OR content.catid = 213 OR content.catid = 214 OR
content.catid = 215 OR content.catid = 216 OR content.catid = 217 OR
content.catid = 218 OR content.catid = 219 OR content.catid = 220 OR
content.catid = 221 OR content.catid = 222 OR content.catid = 226 OR
content.catid = 232 OR content.catid = 233 OR content.catid = 234 OR
content.catid 235 OR content.catid = 236 OR content.catid = 237 OR
content.catid = 238 OR content.catid = 239 OR content.catid = 240 OR
content.catid = 241 OR content.catid = 242 OR content.catid = 244 OR
content.catid = 266 OR content.catid = 267 OR content.catid = 269 OR
content.catid = 270 OR content.catid = 271 OR content.catid = 272 OR
content.catid = 273 OR content.catid = 274 OR content.catid = 275 OR
content.catid = 276 OR content.catid = 277 OR content.catid = 278 OR
content.catid = 282 OR content.catid = 283 OR content.catid = 284 OR
content.catid = 285 OR content.catid = 286 OR content.catid = 287 OR
content.catid = 288 OR content.catid = 289 OR content.catid = 290 OR
content.catid = 291 OR content.catid = 302 OR content.catid = 331 )
\n\t\t\t\t \n\t\t\t\t\n\t\t\tORDER BY \n\t\t\t\t content.created DESC
\n\t\t\tLIMIT\n\t\t\t\t0,4

The issue is going to come up again.
I had you in chat yesterday with the same problem.
We need to resolve this in your database or prevent the database from
affecting the cluster.

The admin asked if you could disable the tracking plugin.
He believes that is what is locking the tables.

I would recommend running an optimize on the database.

More info from the admin to give to the client developer
SELECT COUNT(*) FROM ere_k2_items as i LEFT JOIN ere_k2_categories c
ON c.id= i.catid LEFT JOIN ere_k2_tags_xref tags_xref ON
tags_xref.itemID =
i.id LEFT JOIN ere_k2_tags tags ON tags.id = tags_xref.tagID WHERE
i.published = 1 AND i.access <= 0 AND i.trash = 0 AND c.published = 1 AND
c.access <= 0 AND c.trash = 0 AND ( i.publish_up = '0000-00-00 00:00:00' OR
i.publish_up <= '2013-06-05 10:35:16' ) AND ( i.publish_down = '0000-00-00
00:00:00' OR i.p
That is also getting locked.
it's searching for values of tags.name that = '???????????'
it's always returning an empty set
Probably searching for foreign characters. You may have an issue with
character set that needs to be reviewed.

And last recommendation.
the ere_k2_tags table is myisam and has a fulltext index on the name column
the problem is.... the name of the tags is so short, a fulltext index isn't
needed. It should be changed to InnoDB

if you can not login into myadmin, you probably have too many connections
to the database

You need to fix the problems with your code.
If you can not access the tools to repair your site, take it offline until
you can correct the problem.
This is going to continue until the problems are corrected
If the admin finds the database affecting the cluster he will limit the
amount of connections until you repair the database
and the code connecting to it.



Please help me get rid of this situation.

I am despaired

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum