[wp-hackers] Options table' varchar 64.

Andrew Nacin wp at andrewnacin.com
Tue Jun 24 17:35:22 UTC 2014


Large networks have a lot of options tables. For a sufficiently large table
(which might depend also on the storage engine), things could lock up or go
awry. Rather than just doing it once, we're doing it n times, where n is
the number of sites. More chances for things to go wrong.

My take is this:
If you are in a position to be able to run an ALTER TABLE query, you are
also probably hosting your own thing, which means you should stop storing
transients in the database. Instead, install an object cache. Transients in
the database are a last-resort kind of thing. If you're doing heavy stuff
with transients, look for alternatives.

Also, if your transient names are too long, use a prefix plus a hash of the
name. It'll make it constant-length.

Nacin


On Tue, Jun 24, 2014 at 1:27 PM, Haluk Karamete <halukkaramete at gmail.com>
wrote:

> On the trac page (https://core.trac.wordpress.org/ticket/13310) , it is
> said that "This schema change would have a significant impact on large WP
> networks."
>
> Could someone eloborate on this as to why the problem occurs on 'large WP
> networks' as opposed to 'large WP sites'? So it's problematic on
> multi-sites only?
>
>
>
>
> On Tue, Jun 24, 2014 at 10:23 AM, Haluk Karamete <halukkaramete at gmail.com>
> wrote:
>
> > It makes total sense to me to do this on plug-in activation, as opposed
> to
> > wp-config.
> > Thank you for your advise.
> >
> >
> > On Tue, Jun 24, 2014 at 7:06 AM, J.D. Grimes <jdg at codesymphony.co>
> wrote:
> >
> >> This is something that you need to change in the database table’s schema
> >> directly. So you need to run a single ALTER TABLE query. You don’t want
> to
> >> be running this every page load. If this is part of a plugin, you
> should do
> >> it on activation.
> >>
> >> Also, see https://core.trac.wordpress.org/ticket/13310
> >>
> >> -J.D.
> >>
> >> On Jun 24, 2014, at 9:42 AM, Haluk Karamete <halukkaramete at gmail.com>
> >> wrote:
> >>
> >> > Is there a harm to change the options table so that the field names
> for
> >> the
> >> > transients  can have varchar 128 as opposed to varchar 64  and  if
> >> that's
> >> > okay, what's the best way to do this?
> >> >
> >> > In other words, what would be  the best or the earliest hook for this
> >> kind
> >> > of s change? Or should this be done at wp-config?
> >> > _______________________________________________
> >> > wp-hackers mailing list
> >> > wp-hackers at lists.automattic.com
> >> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> >>
> >> _______________________________________________
> >> wp-hackers mailing list
> >> wp-hackers at lists.automattic.com
> >> http://lists.automattic.com/mailman/listinfo/wp-hackers
> >>
> >
> >
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list