WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#32361 closed enhancement (duplicate)

/wp-admin/post.php is so slow because of wrong query

Reported by: wolfkang Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.2.2
Component: Posts, Post Types Keywords:
Focuses: performance Cc:

Description

I have 28,732 rows in the wp_posts table, and 1,631,109 rows in the wp_postmeta.

The post edit page is so slow and its loading time is over 7 seconds.

/wp-admin/includes/template.php shoud be modified like this.

Before modification in line 673

        $sql = "SELECT meta_key
                FROM $wpdb->postmeta
                GROUP BY meta_key
                HAVING meta_key NOT LIKE %s
                ORDER BY meta_key
                LIMIT %d";

After modification

        $sql = "SELECT DISTINCT meta_key
                FROM $wpdb->postmeta
                WHERE meta_key NOT LIKE %s
                ORDER BY meta_key
                LIMIT %d";

The grouping is not necessary.

Please check it out.

Change History (1)

#1 @johnbillion
4 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Thanks for the report wolfkang!

This is a duplicate of an existing issue: #24498.

Note: See TracTickets for help on using tickets.