[wp-trac] [WordPress Trac] #62931: Inconsistency When Querying and Sorting by meta_key with Multiple Values

WordPress Trac noreply at wordpress.org
Mon Feb 10 10:28:47 UTC 2025


#62931: Inconsistency When Querying and Sorting by meta_key with Multiple Values
--------------------------------------+------------------------------
 Reporter:  maximeschoeni             |       Owner:  (none)
     Type:  defect (bug)              |      Status:  new
 Priority:  normal                    |   Milestone:  Awaiting Review
Component:  Query                     |     Version:  6.7.1
 Severity:  normal                    |  Resolution:
 Keywords:  dev-feedback 2nd-opinion  |     Focuses:
--------------------------------------+------------------------------
Changes (by mayanktripathi32):

 * keywords:   => dev-feedback 2nd-opinion
 * component:  General => Query


Comment:

 {{{
 ORDER BY MIN(wp_postmeta.meta_value)
 }}}

 MIN function might negatively affect performance of query here, MySQL
 needs to compare all values for each post to determine the minimum which
 can cause slow downs if too many rows are present.

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


More information about the wp-trac mailing list