Log in

View Full Version : too many sqls generating


Wordplay
01-23-2006, 07:50 PM
how can i downgrade the number of sqls generating from one page?

Andreas
01-23-2006, 08:12 PM
- Optimize and/or uninstall query-intensive Hacks ;)
- Turn off database read marking
- Turn off users browsing forum/thread
- Turn off moderator column
- Turn off WOL for forumhome
- Turn off similar threads
- more to add probably

Marco van Herwaarden
01-23-2006, 08:19 PM
By removing all hacks. :D

Sorry but there is no specific answer to this. Also don't look too much at the number of queries, that is not the most important. Examine the slow query log on your server if that is enabled, this has a much bigger influence on the loadtimes.

Wordplay
01-23-2006, 09:42 PM
you 2 are the greatest!

how do i turn off database read marking? and what exactly am i supposed to check in the slow query log?

Wordplay
02-02-2006, 09:25 AM
could you please expand on this, and let me know where to find the slow sql log?

took care of everything else.

one more question though, you know how the online button in the postbit and profile shows whether a user is still on, is there anyway to turn that off too? i guess that would down the number of sqls run as well.

Paul M
02-02-2006, 04:16 PM
Why are you obsessed with reducing the number of queries ?

Marco van Herwaarden
02-02-2006, 08:34 PM
Like i mentioned before and Paul M also mentioned now, the number of queries is not very important. The time it takes for each query to execute is.

You can find information about long running SQL-statements in the slow query log. How to activate it you can find the documentation at mysql.com.

Focussing on improving the speed of the slow queries would be the best way to go.

Wordplay
02-06-2006, 08:37 PM
this is the problem my provider gives me now that i asked about the length, before that they said there are too many queries running, but right now they say it's because some take up to 2 seconds to load.
26287 av 17 0 16884 7060 4084 S 3.6 0.3 0:00 0 /usr/bin/php
| 7807 | av_vbboard | localhost | av_vbboard | Query | 0 | Opening tables | SELECT
| 7807 | av_vbboard | localhost | av_vbboard | Query | 1 | Opening tables | SELECT
| 7807 | av_vbboard | localhost | av_vbboard | Query | 2 | closing tables | SELECT
| 7820 | av_vbboard | localhost | | Connect | 0 | Reading from net | |
| 7820 | av_vbboard | localhost | av_vbboard | Query | 0 | closing tables | SELECT title, data
| 7820 | av_vbboard | localhost | av_vbboard | Query | 1 | closing tables | SELECT title, data
| 7820 | av_vbboard | localhost | av_vbboard | Query | 2 | closing tables | SELECT title, data
| 7839 | av_vbboard | localhost | av_vbboard | Query | 0 | Opening tables | SELECT * FROM adv_pages WHERE name = 'home' AND active = 1 |
| 7839 | av_vbboard | localhost | av_vbboard | Query | 0 | Opening tables | SELECT threadid, firstpostid FROM thread AS thread
| 7839 | av_vbboard | localhost | av_vbboard | Query | 0 | Opening tables | SELECT permissions, FIND_IN_SET(forumid, '5,22,-1') AS pos
| 7839 | av_vbboard | localhost | av_vbboard | Query | 1 | Opening tables | SELECT permissions, FIND_IN_SET(forumid, '5,22,-1') AS pos
| 7839 | av_vbboard | localhost | av_vbboard | Query | 0 | Opening tables | SELECT imageid, images.title, filename, thumbname, originalname, extension, images.catid ,images.us |
| 7863 | av_vbboard | localhost | av_vbboard | Query | 0 | Sending data | SELECT title, template
| 7863 | av_vbboard | localhost | av_vbboard | Query | 1 | closing tables | SELECT title, template does that help anybody because i dont get it.

Marco van Herwaarden
02-08-2006, 05:55 AM
Well from this list you can not see what might be the problem. Ask your host fro a Slow Query log.