A small application of createtable in mysql

Source: Internet
Author: User
Tags how to use sql
Due to the fact that the previous performance was not fully considered, the data in a daily report was too large (more than five hundred MB) and the query was very slow.

Due to the incomplete consideration of previous work capabilities, the data in a daily report is too large (more than five hundred MB) and the query is very slow. today, I plan to separate the content field of the daily report, create a table separately, and then perform associated queries only when viewing the detailed daily report. The speed will be significantly improved.

Because I don't know much about mysql, the default idea is to use php to read the original table cyclically, and then insert the content and id fields into the new table... This is an extremely inefficient practice! As I got off work, Zheng Ge taught me how to use SQL statements to complete my work for a long time... Alas...

Use the create method to save some fields in the original table as a new table. The statement is as follows:

Create table 'report _ content' (SELECT id, content FROM 'report ');

One sentence, my God !! We can see how important it is to learn SQL as a web developer !!

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.