Why can't I remember the damn command parameters for migrating Vps websites?

Source: Internet
Author: User
Although I can't remember it, I sometimes share it in my blog to my webmasters who come here to find information about website migration.

Although I can't remember it, I sometimes share it in my blog to my webmasters who come here to find information about website migration.

Not to mention CodeBegin

// For linux tar, decompress tar-zcvf m7766.tar.gz unzip-zxvf/usr/backup/m7766.tar.gz/shell to query the number of tables in the current database: mysql-uroot-pzhushishenme-P3306-BN- e 'show databases; '| grep-v mysql | grep-v information_schema // mysqldump shell export SQLmysqldump-uroot-pzhushishenme-P3306 \ -- quick -- add-drop-table -- order-by-primary \-- complete-insert -- extended-insert = false -- skip-comments \ -- default-character-set = utf8 -- add-locks \ -- databases 7766> dbs/7766c. SQL // mysql <*. SQL // Import mysql-uroot-pzhushishenme-P3306 <7766c. SQL

Shenma? Not enough. let's look at another logical question about mysql optimization. of course, we don't consider data robustness.

// View the total number of items select count (*) from tables; + ---------- + | count (*) | + ---------- + | 536477 | + ---------- + 1 row in set (0.00 sec) // execute the select count (*) from tables where status in (1, 2); + ---------- + | count (*) statement (*) | + ---------- + | 534579 | + ---------- + 1 row in set (1.96 sec) // run the select count (*) from tables where status in () statement of B ); + ---------- + | count (*) | + ---------- + | 1898 | + ---------- + 1 row in set (0.01 sec)

In actual execution, such SQL statements can be optimized logically.

Select count (*) from tables result minus B statement result to get the corresponding result.

Therefore, you need to perform a logical modification to the existing count-related code to optimize the execution efficiency.

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.