[wp-trac] [WordPress Trac] #23061: get_post_meta() on post with large amount of meta keys uses too much memory

WordPress Trac noreply at wordpress.org
Thu Dec 27 14:48:20 UTC 2012


#23061: get_post_meta() on post with large amount of meta keys uses too much memory
-------------------------+------------------------------
 Reporter:  joehoyle     |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Database     |     Version:
 Severity:  normal       |  Resolution:
 Keywords:               |
-------------------------+------------------------------

Comment (by joehoyle):

 Replying to [comment:1 wonderboymusic]:
 > get_post_meta is a bad choice here, you should probably be using a
 custom SQL SELECT using COUNT and GROUP BY. Votes and ratings aren't what
 those EAV tables are designed to store. I would suggest creating a join
 table

 Hey, could you explain why the meta tables are not meant for something
 like vote tracking on a post? A vote seems to fit the scheme quite well,
 `post | vote | vote_info` and doing a count for total votes?

 How would you see an ideal scheme for that?

 Also, the voting was an example of large amounts of data -- of course it's
 not limited to that. With `update_meta_cache` it's not viable to put any
 amount of data you don't want permanently in memory, as of course it's not
 garbage collection due to the object cache.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/23061#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list