Workaround For Max Join Limit Using Drupal Views Module

If you have a web host or are working with a web host that severely limits the number of joins you can do in mysql, have not fear, there is a work around.  Include the following code before your mysql query is executed.

mysql_query('set SQL_BIG_SELECTS=1');

If you are using Drupal and the Views module, which you should be, the problem is figuring out where to put this.  I settled with adding it just before line 775 of view.inc inside the /views/includes/ directory.  Putting the code here runs the statement above before evey views query is exectured.  Let me know if there is a better way.

mysql_query('set SQL_BIG_SELECTS=1');  $result = db_query($query, $args);

comments powered by Disqus

© Balanced Scale Media, LLC. All right reserved.