跨库查询、join的优缺点 [英] Cross database queries, joins advantages and disadvantages

查看:96
本文介绍了跨库查询、join的优缺点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很困惑,在同一个 SQL Server 实例中使用跨数据库查询的优点和缺点是什么?

I am in a state of confusion that what are the advantages and disadvantages of using cross database queries within the same SQL Server instance?

我能想到的一件事是性能问题(查询会很慢),如果是这样的话,这个问题的解决方案是什么?

One thing I can think of is the performance issue (queries will be slow) if that the case what is the solution of this problem?

请用解决方案突出一些优点和缺点,以便我可以自信地处理两个数据库.

Kindly highlight some advantages and disadvantages with solution so that I can work on the two database confidently .

我有两个数据库 db1 Companies/CRM 和 db2 Products/E-commerce

I have two databases db1 Companies/CRM and db2 Products/E-commerce

推荐答案

如果你会在这里阅读文章:https://dba.stackexchange.com/questions/692/sql-server-2008-cross-database-performance-on-same-physical-机器和服务器你会意识到你不会有性能损失,因为查询优化器只是一个.区别仅在于您将使用跨实例查询.在这种情况下,查询将由两个实例上的单独查询分析器进行分析.

If you will read article here:https://dba.stackexchange.com/questions/692/sql-server-2008-cross-database-performance-on-same-physical-machine-and-server you will realize that you will not have performance penalty because query optimizer will be only one. Difference will be only if you will be use cross-instance queries.In this case, query will be analyzed by separate query analyzers on both instances.

在您的情况下可能出现的问题与管理有关.在此处阅读如何管理跨数据库所有权:http://msdn.microsoft.com/en-us/library/ms188676.aspx

Possible issues that can be in your case are related to management.Read how to manage cross-database ownership here: http://msdn.microsoft.com/en-us/library/ms188676.aspx

这篇关于跨库查询、join的优缺点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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