Beschrijving
WooCommerce’s Bestel en Abonnering pagina’s staan winkeleigenaren toe om te zoeken naar bestellingen en abonnementen op klantnaam, e-mail en andere attributen. Standaard doet het een algemene substring zoekopdracht. Bijvoorbeeld, als je OllieJones in het zoekvak zet, zal het zoeken met LIKE '%OllieJones%'
met behulp van de leidende wildcard %
. Dat is verbazingwekkend traag op sites met veel bestellingen.
Bij activatie voert deze plugin een achtergrondproces uit om een speciale index tabel te maken, een tabel van trigrammen, om dat zoeken te versnellen. Vervolgens gebruikt het die trigrammen om te zoeken naar bestellingen.
Het nadeel: de trigram tabel neemt database ruimte in beslag en kost tijd om te genereren.
The orders page itself contains a very slow query (to be fixed in Woocommerce 9.0.0) to look up meta_keys. This fixes that query’s performance too.
Credits
Thanks to Leho Kraav for bringing this problem to my attention.
Thanks to Sebastian Sommer and Maxime Michaud for using early versions of the plugin on large stores, and to Maxime Michaud for creating the transation into French.
Bedankt aan Jetbrains voor het gebruik van hun software ontwikkelingsgereedschap, vooral PhpStorm. Het is moeilijk voor te stellen hoe een plugin zoals deze ontwikkeld zou kunnen worden zonder PhpStorm’s gereedschap om epische codebases zoals die van WordPress te verkennen.
How can I learn more about making my WordPress site more efficient?
We offer several plugins to help with your site’s database efficiency. You can read about them here.
Installatie
Follow the usual procedure for installing a plugin from the wordpress.org plugin repository.
FAQ
-
Wat is de achtergrond hiervan?
-
See this WooCommerce issue for an example of the performance problem store owners have. See this Subscriptions issue for another example.
-
Wat is de oplossing?
-
Build a trigram lookup table, maintain it, and use it for the queries.
-
Hoeveel ruimte neemt de trigram lookup tabel in?
-
It takes about 5-10KiB per order, as MariaDB / MySQL database storage, counting both data and indexes. So, if your site has a million orders, the table will take something like 5-10 GiB.
-
How long does it take to generate trigram lookup table?
-
When you activate the plugin, it starts generating the table in the background. Everything continues as normal while the plugin is generating the table.
Generating the table seems to take about ten seconds (in the background) for every thousand orders.
-
Does it work with High Performance Order Storage (HPOS)?
-
Yes.
-
Does it work with pre-HPOS order storage?
-
Yes.
-
The lookup table seems to be out of date. I can’t find recent orders. What do I do?
-
- Let the author know by creating an issue at https://github.com/OllieJones/fast-woo-order-lookup/issues
- Deactivate, then activate the plugin. This rebuilds the lookup table.
-
What is this wp_fwol table created by the plugin?
-
This table, named with an abbreviation for “Fast Woo Order Lookup”, contains the trigram lookups. It has a terse name to keep queries short. It is dropped automatically if you deactivate the plugin.
-
My store only has a few hundred orders. Do I need this plugin ?
-
This plugin addresses database performance problems that only show themselves on stores with many tens of thousands of orders. If your store is smaller than that you probably don’t need it.
Wise owners of rapidly growing stores return regularly to examine their site performance. If your site is still small, it’s better to wait until you actually need performance-enhancing plugins and other features. Installing them “just in case” is ineffective.
Beoordelingen
Bijdragers & ontwikkelaars
“Fast Woo Order Lookup” is open source software. De volgende personen hebben bijgedragen aan deze plugin.
Bijdragers“Fast Woo Order Lookup” is vertaald in 3 talen. Dank voor de vertalers voor hun bijdragen.
Vertaal “Fast Woo Order Lookup” naar jouw taal.
Interesse in ontwikkeling?
Bekijk de code, haal de SVN repository op, of abonneer je op het ontwikkellog via RSS.
Changelog
1.1.3 October 7, 2024
Handle tables and colums with character sets other than $wpdb->charset.
1.1.1 August 12, 2024
- Limit batch runtime to 25 seconds. Include a cronjob shell script to purge stale ActionScheduler actions.
1.1.0 August 11, 2024
- Some MariaDB / MySQL versions implicitly cast integers to latin1 strings causing problems. Explicit casting fixes the issue.