English 中文(简体)
TABLES ALWAYS(SQL)的JOINING为这些表格制造了 Car产品?
原标题:does (SQL) JOINING on TABLES ALWAYS create Cartesian products of those tables?
  • 时间:2011-04-12 06:49:31
  •  标签:
  • mysql
  • sql

does JOINING on TABLES ALWAYS create Cartesian products of those tables ?
if a problem can be solved by sub-query and Joining which should i prefer ?
which one is fast and memory saving ?

All the questions are tightly coupled, so please dont tell to open another thread :(

<MySQL 5

最佳回答

JOINING在TABLES ALWAYS上制造了这些表格的 Car产品?

是的,但正常的排位随后被过滤,而排位优化则足以采取更有效的办法。 不管怎样,所有产品都无条件地加入“援外”产品。

如果一个问题可以通过分局和Joining来解决,而后者应当优先解决吗?

取决于查询最佳程度和有关数据。 如同:引证。 仅靠.。

which one is fast and memory saving ?

还是试图这样做。

这确实不取决于所涉表层面积和军事术语。 基本上,在多数情况下,一种精炼的tes产品是不良的方案规划(最后,放弃了合适的条件)或非常坏的盘问计划。 在大多数情况下,汽车产品单价从未实现,而电梯优化使用另一种方法。

问题回答
  1. Yes, joining always creates a Cartesian product. That s why you usually add a condition to be met: JOIN a, b ON key_a = key_b. If the key_b is a UNIQUE KEY in table b, you will have at most one row from b for each row of a.

  2. 在大多数情况下,合并的速度更快,但有一些例外(WHERE x IN ANY (subquery))。

  3. 见2。

Yes, JOINING on tables always create Cartesian products of those tables.
you can t prefer join or sub-query because it depends on your data size
so, you have to try the two ways then you can decide which one is more appropriate to your query





相关问题
SQL SubQuery getting particular column

I noticed that there were some threads with similar questions, and I did look through them but did not really get a convincing answer. Here s my question: The subquery below returns a Table with 3 ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

php return a specific row from query

Is it possible in php to return a specific row of data from a mysql query? None of the fetch statements that I ve found return a 2 dimensional array to access specific rows. I want to be able to ...

Character Encodings in PHP and MySQL

Our website was developed with a meta tag set to... <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> This works fine for M-dashes and special quotes, etc. However, I ...

Pagination Strategies for Complex (slow) Datasets

What are some of the strategies being used for pagination of data sets that involve complex queries? count(*) takes ~1.5 sec so we don t want to hit the DB for every page view. Currently there are ~...

Averaging a total in mySQL

My table looks like person_id | car_id | miles ------------------------------ 1 | 1 | 100 1 | 2 | 200 2 | 3 | 1000 2 | 4 | 500 I need to ...

热门标签