4images Forum & Community
4images Issues / Ausgaben => Discussion & Troubleshooting => Topic started by: Blackman on June 17, 2003, 12:11:42 PM
-
Hy!
My page is very slow. I create msql log file (slow works):
"# Time: 030616 13:20:18
# User@Host: euronet2002[euronet2002] @ localhost []
# Query_time: 12 Lock_time: 0 Rows_sent: 39537 Rows_examined: 158870
SELECT DISTINCT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits, c.cat_name, u.user_name
FROM eroticzoneimages i, eroticzonecategories c
LEFT JOIN eroticzoneusers u ON (u.user_id = i.user_id)
WHERE i.image_active = 1 AND i.cat_id NOT IN (0, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 26, 32, 36, 37) AND c.cat_id = i.cat_id
ORDER BY RAND();"
---------------------
10 users and the gallery slows down. CPU work = 100% (2.4Ghz P4)
This no correct :(
Please check my site: www.eroticzone.hu
Thx!![/url]
-
yep!! initial loading of html is fast. but then takes ages to load the gallery
-
Yes, this is an very expensive query because of the RAND() in the ORDER BY clause if you have a lot of images in your database.
Try to change
define('SHOW_RANDOM_CAT_IMAGE', 1);
to
define('SHOW_RANDOM_CAT_IMAGE', 0);
in includes/constants.php. This disables the category related random image.
If this does not help, change
define('SHOW_RANDOM_IMAGE', 1);
to
define('SHOW_RANDOM_IMAGE', 0);
This will disable the random image completely.
Jan
-
The random image function can be a problem for the speed of the website if you have a lot of images, wright ?
Is it not possible to let the random image function take an image out of 1 category ?
So instead of taking a random image from a collection of 2000 images, it has to take an image fom a category with let's say 50 images.
Is this possible and could this solve the problem ?
So you can keep the random image function, and website will not encounter problems.