[Tickets #4373] RESOLVED: huge amount of queries

bugs@bugs.horde.org bugs at bugs.horde.org
Thu Aug 31 13:42:40 PDT 2006


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/?id=4373
-----------------------------------------------------------------------
 Ticket             | 4373
 Updated By         | dgehl at inverse.ca
 Summary            | huge amount of queries
 Queue              | Kronolith
 Version            | HEAD
 Type               | Bug
 State              | Bogus
 Priority           | 1. Low
 Owners             | 
-----------------------------------------------------------------------


dgehl at inverse.ca (2006-08-31 13:42) wrote:

I checked the kronolith/lib/views/Month.php file and in there, there
Kronolith::hasPermission('max_events') is called for every day of the
month view. 
When I move the function call outside the 'foreach day' loop, the number
of database queries drops dramatically.

Here's a diff
RCS file: /repository/kronolith/lib/Views/Month.php,v
retrieving revision 1.9
diff -r1.9 Month.php
122c122
<
---
>       $hasPermission = Kronolith::hasPermission('max_events');
159d158
<
162,163c161,162
<                      Kronolith::hasPermission('max_events') === true ||
<                      Kronolith::hasPermission('max_events') >
Kronolith::countEvents())) {
---
>                      $hasPermission === true ||
>                      $hasPermission > Kronolith::countEvents())) {





More information about the bugs mailing list