WordPress.org

Make WordPress Core

Opened 15 months ago

Last modified 3 months ago

#37703 new enhancement

Optimise `wp_delete_comment` as called from `wp_delete_post`

Reported by: peterwilsoncc Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Comments Keywords: needs-patch needs-unit-tests reporter-feedback
Focuses: performance Cc:

Description

Remove the need for reparenting comments in wp_delete_comment by deleting comments in descending order.

Potentially accept an array of comments.

Change History (5)

#1 @peterwilsoncc
15 months ago

  • Keywords needs-patch needs-unit-tests added

#2 follow-up: @Mte90
3 months ago

Looking right now in the code I didn't see forcing of an order on SQL query, maybe in the meantime this issue was fixed?

#3 in reply to: ↑ 2 @peterwilsoncc
3 months ago

Replying to Mte90:

Looking right now in the code I didn't see forcing of an order on SQL query, maybe in the meantime this issue was fixed?

This is correct, no order is specified in wp_delete_posts (see wp-includes/post.php#L2490). In most cases the DB defaults to insertion order, in this case ascending by date.

#4 @Mte90
3 months ago

So what is the purpose of the ticket, is not so much clear right now for me :-)

#5 @johnbillion
3 months ago

  • Keywords reporter-feedback added
Note: See TracTickets for help on using tickets.