List:Internals« Previous MessageNext Message »
From:Michael Widenius Date:June 26 2001 4:29pm
Subject:32 Table Join Limit
View as plain text  
Hi!

>>>>> "Ed" == Ed Blackmond <Ed@stripped> writes:

Ed> I have run up against the 32 table limit for joins in a query.  I looked
Ed> through the code, found the constant MAX_TABLES, changed it and
Ed> recompiled.  I no longer get the error message, but the daemon now dumps
Ed> core if I increase the number of tables beyond the 32 table limit (it
Ed> works fine otherwise).

Ed> Obviously, there is more to it than this simple adjustment.  Has anybody
Ed> else tried to deal with this?

MySQL uses bits when optimizing join conditions; By default MySQL uses an
ulong for this, which limits the number of tables to 32 on 32 bit system.

To increase this, you can change in sql/mysql_priv.h:

typedef ulong table_map

to 

typedef ulonglong table_map

and recompile.

Regard's
Monty
Thread
32 Table Join LimitEd Blackmond26 Jun
  • 32 Table Join LimitMichael Widenius26 Jun