woocommerce / action-scheduler-custom-tables

This plugin is no longer needed. The custom table code is now part of Action Scheduler version 3.0 and newer. If you're using the latest Action Scheduler, you have the most performant schema available.
https://actionscheduler.org
14 stars 2 forks source link

Add index for args column #36

Closed thenbrent closed 6 years ago

thenbrent commented 6 years ago

Fixes #35

While patching this, I also noticed the $max_index_length value, and found some backstory on that 191 character limit here and in the source code of wp_get_db_schema() here.

Because we are changing the length of the args column now anyway, and will be logging a notice to warn developers of that, I figured it was a good idea to constrain its length to an indexable size instead of allowing data that is knowingly too long to be indexed, and therefore, non-performant, to be used.

I also considered reducing the length doing the same for the hook, but have left that off for now even though the same argument applies.

I don't think an update process is necessary for this column given we still have only tagged 1.0.0-beta. The column can be updated manually on the few sites using this plugin already.

thenbrent commented 6 years ago

Do we need to make any changes to the key for the hook column, or to the hook column size?

haha did you see the next sentence in my description? :)

I've opened #39 to discuss hook. I'm OK with enforcing the same limit, I left it out of this PR just to keep it super simple.

I'm marking this as approved. Feel free to merge if you don't think any changes are warranted

Perfect, thanks! Merging.

JPry commented 6 years ago

haha did you see the next sentence in my description? :)

Man, I've apparently been skimming more than I thought I was 😳