#3725 closed defect (bug) (wontfix)
user_id in DB much larger than needed
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | low | Milestone: | |
| Component: | Optimization | Version: | 2.2 |
| Severity: | minor | Keywords: | has-patch 2nd-opinion dev-feedback |
| 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)
Change History (12)
charleshooper — 6 years ago
comment:1
charleshooper — 6 years ago
- Status changed from new to assigned
comment:2
charleshooper — 6 years ago
- Owner changed from charleshooper to anonymous
- Status changed from assigned to new
comment:3
foolswisdom — 6 years ago
- Milestone changed from 2.3 to 2.2
comment:4
charleshooper — 6 years ago
- Owner changed from anonymous to charleshooper
- Status changed from new to assigned
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.)
comment:6
charleshooper — 6 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.
comment:7
charleshooper — 6 years ago
- Keywords dev-feedback added
comment:8
charleshooper — 6 years ago
The maximum size of INT() on MySQL is roughly one third of the world's population. +1 for my original patch
comment:9
foolswisdom — 6 years ago
- Milestone changed from 2.2 to 2.3
comment:10
matt — 6 years ago
- Resolution set to wontfix
- Status changed from assigned to closed
comment:11
foolswisdom — 6 years ago
- Milestone 2.3 (trunk) deleted

Reduces user ID size in DB and bumps wp_db_version