[#4373] huge amount of queries
Summary huge amount of queries
Queue Kronolith
Queue Version HEAD
Type Bug
State Resolved
Priority 1. Low
Owners
Requester dgehl (at) inverse (dot) ca
Created 08/31/2006 (768 days ago)
Due
Updated 08/31/2006 (768 days ago)
Assigned
Resolved 08/31/2006 (768 days ago)
Attachments
Milestone
Patch No

History
08/31/2006 Chuck Hagenbuch Deleted Attachment: kronolith.log
 
08/31/2006 Chuck Hagenbuch Comment #5
State ⇒ Resolved
Reply to this comment
Now _that_ was very specific and useful. I've consolidated the check 
even more into a single $addLinks variable in both HEAD and 
FRAMEWORK_3. Thank you!
08/31/2006 dgehl (at) inverse (dot) ca Comment #4 Reply to this comment
A similar kind of loop is present in views/Day.php ...
08/31/2006 dgehl (at) inverse (dot) ca Comment #3 Reply to this comment
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())) {
08/31/2006 Chuck Hagenbuch Comment #2
State ⇒ Not A Bug
Reply to this comment
There are tickets to deal with the datatree and other issues 
specifically. This is not useful to us as a bug report or enhancement.
08/31/2006 dgehl (at) inverse (dot) ca Comment #1
Summary ⇒ huge amount of queries
New Attachment: kronolith.log
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Queue ⇒ Kronolith
Reply to this comment
Opening kronolith (clicking on Organizing - Calendar) generates an 
enormous amount  of SQL queries (even with
$conf['group']['cache'] = true;
$conf['share']['cache'] = true;
)