[wp-trac] [WordPress Trac] #26858: Comment duplicate check has a slow query

WordPress Trac noreply at wordpress.org
Sun May 25 16:13:22 UTC 2025


#26858: Comment duplicate check has a slow query
-----------------------------------------+-----------------------------
 Reporter:  pento                        |       Owner:  pbearne
     Type:  defect (bug)                 |      Status:  assigned
 Priority:  normal                       |   Milestone:  Future Release
Component:  Database                     |     Version:  2.0
 Severity:  normal                       |  Resolution:
 Keywords:  needs-patch needs-test-info  |     Focuses:  performance
-----------------------------------------+-----------------------------
Changes (by SirLouen):

 * keywords:  needs-testing has-patch => needs-patch needs-test-info


Comment:

 Currently, there is no valid patch. Is not only a matter of refreshing the
 latest patch, but addressing what pento suggested:

 Replying to [comment:7 pento]:
 > Adding a single index isn't the right way to go - as @nacin mentioned,
 this needs a deeper dive into the queries used by the various comment
 functions, to see if we can make several of them better at once, rather
 than adding an index that's only used by one function.
 >
 > As a side note, `comment_post_ID_content` is the correct index name -
 it's a compound index, so it's named for both columns - like
 `comment_approved_date_gmt (comment_approved,comment_date_gmt)`.

 So all we can say is that we return to the starting point. Needs some
 triaging, maybe some performance testing to see how bad thing is nowadays,
 even before starting to create the new patch. Please refer to the
 [https://make.wordpress.org/test/2025/05/15/building-the-testing-use-case
 /#performance-upgrades Testing Use-Case] to know where to, ideally, start
 from.

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


More information about the wp-trac mailing list