diff --git a/CRM/Contact/Form/Search/Custom/Group.php b/CRM/Contact/Form/Search/Custom/Group.php
index 999a733..b40d55f 100644
--- a/CRM/Contact/Form/Search/Custom/Group.php
+++ b/CRM/Contact/Form/Search/Custom/Group.php
@@ -32,7 +32,9 @@
  * $Id$
  *
  */
-class CRM_Contact_Form_Search_Custom_Group extends CRM_Contact_Form_Search_Custom_Base implements CRM_Contact_Form_Search_Interface {
+class CRM_Contact_Form_Search_Custom_Group
+  extends CRM_Contact_Form_Search_Custom_Base
+  implements CRM_Contact_Form_Search_Interface {
 
   protected $_formValues;
 
@@ -283,7 +285,7 @@ function from() {
         $xGroups = 0;
       }
 
-      $sql = "CREATE TEMPORARY TABLE Xg_{$this->_tableName} ( contact_id int primary key) ENGINE=HEAP";
+      $sql = "CREATE TEMPORARY TABLE Xg_{$this->_tableName} ( contact_id int primary key) ENGINE=MyISAM";
       CRM_Core_DAO::executeQuery($sql);
 
       //used only when exclude group is selected
@@ -318,7 +320,7 @@ function from() {
 
       $sql = "CREATE TEMPORARY TABLE Ig_{$this->_tableName} ( id int PRIMARY KEY AUTO_INCREMENT,
                                                                    contact_id int,
-                                                                   group_names varchar(64)) ENGINE=HEAP";
+                                                                   group_names varchar(64)) ENGINE=MyISAM";
 
       CRM_Core_DAO::executeQuery($sql);
 
@@ -418,7 +420,7 @@ function from() {
         $xTags = 0;
       }
 
-      $sql = "CREATE TEMPORARY TABLE Xt_{$this->_tableName} ( contact_id int primary key) ENGINE=HEAP";
+      $sql = "CREATE TEMPORARY TABLE Xt_{$this->_tableName} ( contact_id int primary key) ENGINE=MyISAM";
       CRM_Core_DAO::executeQuery($sql);
 
       //used only when exclude tag is selected
@@ -436,7 +438,7 @@ function from() {
 
       $sql = "CREATE TEMPORARY TABLE It_{$this->_tableName} ( id int PRIMARY KEY AUTO_INCREMENT,
                                                                contact_id int,
-                                                               tag_names varchar(64)) ENGINE=HEAP";
+                                                               tag_names varchar(64)) ENGINE=MyISAM";
 
       CRM_Core_DAO::executeQuery($sql);
 
