[wp-hackers] Meta tables: Take 5

Mike Schinkel mikeschinkel at newclarity.net
Mon Jul 27 16:47:50 UTC 2009


> Why so large? I was thinking CHAR(20) at most.

Take a look at wp_postmeta and wp_usermeta; meta_key is VARCHAR(255).  I presumed the same for this.

Even so, ENUM is still a lot more efficient and it provides nice "documentation in code" for what types are valid.

-Mike Schinkel
Custom Wordpress Plugins
http://mikeschinkel.com/custom-wordpress-plugins

P.S. That said, maybe that is potential optimization that could improve all larger WordPress sites simply by bring down the meta_key sizes, maybe to 127 characters?  Of course, that might break some plugins with really long meta_keys.  Another options would be to move to wp_metakeys table with an INT primary key. That would really improve performance for sites with lots of meta records per object.

----- Original Message -----
From: "Otto" <otto at ottodestruct.com>
To: wp-hackers at lists.automattic.com
Sent: Monday, July 27, 2009 9:20:52 AM GMT -05:00 US/Canada Eastern
Subject: Re: [wp-hackers] Meta tables: Take 5

On Sat, Jul 25, 2009 at 1:48 AM, Mike
Schinkel<mikeschinkel at newclarity.net> wrote:
> That comfort comes with less than trivial performance implications.
> ...
> Now, let's look the option we'd choose it we didn't challenge the default
> assumptions: VARCHAR(255)..

Why so large? I was thinking CHAR(20) at most.

-Otto
_______________________________________________
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