WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 5 months ago

#38784 closed defect (bug) (wontfix)

Set no_found_rows inside _WP_Editors::wp_link_query

Reported by: david.binda Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Editor Keywords:
Focuses: performance Cc:

Description

Since the WP_Query inside the _WP_Editors::wp_link_query is not taking advantage of found_posts nor of max_num_pages, not setting no_found_rows and thus triggering a SQL query with SQL_CALC_FOUND_ROWS does not feel right.

The extra queried information is not being used and forces the SQL query to scan much more rows than it needs to.

Attachments (1)

38784.patch (451 bytes) - added by david.binda 3 years ago.
Setting no_found_rows inside the _WP_Editors::wp_link_query

Download all attachments as: .zip

Change History (2)

@david.binda
3 years ago

Setting no_found_rows inside the _WP_Editors::wp_link_query

#1 @desrosj
5 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed
  • Version 4.6.1 deleted

While Core is not relying on found_rows or max_num_pages, it's possible a plugin or custom code could be relying on it being present through the wp_link_query filter.

I am going to close this one out since this only affects the Classic Editor, which will mostly remain the same moving forward with the exception of bug fixes.

If someone feels strongly that this should be updated and can investigate further, feel free to reopen.

Note: See TracTickets for help on using tickets.