[wp-trac] [WordPress Trac] #60299: Default assignment of `use_ssl` user meta value causes unnecessary DB write.
WordPress Trac
noreply at wordpress.org
Fri Jan 19 15:14:18 UTC 2024
#60299: Default assignment of `use_ssl` user meta value causes unnecessary DB
write.
--------------------------+-----------------------------
Reporter: prettyboymp | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Users | Version:
Severity: normal | Keywords:
Focuses: performance |
--------------------------+-----------------------------
When the `$meta` in `wp_insert_user()` is processed using
`update_metadata()` it first does a comparison against the current values
in the database prior to running an update query. However, because the DB
returns a string value ('1' or '0') while the meta_value is set to a
boolean value by default the comparison always fails causing a write when
not needed.
While this is relatively minor in itself, in multi-datacenter setups using
hyperdb, this can cause a bit of overhead since all future reads to the
usermeta table are then sent to the master database.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/60299>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list