MySQL Forums
Forum List  »  General

max table num in join
Posted by: Yoshiaki Tajika
Date: April 14, 2005 08:02PM

I'd like to join over 61 tables.

The max table num in join is defined in sql/unireg.h

----------------------
#define MAX_TABLES (sizeof(table_map)*8-3) /* Max tables in join */
#define PARAM_TABLE_BIT (((table_map) 1) << (sizeof(table_map)*8-3))
#define OUTER_REF_TABLE_BIT (((table_map) 1) << (sizeof(table_map)*8-2))
#define RAND_TABLE_BIT (((table_map) 1) << (sizeof(table_map)*8-1))
#define PSEUDO_TABLE_BITS (PARAM_TABLE_BIT | OUTER_REF_TABLE_BIT | \
RAND_TABLE_BIT)
-------------------------

The 'table_map' equals ulonglong (typedef in sql/mysql_priv,h).
So, sizeof(table_map)*8-3 = 8*8-3 = 61. This is max num to be joined.

I'd like to make it larger, How should I change these defined values?
I don't understand why it is multiplied by 8, and subtract 3, and
what relationship are there between MAX_TABLES and PARAM_TABLE_BIT,
OUTER_REF_TABLE_BIT, ... etc.

Please give me advice.

Options: ReplyQuote


Subject
Written By
Posted
max table num in join
April 14, 2005 08:02PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.