Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

A simple Optimization Analysis of left join SQL

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

The sql of an associated query takes more than 2 seconds, so check it out:

SELECT a.id, a.brand_id, a.series_id, a.product_id, a.material_id, a.custom_category_id, a.price, a.product_url, a.organ_id .from pm_brand_xxxx aLEFT JOIN pm_brand_yyyyy d ON a.series_id = d.idWHERE a.is_delete = 0AND d.is_delete = 0AND a.organ_id = 'Cxxx'AND a.brand_id = 6491603AND d.brand_id = 6491603AND a.model_flag = 14 Mysql > show profile for query 4 +-- +-+ | Status | Duration | +-+-+ | starting | 0.000072 | | checking permissions | 0.000002 | checking permissions | 0.000002 | | Opening tables | 0.000011 | | init | | 0.000026 | | System lock | 0.000007 | | optimizing | 0.000016 | | statistics | 0.000142 | | preparing | 0.000018 | executing | 0.000002 | | Sending data | 2.281192 | |

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report