Home  >  Article  >  Backend Development  >  mysql数据库join优化

mysql数据库join优化

WBOY
WBOYOriginal
2016-06-06 20:07:56929browse

表1

goodscategory_id
goodscategory_name

表2
goods_id
goods_cid
goods_name

通过join语句goods_cid和goodscategory_id 相关联

除了该方法联表还有其他的方案吗?join感觉好慢

回复内容:

表1

goodscategory_id
goodscategory_name

表2
goods_id
goods_cid
goods_name

通过join语句goods_cid和goodscategory_id 相关联

除了该方法联表还有其他的方案吗?join感觉好慢

通过索引单表取出数据,在程序中进行join操作。join子查询都是mysql的硬伤

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