[wp-trac] [WordPress Trac] #33871: comment_exists() results in a bad query

WordPress Trac noreply at wordpress.org
Wed Sep 23 18:15:41 UTC 2015


#33871: comment_exists() results in a bad query
-------------------------+---------------------------
 Reporter:  apokalyptik  |       Owner:  boonebgorges
     Type:  enhancement  |      Status:  closed
 Priority:  normal       |   Milestone:  4.4
Component:  Comments     |     Version:  trunk
 Severity:  normal       |  Resolution:  fixed
 Keywords:  has-patch    |     Focuses:  performance
-------------------------+---------------------------
Changes (by boonebgorges):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"34460"]:
 {{{
 #!CommitTicketReference repository="" revision="34460"
 Allow `comment_exists()` to match based on GMT date.

 The `comment_date_gmt` field of the `wp_comments` table is indexed, which
 makes
 `WHERE` matches against the field much faster than against the unindexed
 `comment_date`. For bulk operations like data import, the speed difference
 can
 be meaningful.

 We continue to default to 'blog' for `$timezone`, to preserve
 compatibility
 with existing uses.

 Props apokalyptik.
 Fixes #33871.
 }}}

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


More information about the wp-trac mailing list