Keyword

Immense ammount of queries to the database 200+

  • Nick
  • Nick's Avatar Topic Author
  • Offline
  • Elite Member
More
13 years 11 months ago #89624 by Nick
I would personally classifiy this as a bug. Currently i have a website with 200+ categories. Guess how many queries k2 produces on the frontpage? around 200. I'm using the latest items from a category component to display the latest items from ALL the categories. Why in GOD'S NAME does K2 have to query every single category?Isn't there simply an option to get the latest 14 items and have the title and image display? Because currently that doesn't exist.. which is like THE most simple option there should be... THE MOST... Sigh...Here's an attachment of my queries:queries.txt

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

  • Nick
  • Nick's Avatar Topic Author
  • Offline
  • Elite Member
More
13 years 11 months ago #89625 by Nick
so i just found out that if i call ALL items belonging to all the publishing users joomla makes only 18 queries.. erm? bug anyone?

EIGHTEEN to TWOHUNDREDTWENTYTHREE

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

More
13 years 11 months ago #89626 by Lefteris
Hi. Obviously you are not very familiar with K2. Are you referring to latest view or itemlist view? In case you want to fetch the latest 14 items from all categories you should use itemlist view. Select all the categories, set "Fetch items from children categories" to "No" and "item ordering" to "Most recent first". K2 will fetch your items making only one query for this.

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

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

  • Nick
  • Nick's Avatar Topic Author
  • Offline
  • Elite Member
More
13 years 11 months ago #89627 by Nick
erm... i am familiar with it. I have been using it for a year now. That's what i have it set to yet it still queries the DB 200 times. Did u take a look at my queries? That's generated when using that view. I have the child thing set to no as well.

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

More
13 years 11 months ago #89628 by Lefteris
To see the queries performed by the component append &tmpl=component to your URL. If the number of queries there is small then one of your modules makes the large number of queries.



Nick Tsutsunava said:erm... i am familiar with it. I have been using it for a year now. That's what i have it set to yet it still queries the DB 200 times. Did u take a look at my queries? That's generated when using that view. I have the child thing set to no as well.

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

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

  • Nick
  • Nick's Avatar Topic Author
  • Offline
  • Elite Member
More
13 years 11 months ago #89629 by Nick
ok so i had issues using the &tmpl so i disabled sh404sef which sondirably reduced my queries. Heck sometimes when I refreshed the page it came down to 12! But it's fluctuating sorta... sometimes it's 85 or 135... Very strange. Still can't get the &tmpl to work. But anyhow the most queries produced are of these kind:

#
SELECT id, parent_id, value, name, lft, rgt
FROM jos_core_acl_aro_groups
WHERE id=23

and
#
SELECT *
FROM jos_k2_categories
WHERE id=108
LIMIT 0, 1

Any ideas?

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

More
13 years 11 months ago #89630 by Lefteris
If our URL doesn't contain already other variables ( no other & present) then append ?tmpl=component. The variation of the queries has to do with the cache mechanism. Please ensure that Joomla! cache is enabled. Additionally to Joomla! cache you can enable the Cache system plugin. This will boost your site's performance even more. Thanks.



Nick Tsutsunava said:ok so i had issues using the &tmpl so i disabled sh404sef which sondirably reduced my queries. Heck sometimes when I refreshed the page it came down to 12! But it's fluctuating sorta... sometimes it's 85 or 135... Very strange. Still can't get the &tmpl to work. But anyhow the most queries produced are of these kind:
#
SELECT id, parent_id, value, name, lft, rgt
FROM jos_core_acl_aro_groups
WHERE id=23

and
#
SELECT *
FROM jos_k2_categories
WHERE id=108
LIMIT 0, 1

Any ideas?

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

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

  • Nick
  • Nick's Avatar Topic Author
  • Offline
  • Elite Member
More
13 years 11 months ago #89631 by Nick
Ok thanks for the help so far! Got the queries back to 188 with the system cache plugin enabled. I can't believe it was actually off... Anyhow, i got tmpl to work like you suggested but the queries go down to 187 using that...

can it be sh404sef that is causing this?

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

More
13 years 11 months ago #89632 by Lefteris
Obviously ti has to do with SH404SEF since when you disabled the queries go down. Please mind that the K2 SH404SEF plugin which is bundled with K2 will try to get the full category path foreach category/item link appeared in the page so this may also be he reason. I also saw a lot of queries to jos_redirections table.



Nick Tsutsunava said:Ok thanks for the help so far! Got the queries back to 188 with the system cache plugin enabled. I can't believe it was actually off... Anyhow, i got tmpl to work like you suggested but the queries go down to 187 using that...
can it be sh404sef that is causing this?

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