mysql - does (SQL) JOINING on TABLES ALWAYS create Cartesian products of those tables? -


does joining on tables create cartesian products of tables ?
if problem can solved sub-query , joining should prefer ?
1 fast , memory saving ?

all questions tightly coupled, please dont tell open thread :(

mysql 5

does joining on tables create cartesian products of tables ?

yes, normall filtered down , query optimizer smart enough take more efficient approach. anyhow, joins without conditions cartesian products ni start.

if problem can solved sub-query , joining should prefer ?

depends lot on query optimizer , data in question. in: try out. prettym uch way.

which 1 fast , memory saving ?

again - try out.

this stuff depends no table sizes involved , filter conditions. materialized cartesian product in cases bad programming (ups, forgot fitler conditions) or bad query plan. in cases cartesian product iwll never materialize , query optimizer use different approach.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -