If you are unable to create a new account, please email support@bspsoftware.com

 

What happens , when cross join is created between query subjects

Started by inu, 23 Jul 2014 10:11:49 AM

Previous topic - Next topic

inu

Hi
Please tell me , cross join is good for performance, or not.
When we need to take help of cross joins.
What it actually does, if created.


Thanks
Inam

MFGF

Quote from: inu on 23 Jul 2014 10:11:49 AM
Hi
Please tell me , cross join is good for performance, or not.
When we need to take help of cross joins.
What it actually does, if created.


Thanks
Inam

No - cross joins are generally not at all good for performance. Consider a scenario:

You have two tables, each containing only 1000 rows of data. Not big, by any means. If you enable a cross-join between them, you effectively join every row of the first table to every row of the second table. That will return a result set of 1,000,000 rows - which is rather larger than you might expect. There are certain occasions when cross-joins might be useful, but they are less common than you might imagine.

MF.
Meep!

linbai

Quote from: MFGF on 23 Jul 2014 11:46:23 AM
No - cross joins are generally not at all good for performance. Consider a scenario:

You have two tables, each containing only 1000 rows of data. Not big, by any means. If you enable a cross-join between them, you effectively join every row of the first table to every row of the second table. That will return a result set of 1,000,000 rows - which is rather larger than you might expect. There are certain occasions when cross-joins might be useful, but they are less common than you might imagine.

MF.

+1 good
may be ETL is a good way to cross-join tables.