[wp-trac] [WordPress Trac] #18836: ORDER BY RAND() is slow

WordPress Trac noreply at wordpress.org
Fri May 9 12:09:27 UTC 2025


#18836: ORDER BY RAND() is slow
-------------------------------------------------+-------------------------
 Reporter:  scribu                               |       Owner:  pbearne
     Type:  enhancement                          |      Status:  assigned
 Priority:  normal                               |   Milestone:  6.9
Component:  Query                                |     Version:
 Severity:  minor                                |  Resolution:
 Keywords:  early has-patch has-testing-info     |     Focuses:
  dev-feedback                                   |  performance
-------------------------------------------------+-------------------------

Comment (by SirLouen):

 == Testing Instructions Improved

 1. Use this plugin in a new clean environment: https://github.com/SirLouen
 /wp-query-benchmarking-v2
 2. First generate 10K posts to have a populated DB
 3. Run the performance tests with and without the Patch.

 You are welcome to review and improve the plugin to add more test cases or
 improve the mock data.

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


More information about the wp-trac mailing list