I upgraded from Joomla 2.5 to 3.4 one of my site, and JA K2 search gave the next error:
1037 – Out of memory; restart server and try again (needed 131064 bytes) SQL=SELECT DISTINCT i.*, CASE WHEN i.modified = 0 THEN i.created ELSE i.modified END as lastChanged, c.name as categoryname,c.id as categoryid, c.alias as categoryalias, c.params as categoryparams FROM jye4c_k2_items as i RIGHT JOIN jye4c_k2_categories AS c ON c.id = i.catid WHERE i.published = 1 AND i.access IN(1,1) AND i.trash = 0 AND c.published = 1 AND c.access IN(1,1) AND c.trash = 0 AND ( i.publish_up = ‘0000-00-00 00:00:00’ OR i.publish_up <= ‘2015-04-10 07:00:35’ ) AND ( i.publish_down = ‘0000-00-00 00:00:00’ OR i.publish_down >= ‘2015-04-10 07:00:35’ ) AND i.catid IN (3) ORDER BY i.id DESC LIMIT 0, 9