[wp-trac] [WordPress Trac] #58368: WordPress dashboard is very slow when there are many comments (and the database isn't great)

WordPress Trac noreply at wordpress.org
Fri Sep 29 17:11:38 UTC 2023


#58368: WordPress dashboard is very slow when there are many comments (and the
database isn't great)
--------------------------------------+---------------------------
 Reporter:  Guss77                    |       Owner:  spacedmonkey
     Type:  defect (bug)              |      Status:  closed
 Priority:  normal                    |   Milestone:  6.4
Component:  Comments                  |     Version:  6.0
 Severity:  minor                     |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests  |     Focuses:  performance
--------------------------------------+---------------------------
Changes (by spacedmonkey):

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


Comment:

 In [changeset:"56747" 56747]:
 {{{
 #!CommitTicketReference repository="" revision="56747"
 Comments: Improve WP_Comment_Query count query performance by setting
 'order by' to 'none'.

 In cases where `WP_Comment_Query` or `get_comments` is employed with the
 'count' parameter set to true, specify 'order by' as 'none'. Since these
 queries serve solely to determine the count of comments matching specific
 query parameters, the 'order by' clause becomes redundant and places
 unnecessary strain on the database server, resulting in slower query
 execution. Given that count queries are executed on every admin request to
 retrieve comment counts, this change enhances the performance of the wp-
 admin interface.

 Props guss77, davidbaumwald, SergeyBiryukov, westonruter, peterwilsoncc,
 foliovision, hareesh-pillai, spacedmonkey.
 Fixes #58368
 }}}

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


More information about the wp-trac mailing list