[horde] horde_histories

Arjen de Korte arjen+horde at de-korte.org
Tue Feb 18 14:24:03 UTC 2014


Citeren Pete at turtle.com:

> Quoting Jan Schneider <jan at horde.org>:
>
>> Zitat von Michael M Slusarz <slusarz at horde.org>:
>>
>>> Quoting Pete at turtle.com:
>>>
>>>>  My horde_histories table is very large (6+ million records) and mysql
>>>> logs many slow queries (>5 seconds) on this table. I have a couple
>>>> questions:
>>>>
>>>> Can this table be pruned? For example can I delete all records older
>>>> then
>>>> n?
>>>
>>> Sure.
>>>
>>>> Is it normal for this table to be so big?
>>>
>>> Depending on your usage, maybe.  You haven't told us what applications
>>> you are running.
>>>
>>> In IMP, for example, this feature is used to provide tracking of
>>> forwards/replies.  But the entries are automatically trimmed when
>>> messages are deleted, so the only way you can reach 6 million records
>>> is if you are archiving a lot of messages (and have a lot of users).
>>>
>>> michael
>>> --
>>>
>>> ___________________________________
>>> Michael Slusarz [slusarz at horde.org]
>>
>> Please note that the history entries are required for synchronization
>> though. If you remove entries, it's no longer possible to detect which
>> groupware entries have been changed since the last synchronization.
>> --
>> Jan Schneider
>> The Horde Project
>> http://www.horde.org/
>> https://www.facebook.com/hordeproject
>>
>> --
>> Horde mailing list
>> Frequently Asked Questions: http://horde.org/faq/To unsubscribe, mail:
>> horde-unsubscribe at lists.horde.org
>
> Thank you for the answers.
>
>  1) The slow queries are exclusively turba and kronolith. Examples are:
> SELECT DISTINCT object_uid, history_id FROM horde_histories WHERE
> history_modseq > 5510226 AND history_modseq <= 6837638 AND history_action =
> 'add' AND object_uid LIKE 'kronolith:_VzQICAWYzm_YEEWhgKj%';
>
> SELECT DISTINCT object_uid, history_id FROM horde_histories WHERE
> history_modseq > 6322150 AND history_modseq <= 6837398 AND history_action =
> 'add' AND object_uid LIKE 'turba:_QTm3ALM7SIvXH%';
>
> 2)  I have about 430 users currently on the system.
>
> 3) I understand the entries are used for synchronization but are they used
> once and then can be discarded? e.g. if a sync occurs today, can I delete
> all turba/kronolith entries with a history_modseq before today without
> breaking things?

If you know that synchronized devices synchronize at least once per  
day, that might work. But in that case, no synchronized device is  
allowed to be off-line for more than a day, otherwise it would miss  
entries it hasn't synched before you discarded them.

If you're only using ActiveSync to synchronize, it would be possible  
to search for the lowest sync_mod value (excluding 0) in  
horde_activesync_state and prune only those entries from  
horde_histories (for turba and kronlith) that have a history_modseq  
value lower than that. Remember that devices that no longer  
synchronize, must be removed from Horde, otherwise they would prevent  
this from working.

> 4) It sounds like I should keep any Imp entries around since they are
> needed to track replies, etc. and they clean up automatically on delete
> anyway.

The vast majority of the old entries in horde_histories in my database  
seem to be from kronolith and turba too, so this is probably true.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5849 bytes
Desc: S/MIME Signature
URL: <http://lists.horde.org/archives/horde/attachments/20140218/af984c8a/attachment.bin>


More information about the horde mailing list