[wp-trac] [WordPress Trac] #39507: Increase the length of comment_type field in wp_comments table

WordPress Trac noreply at wordpress.org
Mon Jan 9 11:55:08 UTC 2017


#39507: Increase the length of comment_type field in wp_comments table
-------------------------+------------------------------
 Reporter:  slaFFik      |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Comments     |     Version:  1.5
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:
-------------------------+------------------------------

Comment (by slaFFik):

 @dd32
 I have different "objects" of data, each object is represented by several
 post types in different combinations. To distinguish between ordinary (not
 mine) comments and comments to my objects I use `comment_type` field.
 This comment type is generated based on CPTs, so comments to some objects
 will have comment type like `prefix_abcde_xyz_12312` or
 `prefix_xyz_foo_bar_baz_34231`. As you can see, I'm pretty easily can go
 outside of `varchar(20)`, and mostly I'm around 35 chars.
 Then I query those comments based on `abcde`, `xyz`, `12312`, `foo`,
 `bar`, `34231` - to get comments for my objects based on type that
 consists of specific CPTs "refs". I have big number of comments, so
 working with `wp_comments` table is faster than also query for meta (like
 `type=>prefix_abcde_xyz_12312`, which is bigger than `wp_comments` and
 values are also not indexed, obviously).

 That's my usecase, where I use comment_type to uniquely group comments by
 objects, this grouping identifier  seems just be longer defined a decade
 ago of `varchar(20)`.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39507#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list