[wp-trac] [WordPress Trac] #55942: Add a "type" field to the meta and options tables

WordPress Trac noreply at wordpress.org
Tue Jun 7 19:24:36 UTC 2022


#55942: Add a "type" field to the meta and options tables
-------------------------+----------------------------
 Reporter:  azaozz       |      Owner:  (none)
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Future Release
Component:  Database     |    Version:
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+----------------------------
 The idea to add a `type` or `format` field to all meta and options tables
 is not new, has been "floating around" for years. The general idea it that
 if some data is (automatically) serialized before saving to the DB, it
 will be (automatically) unserialized after retrieving it based on the
 value of the new field. This will make the `maybe_unserialize()` and
 `is_serialized()` functions pretty much redundant when retrieving data
 from these tables. It will also improve the performance and stability.

 The new field can be very small. Seems that a `TINYINT` (requires only 1
 byte of storage) would work there. Can also be something like
 `VARCHAR(20)` that may eventually prove more useful in the future, but
 perhaps the increase in size would not be worth it.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/55942>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list