[kronolith] Reminders: listAlarms () why not a filter on event_start ?
Jan Schneider
jan at horde.org
Thu Oct 15 07:28:25 UTC 2009
Zitat von Chuck Hagenbuch <chuck at horde.org>:
> Quoting Jan Schneider <jan at horde.org>:
>
>> Zitat von Patrick ABIVEN <patrick.abiven at apitech.fr>:
>>
>>> Hello
>>> Using Horde_Alarms for Kronolith reminders on a large database, we
>>> are facing poor performances due to the large number of events
>>> retrieved at each iteration. And many of these events doesn't
>>> occurs before weeks.
>>> In kronolith/lib/Driver/sql.php, the listAlarms() function calls
>>> $this->listEvents($date, null, true); Instead of passing null for
>>> the second argument (use for filtering on event_start), it seems
>>> that passing $date + X days will greatly reduce the number of
>>> events. X can be defined as a configuration argument.
>>> Thank for your advises.
>>
>> That's not a viable solution because users can set arbitrary values
>> for alarms. Beside that, only a minority of events should be in the
>> future for large (and old) databases.
>
> We could select the max(event_alarm) value (esp. if it was indexed)
> and use that as the filter.
That makes sense.
Jan.
--
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/
More information about the kronolith
mailing list