If you have a lot of watchdog entries the dblog_user_delete opration is heavy on the database and can actually die. Adding an index will fix this. This would also allow us to retrieve watchdog entries by user.

Comments

Anonymous’s picture

Status: Needs review » Reviewed & tested by the community

An index on uid has other uses as well, such as a filter by uid.

dries’s picture

Status: Reviewed & tested by the community » Fixed

I fixed the tab-issue and committed this to CVS HEAD. It will need to be re-rolled for Drupal 6 (i.e. update function) so for now I'm marking this 'fixed'. Thanks killes -- glad to see you're submitting patches again!

killes@www.drop.org’s picture

Version: 7.x-dev » 6.x-dev
Status: Fixed » Needs review

Oh my, I submit a patch and it has a tab. I really should do this more often to practise. ;)

Goba, do you want this in D6? If not, change back status.

killes@www.drop.org’s picture

Version: 6.x-dev » 7.x-dev

I later remembered why there wasn't an index on uid (and timestamp): We deliberately omitted it as we thought that the inserts would be slow if the index would also need to be updated.

However, we already added an index for the type column in http://drupal.org/node/99128

Also, the missing indices seem to be a problem on drupal.org, see http://drupal.org/node/165061

Thus I propose we keep it as it is and also add an index on the timestamp column. If you log enough that the index updates are a problem for you, you should be looking for alternate means of logging.

Status: Needs review » Needs work

The last submitted patch failed testing.

mikeryan’s picture

mikeryan’s picture

Status: Needs work » Needs review
StatusFileSize
new951 bytes

Status: Needs review » Needs work

The last submitted patch failed testing.

marcingy’s picture

Status: Needs work » Closed (fixed)

This exists in head.