Page 1 of 1

Slow performance phoca gallery for many pictures

Posted: 18 Oct 2010, 02:19
by tvoeten
A bug in Phoca. The problem is solved by my hosting provider: Changing query. See in dutch:
-------------------------------------
Phoca gallery heeft bij grotere aantallen in de admin last van traagheid. Na monitoring van onze kant op een aantal van ongeveer 20.000 records duurt het ruim 30 tot 60 seconden voor de lijst getoond werd in de admin.
Onderstaande query werd daarvoor gebruikt zagen we. We hebben deze query eens zonder het stukje 'ORDER BY category, a.ordering' uitgevoerd en dan is hij in een fractie van een seconde klaar.

Dit is een bug in phoca gallery, mocht u dit tegenkomen dan adviseren wij u de bouwers hierop te wijzen. Iedere gebruikte query behoort geoptimaliseerd te zijn, dat is deze duidelijk niet.
SELECT a . * , cc.title AS category, cc.owner_id AS ownerid, u.name AS editor, v.average AS ratingavg, ua.username AS usercatname
FROM jos_phocagallery AS a
LEFT JOIN jos_phocagallery_categories AS cc ON cc.id = a.catid
LEFT JOIN jos_phocagallery_img_votes_statistics AS v ON v.imgid = a.id
LEFT JOIN jos_users AS u ON u.id = a.checked_out
LEFT JOIN jos_users AS ua ON ua.id = cc.owner_id
ORDER BY category, a.ordering

Mogelijke foutmelding
Fatal error: Maximum execution time of XX seconds exceeded in xxx.php on line XXX. We zouden in een dergelijk geval de max execution time kunnen verhogen maar dat is een pleister en lost niets op, niemand wil zo lang wachten voor er iets getoond wordt ;-)

Re: Slow performance phoca gallery for many pictures

Posted: 27 Oct 2010, 21:48
by Jan
Hi, I am testing the query without ordering and get the same results :-(

BTW - if you skip some feature, yes the loading will be faster (every removed feature will increase the performace - this is the logic :-( )

So, yes - unlimited category tree feature takes some resources, and if you don't need to order images in backend, then it is good way to solve the problem.

Thank you for this info (maybe it can helps other users which will have similar problem)

Jan