Keyword

K2 tags causing slow MySQL queries

More
8 years 7 months ago #147096 by wise
Hello there,

I am working on a website in joomla 3.4 and use the k2 component for content. In the site there are more than 10000 articles and about 30000 tags. (not duplicated).

I have issues with a specific query that is very slow and due to this having very high cpu usage in the server. Here is a part of the query causing the issue:
1. Executed 8h 42m 11s ago for 7.618611 sec on Database --> USERNAME_DATABASE_NAME
Date: 2015-09-05 14:28:12 Query_time: 7.618611 Rows_examined: 100583: Rows_sent 69484 Lock_time: 0.009928
SELECT tag.name, tag.id FROM DB_PREFIX_k2_tags as tag LEFT JOIN DB_PREFIX_k2_tags_xref AS xref ON xref.tagID = tag.id WHERE xref.itemID IN (22,23,24,25,26,29,31,32,33,35,36,37,38,40,45,47,49,50,51,61,62,63,64,52,55,56,57,58,59, ...

Any suggestions? Also i tried at-least to disable the taggin system of k2 but there is no such an option to do that.

Thanks for helping,
Best Regards.

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

More
8 years 7 months ago #147187 by Lefteris
Replied by Lefteris on topic K2 tags causing slow MySQL queries
Hi,

This is the query of the tag cloud. The query has also to check for items access level and publishing status before building the tag cloud.

You have two options:

1. Disable the tag cloud.
2. Edit the query in file modules/mod_k2_tools/helper.php in line 327 and replace it with the following:
$query = "SELECT tag.name, tag.id
        FROM #__k2_tags as tag
        WHERE tag.published = 1";

Note that this will improve the performance but it will still be slow. You are loading 30000 entries from the database.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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


Powered by Kunena Forum