Make WordPress Core

Opened 18 years ago

Closed 18 years ago

Last modified 15 years ago

#3725 closed defect (bug) (wontfix)

user_id in DB much larger than needed

Reported by: charleshooper's profile charleshooper Owned by: charleshooper's profile charleshooper
Milestone: Priority: low
Severity: minor Version: 2.2
Component: Optimization Keywords: has-patch 2nd-opinion dev-feedback
Focuses: Cc:

Description

Since the maximum # of users WordPress can support has been accepted as much much smaller than 2,147,483,647 the database schema should be modified to change all columns that reference a user ID to type INT.

Currently, all of these columns are type BIGINT, except for link_owner in wp_links for some reason. In addition, user IDs are type-casted to INTs in some places in the WordPress core, such as in get_userdata.

The attached patch changes all of the columns referencing user IDs to INTs and bumps wp_db_version.

Attachments (1)

wp_small_userid.diff (1.9 KB) - added by charleshooper 18 years ago.
Reduces user ID size in DB and bumps wp_db_version

Download all attachments as: .zip

Change History (12)

@charleshooper
18 years ago

Reduces user ID size in DB and bumps wp_db_version

#1 @charleshooper
18 years ago

  • Status changed from new to assigned

#2 @charleshooper
18 years ago

  • Owner changed from charleshooper to anonymous
  • Status changed from assigned to new

#3 @foolswisdom
18 years ago

  • Milestone changed from 2.3 to 2.2

#4 @charleshooper
18 years ago

  • Owner changed from anonymous to charleshooper
  • Status changed from new to assigned

#5 @matt
18 years ago

The reason this (and several other fields) are set to be extra large in the DB because when you get to the point where you need to change it to be larger, it will be a very long (possibly days) operation with locked tables. There is no real cost to using the bigger fields, so in the hope that WP may someday be successful enough to need it I propose we leave the big fields in. (In the users table, and everywhere else.)

#6 @charleshooper
18 years ago

  • Keywords 2nd-opinion added

Fair point. Perhaps the size of wp_links.link_owner should be increased then, for this same reason -- it's currently set to INT(11), unlike anywhere else.

#7 @charleshooper
18 years ago

  • Keywords dev-feedback added

#8 @charleshooper
18 years ago

The maximum size of INT() on MySQL is roughly one third of the world's population. +1 for my original patch

#9 @foolswisdom
18 years ago

  • Milestone changed from 2.2 to 2.3

#10 @matt
18 years ago

  • Resolution set to wontfix
  • Status changed from assigned to closed

#11 @foolswisdom
18 years ago

  • Milestone 2.3 (trunk) deleted
Note: See TracTickets for help on using tickets.