Skip to content

Adjusting imports to work with Super Speedy Filters

Super Speedy Filters maintains side-tables that copies the contents of wp_posts, wp_postmeta and wp_term_relationships into another table – fww_object_ancestors – so the data can be queried in a more efficient manner. This more efficient manner makes it far easier to create SQL queries that run quickly.

Automatic table maintenance

By default these tables are automatically maintained, but you may be taking advantage of various import tools options to disable do_action calls. If you disable do_action calls then there are a couple of functions you should call when your imports are complete in order to keep everything in sync.

If your tables end up out of sync, you can force a rebuild from the Settings > Super Speedy Filters > Advanced tab, but it’s best to avoid this requirement by updating your import jobs to work with Super Speedy Filters.

If you wish to take advantage of our automatic table maintenance, we recommend you do not use the option in WP All Import (or other import tools) to disable the do_action calls. If you keep the do_action calls, you never need to call any functions manually.

Manual functions to maintain fww_object_ancestors

Our fww_object_ancestors table works so fast because it solves the queries in advanced to determine which posts are children of the current term.

There are two functions you can call to keep this table in sync:

ssf_update_object_ancestors_post($post_id);

You can pass the $post_id to the above function and fww_object_ancestors will be updated for all terms relating to this post.

fww_ajax_recalc_terms();

The above function should be used to rebuild the entire table. This can be useful if you are running significantly large imports and then you can run a single update at the end of the entire import.

If you make a call to fww_ajax_recalc_terms it performs an asynchronous request to rebuild the entire table. This asynchronous aspect means the function will return quickly having added all of the items required to rebuild the table to a queue. The table will then continue to be built in the background. This is necessary because of the length of time that rebuilding the entire fww_object_ancestors table can take – if you have 300,000 products, this process will probably take about 10 to 20 minutes to complete.

It is important that you do not import any more products in the meantime while that process is completing.

Summary

If you do not disable do_action calls in your imports, then you do not need to adjust your imports. Otherwise, there is one function you can call to rebuild the entire table and another function you can call on a per-post basis.

Did this article answer your question?

Leave a Reply

Your email address will not be published. Required fields are marked *


CYBERFUNDAY 40% discount coupon extended to Friday 9th December + join our Discord community and read the rules for an extra 20% discount coupon.