[dev] History of share changes

Jan Schneider jan at horde.org
Fri Jul 31 13:07:49 UTC 2009


For CalDAV and other stuff we need to track when a share has been  
changed, or more precisely, when the content of a share, i.e the  
events/tasks in it have been changed.
Currently we only store history entries for individual objects, not  
for the complete share. To identify objects we use a UID like  
application:share_id:object_id.

There are two ways to solve this. The simple one is to extend the  
History API to get the timestamp from the most recently changed entry  
in a share with:
SELECT history_ts FROM horde_histories WHERE object_uid LIKE  
'app:share:%' ORDER BY history_ts DESC LIMIT 1

The more complex solution is to add specific history entries for share  
changes in all places where we already log object changes. We could  
then use a query like:
SELECT history_ts FROM horde_histories WHERE object_uid = 'app:share'

Usually I would simply pick the most simple solution, but since the  
history table could grow pretty large, this might have an impact on  
the database performance. I'd like to get some feeback from anyone who  
has more experience with fine tuning database queries, where there may  
be a significant performance hit with the first query in a large  
table. Obviously this is slower, but does it outweigh the necessary  
code complexity and additional database record for the faster query?

Also, and this question actually goes to Ben and Evert, do we only  
need ETags for existing shares/resources (which is why we need the  
change timestamp), or do we have to track the time of the  
deletion/addition of complete resources?

Jan.

-- 
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digitale PGP-Unterschrift
URL: <http://lists.horde.org/archives/dev/attachments/20090731/3424825a/attachment.bin>


More information about the dev mailing list