Title: Table size issue
Last modified: May 21, 2020

---

# Table size issue

 *  Resolved [hatchlingweb](https://wordpress.org/support/users/keepsmilyn/)
 * (@keepsmilyn)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/table-size-issue/)
 * We have noticed a massive spike in the size of the aws_cache table in our database
   in the last few days. Has there been any recent changes to your plugin that may
   be causing this? We updated to the version 2.01 of Advanced Woo Search Pro.
 * At present this file (below) is at 20GB in size on our web server.
    /var/lib/
   mysql/wp_DBNAME/TABLENAME_aws_index.ibd
 * Is there any to reduce this size asap as its taking up so much space on our server.
 * Thank you kindly.
    -  This topic was modified 5 years, 10 months ago by [hatchlingweb](https://wordpress.org/support/users/keepsmilyn/).

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [ILLID](https://wordpress.org/support/users/mihail-barinov/)
 * (@mihail-barinov)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/table-size-issue/#post-12869971)
 * Hi,
 * There is several solutions to how to decrease index table size.
    First of all–
   you can remove from index page all search sources that you don’t use for search.
   Please use following code snippet for this
 *     ```
       add_filter('aws_indexed_data', 'my_aws_indexed_data');
       function my_aws_indexed_data( $data ) {
           foreach ( $data['terms'] as $source => $all_terms ) {
               if ( strpos( $source, 'meta_' ) === 0 || strpos( $source, 'tax_' ) === 0 || strpos( $source, 'attr_' ) === 0  ) {
                   unset( $data['terms'][$source] );
               }
           }
           return $data;
       }
       ```
   
 * This code remove custom fields, taxonomies and attributes of products from the
   index table. If you need to sources to remove or want to leave some of them –
   please write me.
 * Second – Do you need to display product variations inside search results? If 
   no than make sure that plugin option ‘Variable products’ set to  ‘Show only parent
   products’. 
    Also please add following code snippet like and in previous example.
 *     ```
       add_filter('aws_indexed_data', 'my_aws_indexed_data2');
       function my_aws_indexed_data2( $data ) {
           if ( $data['type'] === 'child' ) {
               return false;
           }
           return $data;
       }
       ```
   
 * You need to add this snippets somewhere outside plugins folder. For example, 
   inside functions.php file of your theme or use some plugin for adding code snippets.
   
   Also, after adding them, you need to re-index plugin table.
 * Regards
 *  Thread Starter [hatchlingweb](https://wordpress.org/support/users/keepsmilyn/)
 * (@keepsmilyn)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/table-size-issue/#post-12873160)
 * Thank you. I will check settings and apply these functions.
 * Highly appreciate your detailed reply. Thank you. 🙂
 *  Thread Starter [hatchlingweb](https://wordpress.org/support/users/keepsmilyn/)
 * (@keepsmilyn)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/table-size-issue/#post-12873281)
 * We have enabled a handful of “Search in” options, which are searching within 
   product attributes, so the second function can’t be used.
 * Is there a way to auto clear cache? You have an option to setup a cron job to
   reindex table, can the same be done with clearing of cache? This way we dont 
   need to manually clear the cache and it can be automatically done periodically?
 * Thank you!
 *  Plugin Author [ILLID](https://wordpress.org/support/users/mihail-barinov/)
 * (@mihail-barinov)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/table-size-issue/#post-12875411)
 * Yes, you can clear plugin cache by calling
 * `do_action('aws_cache_clear');`
 * So you can create cron job to call this action during needed intervals.
 * Regards

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Table size issue’ is closed to new replies.

 * ![](https://ps.w.org/advanced-woo-search/assets/icon-256x256.png?rev=3303984)
 * [Advanced Woo Search - Product Search for WooCommerce](https://wordpress.org/plugins/advanced-woo-search/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/advanced-woo-search/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/advanced-woo-search/)
 * [Active Topics](https://wordpress.org/support/plugin/advanced-woo-search/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/advanced-woo-search/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/advanced-woo-search/reviews/)

## Tags

 * [aws](https://wordpress.org/support/topic-tag/aws/)
 * [woocommerce search](https://wordpress.org/support/topic-tag/woocommerce-search/)
 * [wordpress search](https://wordpress.org/support/topic-tag/wordpress-search/)

 * 4 replies
 * 2 participants
 * Last reply from: [ILLID](https://wordpress.org/support/users/mihail-barinov/)
 * Last activity: [5 years, 10 months ago](https://wordpress.org/support/topic/table-size-issue/#post-12875411)
 * Status: resolved