At the first installation, the Currency Switcher runs a series of queries to determine the value of past orders in base currency (e.g. if your base currency is USD and there are past orders in EUR, it will calculate the value of all the EUR orders in USD). This is done for reporting purposes, and it can be an intensive operation, which runs just once


Depending on your server configuration, you may get the following error message when you enable the Currency Switcher.


WordPress database error: [The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay]

SELECT posts.ID AS order_id ,meta_order.meta_key ,meta_order.meta_value ,meta_order_base_currency.meta_key AS meta_key_base_currency ,meta_order_base_currency.meta_value AS meta_value_base_currency ,meta_order_currency.meta_value AS currency FROM wp_posts AS posts JOIN wp_postmeta AS meta_order ON (meta_order.post_id = posts.ID) AND (meta_order.meta_key IN ('_order_total', '_order_discount', '_cart_discount', '_order_shipping', '_order_tax', '_order_shipping_tax')) LEFT JOIN wp_postmeta AS meta_order_base_currency ON (meta_order_base_currency.post_id = posts.ID) AND (meta_order_base_currency.meta_key = CONCAT(meta_order.meta_key, '_base_currency')) AND (meta_order_base_currency.meta_value >= 0) LEFT JOIN wp_postmeta AS meta_order_currency ON (meta_order_currency.post_id = posts.ID) AND (meta_order_currency.meta_key = '_order_currency') LEFT JOIN wp_term_relationships AS rel ON (rel.object_ID = posts.ID) LEFT JOIN wp_term_taxonomy AS taxonomy ON (taxonomy.term_taxonomy_id = rel.term_taxonomy_id) LEFT JOIN wp_terms AS term ON (term.term_id = taxonomy.term_id) WHERE (posts.post_type = 'shop_order') AND (meta_order_base_currency.meta_key IS NULL)


Why does the error occur?

The error you reported is due to the fact that your MySQL installation has the SQL_BIG_SELECTS parameter set to zero (i.e. "disabled"). When that is the case, the query cannot run because MySQL thinks it's going to be too slow.


Why would SQL_BIG_SELECTS be disabled?

Some servers have the SQL_BIG_SELECTS setting turned off by default to ensure that users don't run heavy queries. It's a precaution which, in this specific case, doesn't allow the Currency Switcher do work properly.


How to fix it?

The solution is simple:

  1. Set SQL_BIG_SELECTS to 1 (i.e. "enabled") in your MySQL configuration, or ask your hosting provider to do so.
  2. Once the setting has been changed, open any of your WordPress Admin pages. This will trigger the Currency Switcher update process again.
  3. If needed, switch SQL_BIG_SELECTS back to zero (i.e. "disabled") once the Currency Switcher will have completed the update operation. 

You can purchase the Currency Switcher from our online shop.