×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: JoomlaComment adding lots of SQL queries to homepage

JoomlaComment adding lots of SQL queries to homepage 14 years 5 months ago #7797

  • TT
  • TT's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 5
  • Thank you received: 0
Hi,
I have this issue on my homepage, that the moment I install JoomlaComment, the number of SQL queries to deliver the homepage (looking at debug mode) jump from 138 to 394.
This significantly influences page load time (going from 1 sec to 4.7sec!)
There is no mention on the homepage of any comment, but queries still run. How come?

Can you help, what data you need to be able to find the bug?
I have the latest v4 beta2


Thanks!
Tamas

JoomlaComment adding lots of SQL queries to homepage 14 years 5 months ago #7798

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
How many articles do you have on the front page?

This really seems high for me.

On my localhost without joomlacomment joomla makes 30 queries. With joomlacomment 45. That is exactly 50% more. So for you this should be around 200 something.

Most of the queries should be absolulty no problem.
For example 7 times jos_comment_settings. This table normally doesn't have more than 10 entries. So finding something in it should take 1 billion of a second.
(the next version will save the configuration in one Object so only one query will be made)

What will change with the future? As I said those 7 queries will become one. The other queries that are there are necessary to count the comments for the read more.

I want to say that again those 394 queries seems a little bit too much to me.

JoomlaComment adding lots of SQL queries to homepage 14 years 5 months ago #7801

  • TT
  • TT's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 5
  • Thank you received: 0
I have 31 articles on the homepage plus some extra components installed (security and subscription modules that take some extra queries indeed)

The baseline is 139 queries before installing the comment module.

Site is www.chinavestor.com

As soon as I add the comment module I get the ~400 queries.

I still do not understand what is the added functionality to run ANY queries for a comment module on a homepage where you do not comment??? Is that necessary, can it be switched off somehow only on the frontpage?

We have huge peak loads on the SQL server due to these queries running.

If I reduce number of articles displayed (this is a news site so do not want to do it really) will it reduce?

JoomlaComment adding lots of SQL queries to homepage 14 years 5 months ago #7802

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Ok, I found something more today.
I was wondering yesterday why we have queries like this:
SELECT * FROM jos_comment where id=0 LIMIT 1;
This was a bug. A peace of code was not placed on the right place. The next version will not have this problem.

Right now I'm trying to make the frontend work with the new backend and specially the new configuration object.

With the above problem fixed and the new conf object I dropped the queries on the frontpage from 58 to 43.( I believe that I can drop another 5 queries for comprofiler and one for the settings).
Stay tuned!

JoomlaComment adding lots of SQL queries to homepage 14 years 5 months ago #7803

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
We were writing at the same time.
Are you speaking about the component or the module?

JoomlaComment adding lots of SQL queries to homepage 14 years 5 months ago #7804

  • TT
  • TT's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 5
  • Thank you received: 0
As you can see I also have the most commented module on the front page. However removing that does not remove 99% of the queries.

Still, can you explain why there are queries of JoomlaComment at all running on the frontpage? What is the use? There is no comment related functionality on the homepage other than the most commented module (which uses only few queries)

JoomlaComment adding lots of SQL queries to homepage 14 years 5 months ago #7805

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Don't you use the write_comment functionality????
write comment(number of comments) ???

JoomlaComment adding lots of SQL queries to homepage 14 years 5 months ago #7809

  • TT
  • TT's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 5
  • Thank you received: 0
Most probably I dont use the write_comment, as it does not say anything to me.
I use JoomlaComment from the menu. Is that somewhere in the settings?

JoomlaComment adding lots of SQL queries to homepage 14 years 5 months ago #7810

  • TT
  • TT's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 5
  • Thank you received: 0
D...mn
I have started to look for the setting and realized my layout settings was completely off.
I started with 398 queries

Switchin Show Read on to NO resulted in 358 queries (I guess that is what you meant)

Still 220 queries more than needed......

JoomlaComment adding lots of SQL queries to homepage 14 years 5 months ago #7811

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Well, next version will solve this problem.
  • Page:
  • 1
Time to create page: 0.185 seconds