加入vs子查询表现 [英] Join vs subquery performance

查看:70
本文介绍了加入vs子查询表现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个面试问题。面试官没有提到太多。他刚问我:

我有两张桌子,他们没有主键。如果我想从两个表中选择数据。

我想通过join和sub查询了解性能。



我尝试了什么:



谷歌搜索有线索。但它们并不表示是否有主键。

It is an interview question. The interviewer did not mention too much. He just asked me:
I have two tables, They don't have primary keys. If I want to select data from the two tables.
I want to know the performance by join vs sub query.

What I have tried:

google search has clues. But they don't indicate whether primary keys.

推荐答案

Google搜索不仅仅是线索 - 它还有 answers [ ^ ]

对不起,如果你既不能回答问题,也不能通过谷歌搜索确定答案;如果你还没有说我不知道答案 - 我会检查执行计划以找出绩效差异然后我不得不质疑你如何得到面试第一个地方。



有时候正确的答案就是说我不知道......但这就是我如何发现/提醒自己/在文档中查阅...这是我给出的最佳建议,所以我将它传递给你
Google search has more than clues - it has answers[^]
I'm sorry, but if you can neither answer the question, nor determine the answer from a google search; and if you haven't got the nouse to say "I don't know the answer - I would examine the execution plan to work out the difference in performance" then I have to question how you got as far as the "interview" in the first place.

Sometimes the "right" answer is to say "I don't know ... but this is how I would find out/remind myself/look it up in the documentation"... that is the best advice I was given, so I'm passing it on to you


这篇关于加入vs子查询表现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆