{"id":415445,"date":"2026-11-30T20:58:51","date_gmt":"2026-11-30T20:58:51","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/speedup-meta-tables\/"},"modified":"2026-11-30T20:58:31","modified_gmt":"2026-11-30T20:58:31","slug":"speedup-meta-tables","status":"publish","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/speedup-meta-tables\/","author":23095418,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"0.1.2","stable_tag":"0.1.2","tested":"7.1.5","requires":"6.4","requires_php":"8.0","requires_plugins":null,"header_name":"SpeedUp Meta Tables","header_author":"orcnd","header_description":"Answers slow postmeta, usermeta and WooCommerce order meta queries from narrow tables it builds from the queries your site really runs. Writes still go to the meta tables untouched.","last_updated":"2026-11-30 20:58:31","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/github.com\/orcnd\/speedup-meta-tables","header_author_uri":"https:\/\/github.com\/orcnd","rating":0,"author_block_rating":0,"active_installs":0,"downloads":207,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"0.1.2":{"tag":"0.1.2","author":"orcnd","date":"2026-11-30 20:58:31","revision":3836141}},"upgrade_notice":[],"ratings":[],"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":3836141,"resolution":"128x128","location":"assets","locale":"","width":128,"height":128},"icon-256x256.png":{"filename":"icon-256x256.png","revision":3836141,"resolution":"256x256","location":"assets","locale":"","width":256,"height":256}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":3836141,"resolution":"1544x500","location":"assets","locale":"","width":1544,"height":500},"banner-772x250.png":{"filename":"banner-772x250.png","revision":3836141,"resolution":"772x250","location":"assets","locale":"","width":772,"height":250}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["0.1.2"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":3836141,"resolution":"1","location":"assets","locale":"","width":1265,"height":923},"screenshot-2.png":{"filename":"screenshot-2.png","revision":3836141,"resolution":"2","location":"assets","locale":"","width":1105,"height":640},"screenshot-3.png":{"filename":"screenshot-3.png","revision":3836141,"resolution":"3","location":"assets","locale":"","width":1290,"height":1344}},"screenshots":{"1":"Tools &gt; SpeedUp Meta Tables on the test store after the plugin built its tables: the state, the buttons, and the tables with the fields each one holds.","2":"The query patterns it recorded. Values and search terms are not stored, only which fields, operators and sort a query uses.","3":"Meta SQL time of 39 WooCommerce admin screens on the test store, without the plugin (orange) and with it (blue). Log scale; the right column is how many times faster."}},"plugin_section":[],"plugin_tags":[2010,153,247,4672,286],"plugin_category":[45,54,59],"plugin_contributors":[295125],"plugin_business_model":[],"class_list":["post-415445","plugin","type-plugin","status-publish","hentry","plugin_tags-custom-fields","plugin_tags-database","plugin_tags-performance","plugin_tags-postmeta","plugin_tags-woocommerce","plugin_category-ecommerce","plugin_category-security-and-spam-protection","plugin_category-utilities-and-tools","plugin_contributors-orcnd","plugin_committers-orcnd"],"banners":{"banner":"https:\/\/ps.w.org\/speedup-meta-tables\/assets\/banner-772x250.png?rev=3836141","banner_2x":"https:\/\/ps.w.org\/speedup-meta-tables\/assets\/banner-1544x500.png?rev=3836141","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/speedup-meta-tables\/assets\/icon-128x128.png?rev=3836141","icon_2x":"https:\/\/ps.w.org\/speedup-meta-tables\/assets\/icon-256x256.png?rev=3836141","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/speedup-meta-tables\/assets\/screenshot-1.png?rev=3836141","caption":"Tools &gt; SpeedUp Meta Tables on the test store after the plugin built its tables: the state, the buttons, and the tables with the fields each one holds."},{"src":"https:\/\/ps.w.org\/speedup-meta-tables\/assets\/screenshot-2.png?rev=3836141","caption":"The query patterns it recorded. Values and search terms are not stored, only which fields, operators and sort a query uses."},{"src":"https:\/\/ps.w.org\/speedup-meta-tables\/assets\/screenshot-3.png?rev=3836141","caption":"Meta SQL time of 39 WooCommerce admin screens on the test store, without the plugin (orange) and with it (blue). Log scale; the right column is how many times faster."}],"raw_content":"<!--section=description-->\n<p>WordPress keeps custom fields as rows: one row per object, field and value. Filter a product list by supplier and sort it by cost, and MySQL joins that table once per field, over millions of rows. On a large WooCommerce store such admin screens take seconds.<\/p>\n\n<p>SpeedUp Meta Tables watches the meta queries your site runs, builds a narrow table for the ones that keep coming back, and answers them from it, with the same results. Your data and every write stay exactly where WordPress puts them.<\/p>\n\n<h4>Results on a test store<\/h4>\n\n<p>25,000 products, 49,000 variations, 48,000 customers, 60,000 orders, about 4 million postmeta rows. 43 WooCommerce admin screens and jobs, each run with and without the plugin.<\/p>\n\n<ul>\n<li><strong>Meta SQL per screen: 99 ms to 0.66 ms<\/strong> at the median, 149 times faster. \"Products without an image\" went from 3.1 s to 3.4 ms, \"customers without a company name\" from 1.1 s to 0.6 ms.<\/li>\n<li><strong>Pages slower than one second: 13 to 0.<\/strong><\/li>\n<li><strong>Four people in the admin at once:<\/strong> 87 pages served in 45 seconds without the plugin, 277 with it.<\/li>\n<li><strong>Same results, checked row by row:<\/strong> 154 queries and 855 comparisons after real product, order and stock changes, 0 differences.<\/li>\n<\/ul>\n\n<p>Every screen, the method, the scripts and the raw numbers: <a href=\"https:\/\/github.com\/orcnd\/speedup-meta-tables\/blob\/main\/benchmarks\/README.md\">benchmark on GitHub<\/a>.<\/p>\n\n<h4>How it works<\/h4>\n\n<ol>\n<li><strong>It watches.<\/strong> On admin screens every request, on the front end one in ten: each meta query it cannot answer yet is reduced to its shape (which fields, operators, sort and post type). Values and search terms are not stored.<\/li>\n<li><strong>It builds.<\/strong> Once an hour it builds a table for each shape seen 20 times on a type with at least 1,000 objects: one row per object, one column per field, and the indexes that query needs. \"Build now\" does it right away.<\/li>\n<li><strong>It answers.<\/strong> In the <code>query<\/code> filter of <code>wpdb<\/code> it recognizes the shape and reads the narrow table instead. Anything it does not fully understand goes to WordPress unchanged.<\/li>\n<li><strong>It follows writes.<\/strong> Writes go to the meta tables as always. The plugin notes which objects changed and copies them before the next read that needs them.<\/li>\n<li><strong>It cleans up.<\/strong> Tables whose queries have not been seen for 30 days are dropped.<\/li>\n<\/ol>\n\n<h4>Where it helps<\/h4>\n\n<ul>\n<li>Product, order, coupon and customer lists filtered or sorted by custom fields, whether the filter comes from WooCommerce, another plugin or your own code, as long as it goes through <code>WP_Query<\/code>, <code>WP_User_Query<\/code> or <code>wc_get_orders()<\/code>.<\/li>\n<li>\"Has no value\" filters (<code>NOT EXISTS<\/code>), numeric sorts on text fields and counts, which indexes on the meta table do not help.<\/li>\n<li>WooCommerce's low stock counter and report, the scheduled sale job, customer totals, order search in both the HPOS tables and the posts table.<\/li>\n<li>REST API product filters and <code>WP_User_Query<\/code> lists by role or field.<\/li>\n<\/ul>\n\n<p>It does not speed up pages without meta filters, and it builds nothing for types with fewer than 1,000 objects.<\/p>\n\n<h4>What it never does<\/h4>\n\n<ul>\n<li>It never changes how WordPress, WooCommerce or another plugin writes. Its tables only hold copies.<\/li>\n<li>It never edits another plugin's code or changes its behavior. It works through WordPress hooks only.<\/li>\n<li>It never sends data anywhere: no external requests, no tracking.<\/li>\n<li>When it is not sure (SQL it cannot read, a write it could not follow, a table being rebuilt) the query runs exactly as WordPress wrote it.<\/li>\n<\/ul>\n\n<h4>Requirements<\/h4>\n\n<ul>\n<li>MySQL 8.0.13 or newer. MariaDB is not supported yet; the plugin stays idle there.<\/li>\n<li>No database drop-in that spreads queries over several connections or another database (HyperDB, LudicrousDB, the SQLite integration). Query Monitor's drop-in is fine.<\/li>\n<li>On multisite, activate it per site; network activation is refused.<\/li>\n<li>The database user may create, alter and drop tables.<\/li>\n<li>WP-Cron, or a system cron that calls it, for the hourly check.<\/li>\n<\/ul>\n\n<h4>Privacy<\/h4>\n\n<p>The plugin stores copies of your own meta values in your own database, and the shape of the queries it saw without their values. Nothing leaves your server.<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Install and activate the plugin.<\/li>\n<li>Open the admin screens your team uses, as usual. Tools &gt; SpeedUp Meta Tables lists the query patterns it saw.<\/li>\n<li>Press \"Build now\", or wait for the hourly check. The same page then lists the tables it built. From WP-CLI: <code>wp speedup-meta build<\/code>.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id=\"how%20soon%20does%20it%20help%3F\"><h3>How soon does it help?<\/h3><\/dt>\n<dd><p>Right after \"Build now\". Without it, the hourly check builds a table once a query has been seen 20 times. Building took about two minutes for the whole test store; meanwhile queries go to WordPress as usual.<\/p><\/dd>\n<dt id=\"what%20happens%20to%20my%20data%20when%20i%20deactivate%20or%20delete%20the%20plugin%3F\"><h3>What happens to my data when I deactivate or delete the plugin?<\/h3><\/dt>\n<dd><p>Nothing. The plugin's tables only hold copies. Deactivating drops the copies, since they would go stale without the plugin watching writes. Deleting also removes the plugin's options and its record of the queries it saw.<\/p><\/dd>\n<dt id=\"does%20it%20slow%20down%20writes%3F\"><h3>Does it slow down writes?<\/h3><\/dt>\n<dd><p>Slightly. After a write to a watched object, one small row is noted (about 0.04 ms). The next read that needs that object copies it first: about 5 ms for one product.<\/p><\/dd>\n<dt id=\"what%20does%20it%20cost%3F\"><h3>What does it cost?<\/h3><\/dt>\n<dd><p>Disk space: 245 MB on the test store, next to 778 MB of meta tables. Each request that reads meta loads the table definitions once, about 0.3 ms. Both are included in the results above.<\/p><\/dd>\n<dt id=\"does%20it%20work%20with%20woocommerce%20hpos%3F\"><h3>Does it work with WooCommerce HPOS?<\/h3><\/dt>\n<dd><p>Yes. It answers order queries on the HPOS tables (<code>wc_orders_meta<\/code>) and on the older posts table.<\/p><\/dd>\n<dt id=\"another%20program%20writes%20to%20the%20database%20directly.\"><h3>Another program writes to the database directly.<\/h3><\/dt>\n<dd><p>The plugin only sees writes that go through WordPress' <code>wpdb<\/code>. After direct writes, run <code>wp speedup-meta repair<\/code>: it compares every copied object with the meta tables and fixes the differences (about two minutes for 267,000 objects on the test store). While it runs, reads go to WordPress.<\/p><\/dd>\n<dt id=\"query%20monitor%20shows%20different%20sql.\"><h3>Query Monitor shows different SQL.<\/h3><\/dt>\n<dd><p>Yes. <code>$wpdb-&gt;last_query<\/code> and Query Monitor show the SQL the plugin ran instead. When several rows have the same sort value, their order can differ from WordPress' order, as it can between two MySQL versions.<\/p><\/dd>\n<dt id=\"can%20i%20turn%20it%20off%20for%20one%20request%3F\"><h3>Can I turn it off for one request?<\/h3><\/dt>\n<dd><p>Add a filter from a plugin or a mu-plugin: <code>add_filter( 'speedup_meta_tables_enabled', '__return_false' );<\/code>. Writes are still noted, so the tables stay correct. The Pause button turns answering off for the whole site.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>0.1.2<\/h4>\n\n<ul>\n<li>Admin screens are watched on every request, so slow admin filters are learned after a few visits instead of weeks.<\/li>\n<li>\"Build now\" and <code>wp speedup-meta build<\/code> build tables for every query pattern seen so far; the hourly check keeps them.<\/li>\n<li>The hourly check builds a table after 20 sightings of a pattern (was 50).<\/li>\n<\/ul>\n\n<h4>0.1.1<\/h4>\n\n<ul>\n<li>The table definitions are kept in the plugin's own table; the autoloaded copy is written only through the Options API.<\/li>\n<\/ul>\n\n<h4>0.1.0<\/h4>\n\n<ul>\n<li>First release, on GitHub.<\/li>\n<\/ul>","raw_excerpt":"Learns which custom fields your site filters and sorts by, and answers those slow meta queries from narrow tables it builds itself.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/415445","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=415445"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/orcnd"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=415445"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=415445"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=415445"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=415445"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=415445"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=415445"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}