The same result of the MySQL database varies greatly with different commands.

Source: Internet
Author: User
Tags mysql commands

The following articles mainly tell you about the same results of the MySQL database. When we use different commands, there will be a very big difference. The following articles mainly compare the two MySQL commands, it can be said that the difference is extremely large. Take care of the IN clause!

 
 
  1. SELECT DISTINCT a.FamilyID,a.GenusID,a.SPID,a.FamilyName,a.CFamilyName,a.GenusName,a.CGenusName,a.LName,a.CName  
  2. From IDents a,(select DISTINCT SPID from Photo Where FolderID='5bbb2ae0-a747-4f3c-afce-3ed39f784f56' AND LName!='') AS b  
  3. Where a.SPID=b.SPID  

Execution time: 0.0132 s

 
 
  1. SELECT DISTINCT a.FamilyID,a.GenusID,a.SPID,a.FamilyName,a.CFamilyName,a.GenusName,a.CGenusName,a.LName,a.CName  
  2. From IDents a  
  3. Where a.SPID IN  
  4. (select DISTINCT SPID from Photo Where FolderID='5bbb2ae0-a747-4f3c-afce-3ed39f784f56' AND LName!='')  

The execution time is 76.1623 s. The above content is the same result for the MySQL database. Using different commands is quite different from the two MySQL commands. The difference is a huge introduction. I hope you will gain some benefits.

The above content is the same result for the MySQL database. It is quite different to use different commands to compare the two MySQL commands. The difference is a huge description, and I hope it will help you in this regard.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.