[wp-trac] [WordPress Trac] #14711: Indexes for comment_author_email and user_id

WordPress Trac noreply at wordpress.org
Mon Jul 18 10:18:03 UTC 2016


#14711: Indexes for comment_author_email and user_id
--------------------------+-----------------------------
 Reporter:  tellyworth    |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Future Release
Component:  Database      |     Version:  3.0
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:  performance
--------------------------+-----------------------------

Comment (by rodrigosprimo):

 I found this ticket while looking for slow queries on a WooCommerce
 installation. This installation has about 2.5 million entries on
 wp_comments table (the majority of those entries are not WordPress
 comments but order notes, a custom comment type used by WooCommerce).

 The query used by Akismet to get the number of approved comments made by a
 user (the same query that was previously mentioned in this ticket) takes
 about 1 second to run. On pages where this method is called multiple
 times, like the comments page and the dashboard, this significantly
 impacts the page load time. Adding a index to user_id field reduced the
 query time to about 0.001 seconds.

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


More information about the wp-trac mailing list