有天发现一个带inner join的sql 执行速度虽然不是很慢(0.1-0.2),但是没有达到理想速度。两个表关联,且关联的字段都是主键,查询的字段是唯一索引。
sql如下:
SELECTp_item_token.*, p_item.product_typeFROMp_item_tokenINNER JOIN p_item ON p_item.itemid = p_item_token.itemidWHEREp_item_token.token ='db87a780427d4d02ba2bd49fac8xxx';
其中表 p_item_token 中 itemid 是主键, token 是唯一索引。 p_item 中
延伸阅读
学习是年轻人改变自己的最好方式
