Make sure that all joined fields are of identical types, otherwise the
query executor must cast each and every join value, which may be
affecting the query time...

Can you even define fields having foreign keys to be of a different type?
Anyway, taking a look at my JOIN

INNER JOIN users ON users.id = collections.user_id
INNER JOIN game_pieces ON game_pieces.id = collections.game_piece_id
INNER JOIN games_sets ON games_sets.id = game_pieces.games_set_id
INNER JOIN games ON games.id = games_sets.game_id

users.id is VARCHAR(20) and is a FK to collections.user_id which is VARCHAR(20)

game_pieces.id is BIGINT(20) and is a FK to collections.game_piece_id which is BIGINT(20)

games_sets.id is BIGINT(20) and is a FK to game_pieces.games_set_id which is BIGINT(20)

games.id is BIGINT(20) and is a FK to games_sets.game_id which is BIGINT(20)

thnx,
Christoph


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to