Forums

Why not combine wp_usermeta into wp_users table? (3 posts)

  1. ZackLive
    Member
    Posted 2 years ago #

    Hi, I am reading the database of WordPress, when I come to wp_usermeta, I think that what's in wp_usermeta can be combine into wp_users, isn't it?

  2. s_ha_dum (was apljdi)
    Member
    Posted 2 years ago #

    No. Actually I lean toward thinking that some stuff (the role/capability stuff) in wp_usermeta should be shifted to still another table and that some stuff in wp_users, like user_url, should be shifted to wp_usermeta, but that is another fight :).

    Splitting the tables has to do with a few things. Top of the list, I think is this: Look at your usermeta table, or run this SELECT user_id,COUNT(user_id) as count FROM wp_usermeta GROUP BY user_id on it. Users have different numbers of entries in the usermeta table. How are you going to deal with that if everything is in the same table? Add a bunch of extra columns to the wp_users table? The same issue comes up when someone wants to add additional information. As it is, a plugin or theme author can shove additional userdata into the usermeta table rather that create another table.

  3. ZackLive
    Member
    Posted 2 years ago #

    Thanks for your explanation, apljdi

Topic Closed

This topic has been closed to new replies.

About this Topic