oracle mysql 查询对比_Oracle/MySQL/PostgreSQL 简单查询的性能对比

mysql> EXPLAIN

SELECT count(1) AS s

FROM item

LEFT JOIN color_info ON color_info.color_no = item.color_no

LEFT JOIN brand ON brand.brand_no = item.brand_no

LEFT JOIN shop_brand   ON shop_brand.brand_no = item.brand_no

WHERE 1 = 1;

+----+-------------+------------+--------+---------------+---------------------+---------+-----------------------+--------+-----------------------------------------------------------------+

| id | select_type | table      | type   | possible_keys | key                 | key_len | ref                   | rows   | Extra                                                           |

+----+-------------+------------+--------+---------------+---------------------+---------+-----------------------+--------+-----------------------------------------------------------------+

|  1 | SIMPLE      | item       | index  | NULL          | ix_brand_color_no_1 | 109     | NULL                  | 322260 | Using index                                                     |

|  1 | SIMPLE      | color_info | eq_ref | uk_color_no   | uk_color_no         | 54      | lottery.item.color_no |      1 | Using index                                                     |

|  1 | SIMPLE      | brand      | eq_ref | uk_brand_no   | uk_brand_no         | 54      | lottery.item.brand_no |      1 | Using index                                                     |

|  1 | SIMPLE      | shop_brand | index  | NULL          | uk_store_brand      | 165     | NULL                  |  61992 | Using where; Using index; Using join buffer (Block Nested Loop) |

+----+-------------+------------+--------+---------------+---------------------+---------+-----------------------+--------+-----------------------------------------------------------------+

4 rows in set

mysql>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值