Closed (fixed)
Project:
Drupal core
Version:
4.7.x-dev
Component:
statistics.module
Priority:
Minor
Category:
Bug report
Assigned:
Reporter:
Created:
15 Aug 2005 at 17:26 UTC
Updated:
25 Jan 2007 at 02:39 UTC
Jump to comment: Most recent file
Comments
Comment #1
drummHow about a key on the path column?
Comment #2
dries commentedCommitted to HEAD. Marking this active until we clarifie the path index thing.
Comment #3
dries commentedComment #4
jeremy commentedIn which case several of the columns should have keys. I was going to add it to my earlier patch, but haven't had time.
Comment #5
Cvbge commentedSQL code as in the patch won't work with postgresql:
Comment #6
jeremy commentedThe attached adds three keys that I confirmed are used. The keys are on path, url and uid.
Before adding a key for "path":
After:
And another query that gains from the "path" key:
Before adding the key for "url":
And after:
Before adding the key for "uid":
After:
Comment #7
jeremy commentedComment #8
moshe weitzman commentedsure, these indices speed up the admin pages. but remember that every index needsb to be maintained for every insert. since accesslog is inserted into on every view, this is potentially harmful to a lot more people than admins. i'm not sure how to measure this tradeoff.
one approach is to copy the access log table to a read only table and do admin pages off of the copy. that means we have a copy dedicated to reading a different one dedicated to writing.
Comment #9
drummMySQL's insert delayed extension would be perfect for this. Unfortunately it is not ANSI SQL.
The inserts are done in the exit hook so the extra time is not usually passed on to the user (when drupal_goto() is used the exit hook execution happens before the redirect is sent). Although I'm guessing the total index maintenance time may be larger than the savings on the statistics pages.
Comment #10
killes@www.drop.org commentedpostgres part is missing.
Comment #11
Cvbge commentedI think this needs to be benchmarked. I think adding 3 indexes that need to be updated for every page access just for the sake of 1 admin-visible page is dubious.
Comment #12
Jaza commented-1 from me. The accesslog table has a much heavier INSERT than SELECT rate on higher-traffic sites, and as such, we should have as few keys as possible on this table, in order to optimise it for fast INSERTing, not for fast SELECTing.
Closing issue (due to my personal -1, and due to extended inactivity).