跨同一服务器上的两个mysql数据库查询的性能? [英] Performance of querying across two mysql databases on the same server?

查看:2011
本文介绍了跨同一服务器上的两个mysql数据库查询的性能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

与同一数据库中的两个数据库进行合并相比,查询同一MySQL服务器上的两个(或多个)数据库是否会对性能产生影响?

Is there any performance hit from querying over two (or more) databases on the same MySQL server, compared to if those databases had been merged into one?

背景知识,我继承了Web应用程序的维护,该应用程序将其数据分成在同一服务器上运行的三个不同的数据库,一个数据库用于内容,一个数据库用于用户和组信息,另一个数据库用于用户生成的数据.这很方便,例如,它使设置权限变得容易,用户数据有些敏感,因此不需要知道的人就不能访问它.但是,该应用程序的主要功能之一是为内容的用户或组提供进度报告.这意味着它必须跨两个或多个数据库查询才能生成报告.

Background, I have inherited maintenance over a web application that splits its data into three different databases that runs on the same server, one for content, one for users and group information and one for user generated data. This is convenient, for example it makes it easy to set up permissions, the user data is somewhat sensitive so people who don't need to know should not have access to it. However, one of the main features of the application is providing progress reports for users or groups on the content. Which means that it has to query across two or more of the databases in order to generate the report.

这样做会降低性能吗?

推荐答案

否.在MySQL中,数据库"本质上只是目录,对数据的存储或查询方式没有影响.

No. In MySQL, "databases" are essentially just catalogues which have no effect on the way data are stored or queried.

从查询执行的角度来看,查询不同数据库中的两个表与查询同一数据库中的两个表相同.

Querying two tables in different databases is the same as querying two tables in the same db, from a query execution standpoint.

这篇关于跨同一服务器上的两个mysql数据库查询的性能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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