[wp-trac] [WordPress Trac] #53450: [WP_Meta_Query] Add faster LIKE based 'STARTSWITH' and 'ENDSWITH' compare modes for value query

WordPress Trac noreply at wordpress.org
Fri Feb 25 22:45:26 UTC 2022

#53450: [WP_Meta_Query] Add faster LIKE based 'STARTSWITH' and 'ENDSWITH' compare
modes for value query
 Reporter:  janthiel                             |       Owner:  (none)
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  Query                                |     Version:  5.7.2
 Severity:  trivial                              |  Resolution:
 Keywords:  dev-feedback has-patch needs-docs    |     Focuses:
  needs-codex has-unit-tests early early-like-   |  performance
  actually-early                                 |

Comment (by ironprogrammer):

 Hi, @janthiel:

 Yep, those were what I was referring to. I'm glad you could decipher my
 terse note! The PR now applies without merge issues. ✅

 If you have time, please run through the new inline comments to be sure
 they conform to the [https://developer.wordpress.org/coding-standards
 /inline-documentation-standards/php/#language inline doc standards
 (including punctuation)]. I only left one example highlighting that in
 GitHub, as I didn't want to litter the code with trivial comments (I tried
 not to be persnickety 🤓).

 In summary, LGTM! 👍🏻

 == Test Report

 [https://github.com/WordPress/wordpress-develop/pull/1392 PR 1392]

 === Env
 * WordPress 6.0-alpha-52448-src
 * Safari 15.3
 * macOS 12.2.1 (Monterey)

 === Steps to Test
 1. Run `phpunit --filter Tests_Query_MetaQuery`.
 1. [Optional] For deeper coverage, run `phpunit --group query,meta`.
 1. Observe that all tests pass. ✅

 == Performance Example
 It would be nice to have a real-world test that compares `REGEXP/RLIKE` to
 `LIKE` using the new operator options. Perhaps it could be added to the
 [https://developer.wordpress.org/reference/classes/wp_query/ WP_Query
 documentation] in the sample code section (once this drops, of course).
 I'll poke around my test data to see if I can put something together, but
 please share if you've got anything yourself!

Ticket URL: <https://core.trac.wordpress.org/ticket/53450#comment:26>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list