跨数据库查询.如何正确使用跨数据库功能? [英] Cross database queries.How to proper use cross database features?

查看:61
本文介绍了跨数据库查询.如何正确使用跨数据库功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究将一个数据库拆分为多个数据库的可能性.我们决定将一些表移到另一个数据库中,但是我们在这些表上有带有联接的查询.我找到了一些有关如何实现该目标的解决方案:

I am investigating the possibility to split one DB into multiple. We decided to move some tables into another database, but we have queries with join on these tables. I found a few solutions about how to achieve that:

  1. Azure SQL数据库弹性查询
  2. 但是我不知道它们之间的区别以及选择什么.

    But I don`t know what the difference between them and what to choose.

    感谢您的帮助!

    推荐答案

    Azure SQL数据库弹性查询和外部数据源是同一概念的两个名称.

    Azure SQL Database Elastic Queries and External data sources are two names for the same concept.

    我的建议是避免跨数据库查询,并避免将一个数据库拆分为多个数据库,因为无论选择哪种策略来查询这些外部表,涉及外部数据源的查询性能都将不同.

    My suggestion is to avoid cross database queries and avoid splitting one database into multiples because query performance involving external data sources won't be the same no matter what strategy you choose to query those external tables.

    如果您仍要坚持将数据库拆分为多个数据库的计划,那么请知道,当远程表不大时,跨数据库查询显示出良好的性能.当远程表很大时,其他文章还向您展示了如何将参数化的操作推送到远程数据库并提高性能.

    If you still want to stick with the plan of splitting the database into multiple databases, then know that cross database queries show good performance when the remote tables are not big. When remote tables are big, this article shows you how to perform joins remotely using table variables and improve performance. This other article shows you also how to push parameterized operations to remote databases and improve performance.

    这篇关于跨数据库查询.如何正确使用跨数据库功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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