Defect #8740
closedMysql Out of Memory for query on DB with just 31 issues
100%
Description
Hi, for some reason, a very small setup consisting on 31 issues total, less than 10 users and also less than 10 projects, ends up generating this SQL that on a shared hosting account runs out of memory.
This is the offeinding SQL:
SELECT count(DISTINCT `issues`.id) AS count_all, tracker_id AS tracker_id FROM `issues` LEFT OUTER JOIN `projects` ON `projects`.id = `issues`.project_id LEFT OUTER JOIN `issue_statuses` ON `issue_statuses`.id = `issues`.status_id LEFT OUTER JOIN `trackers` ON `trackers`.id = `issues`.tracker_id WHERE (((projects.id = 5 OR (projects.lft > 7 AND projects.rgt < 8))) AND issue_statuses.is_closed=0) AND (projects.status=1 AND projects.id IN (SELECT em.project_id FROM enabled_modules em WHERE em.name='issue_tracking')) GROUP BY tracker_id
The full DB size is 2.3Mb. I am woking with latest redmine stable 1.1.3. I tested on an old redmine 0.8 release and it works ok.
I would appreciate insights as if this is something normal as it sounds weird that on a production shared hosting account, that tollerates much more complex databases is unable to handle this query, redmine is not viable, as it has very low activity and data volume.
Feel free to ask any other supporting data as you find appropriate.
Hosting company is Hostgator if you ask.
Best regards,
Willie