This is a MySQL error, presumably caused because MySQL does not have enough memory to run Q2A's queries. It's worth talking to your hosting provider about this, but if that's not an option, you might want to try changing this in qa-config.php:
define('QA_OPTIMIZE_LOCAL_DB', false);
... to ...
define('QA_OPTIMIZE_LOCAL_DB', true);
That will make Q2A use simpler MySQL queries and might solve the problem.