Page 1 of 1

New db index added by plugin on core tables

Posted: Sat Jan 28, 2012 2:05 pm
by blog.brockha.us
I would like to count comments by a single commenter in my blog. For that I would count comment emails. I will need an index to do that in a performant way.

What do you think? Is it okay, if plugins add indexes to core tables? And if yes, should they remove the index on uninstall?

Thanks for input. :)

Re: New db index added by plugin on core tables

Posted: Sun Jan 29, 2012 12:32 am
by garvinhicking
Hi!

I wouldn't mind a plugin doing that, this won't really hurt. I wouldn't remove the index after uninstalling because of the same reasoning.

The only thing the plugin could IMHO check (using the given SQL syntax, since mysql and pgsql and sqlite AFAIK differ for this) is if the index already exists, so that it doesn't get added multiple times.

Regards,
Garvin

Re: New db index added by plugin on core tables

Posted: Sun Jan 29, 2012 12:45 am
by blog.brockha.us
Okay. Thanks for the input, Garvin.:)

About removing the index: I was a little worried about unnecessary performance slow down while inserting. On the other hand: If another plugin relies on the same index, it would be nasty to remove it while uninstalling.

(Are you back? And already in this forum again? You are my Jungle King :mrgreen:)