Dennis P. Nikolaenko wrote:
>>
>>
>> By the way, reading rcube_sess_gc() I found an improvement 
>> possibility. Function could be simpler and speed increased if we'll 
>> create index on cache.session_id column with "ON DELETE CASCADE" 
>> reference, but it needs innodb in mysql (foreign keys not supported 
>> by myisam tables), and triggers in sqlite (foreign keys not supported 
>> at all).
>>   
> Another solution would be to get rid of the initial SELECT query and 
> IN (... ) clauses and do one DELETE query with a JOIN between 
> "session" and "cache" and second DELETE just for session. Both DELETEs 
> would just have a now()-changed > $maxlifetime WHERE clause. now() is 
> constant, so it may be better to write expression like 
> now()-$maxlifetime > changed. If there is an index on changed column, 
> the search would be very quick.
> This approach has a potential of non atomic commit if cache entry is 
> created between the two DELETEs. So it should be wrapped into a 
> transaction.

So, adding cache.session_id and session.changed indexes will be a good 
improvement for now.

-- 
Aleksander 'A.L.E.C' Machniak http://alec.pl gg:2275252
LAN Management System Developer http://lms.org.pl
Roundcube Webmail Project Developer http://roundcube.net
_______________________________________________
List info: http://lists.roundcube.net/dev/

Reply via email to