[drupal-devel] Fwd: history-table

Dries Buytaert dries at buytaert.net
Mon May 9 17:25:08 UTC 2005


On 09 May 2005, at 11:07, Gerhard Killesreiter wrote:
> Well, if the blocks would be processed seperately, that would be quite
> some gain. I suppose that for some pages the blocks take up more
> processing time than the main page.
>
> The ideal place for updating the history table would be in hook_exit(),
> but that would cause node.module to be loaded for cached pages.

I'm not in favor of such a solution. It doesn't address the real 
problem.  The real problem is the fact that the operations on the 
history-table perform poorly (compared to operations on other tables).  
One way to solve this is to lower the value of NODE_NEW_LIMIT (a 
timestamp) so the history gets pruned faster and the size of the table 
shrinks.

However, similar problems exist with the watchdog, accesslog and 
sessions tables.  They can grow unwieldy and without profiling your 
Drupal installation, this problem isn't easily identified.  One 
solution might be to prune or rotate these tables based on the number 
of rows (table size) rather than by the information's lifetime.  Like, 
only maintain the session information of the last 100k sessions, or 
limit the history table to 25k rows.

Whether that behavior is desirable, I do not know, but given sensible 
defaults, I don't think it would be a problem.

--
Dries Buytaert  ::  http://www.buytaert.net/




More information about the drupal-devel mailing list