Home  >  Article  >  Backend Development  >  查两次数据库 VS 合并查询 该如何选择?

查两次数据库 VS 合并查询 该如何选择?

WBOY
WBOYOriginal
2016-06-23 13:53:00876browse

打个比方

就以论坛来讲,

帖子表+会员表

才能显示 文章内容页面的基本内容


A. 一般是查询好内容,什么作者ID,再去SELECT 会员表吗?

B. 还是查询时已经同时做好合并查询 把 帖子表.作者ID  = 会员表.会员ID ???

那个比较好?  大家应该是以效能作选择吧?


回复讨论(解决方案)

对于关系型数据库(SQL),B 是首选
对于 noSQL, A 是首选

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn