[horde] alarms.php generating tons of sql select
Chuck Hagenbuch
chuck at horde.org
Wed Jan 21 15:57:07 UTC 2009
Quoting LALOT Dominique <dom.lalot at gmail.com>:
> So I tried to execute manualy the script and looking at mysql.log
>
> 38680 lines in mysql.log
> 6462 SELECT
>
> It looks like that:
> 4342 Query SELECT * FROM kronolith_shares ORDER BY
> share_name ASC
> 4342 Init DB horde
> 4342 Query SELECT share_id, user_uid, perm FROM
> kronolith_shares_users
> 4342 Init DB horde
> 4342 Query SELECT share_id, group_uid, perm FROM
> kronolith_shares_groups
> 4341 Init DB horde
> Then for each user found..
> 4341 Query SELECT event_id, event_uid,
> event_description, event_location, event_private, event_status,
> event_attendees, event_keywords, event_title, event_category,
> event_recurcount, event_recurtype, event_recurenddate,
> event_recurinterval, event_recurdays, event_start, event_end,
> event_alarm, event_modified, event_exceptions, event_creator_id FROM
> kronolith_events WHERE calendar_id = 'xxx' AND ((event_alarm > 0)) AND
> ((event_end > '2009-01-21 00:00:00' AND event_start < '9999-12-31
> 00:00:00') OR (event_recurenddate >= '2009-01-21 00:00:00' AND
> event_start <= '9999-12-31 00:00:00' AND event_recurtype <> 0))
>
> Then for nag etc..
>
> That's not very optimized from an sql point of view. That's may be due
> to an abstraction layer above sql backend, but being not optimized and
> running every 5 minutes can be a problem on large installations
>
> Listusers, then foreach test condition can be done quickly in sql or
> ldap as we can get all data in one call.
Patch? :)
-chuck
More information about the horde
mailing list