Browser: Chrome 110
OS: macOS / Windows / Linux / etc.
[Please describe this bug in as much detail as possible so we can replicate & debug this bug]
Hello Bricks Team,
I’ve identified a significant performance bottleneck when importing WooCommerce products while using the native Bricks Filter system.
The Problem: During a standard WooCommerce product import (using WP All Import or native WC importer), the time to process a single product increases from ~1 second to 30+ seconds if Bricks Filters are active.
Technical Details: I ran an SQL profiler during the import of a single product and found that Bricks triggers hundreds of DELETE and SELECT queries on the wp_bricks_filters_index and wp_bricks_filters_element tables for every single meta field update.
For a product with multiple attributes, this results in:
-
Over 800+ SELECT queries to
wp_bricks_filters_element. -
Hundreds of DELETE queries to
wp_bricks_filters_index. -
Total SQL calls per product exceeding 50,000–90,000.
It seems the indexer hooks into updated_post_meta or similar hooks without any “debounce” or “throttling” during bulk processes.
SQL Log Example (per single product):
SQL
-- Repeated 100+ times per product update:
DELETE FROM `wp_bricks_filters_index` WHERE `filter_id` = 'xxxxx' AND `object_id` = 22793;
SELECT wp_bricks_filters_element.* FROM wp_bricks_filters_element ... WHERE indexable = '1';
Requested Improvement: Could you please add a check to disable auto-indexing during bulk imports, or provide a hook to programmatically pause the indexer? Currently, the only way to perform an import is to manually disable the indexer or use a SQL-level block on the tables.
Thank you!