How to query the table data quickly

Source: Internet
Author: User
Help: How to quickly query the table data
Because of their own reasons, in the whole table of the purchase list of data there are two fields out of the wrong, you need to take out the data table, in the update to the purchase list,
Because the amount of data is larger than the school, I did not choose to update
I've built another table B, I'm programmed to do this SQL loop whole Group A
SELECT * from Tuangoua limit 0,600;
SELECT * from Tuangoua limit 600,600;
SELECT * from Tuangoua limit 1200,600;

At the beginning of the waiting, the speed is quite fast, but when the base arrives


SELECT * from Tuangoua limit 6000000, 10;

I take 10 data, all need 4 seconds more clock, at this speed down, do not know to run to when Ah, 6 million just my table a half of the data, so I am particularly anxious, but can not find other methods.
Gentlemen, do you have any good ways not ah.



------Solution--------------------
The ID is the primary key, and the ID is continuous
SELECT * from Tuangoua where id>= 6000000 limit 10;

------Solution--------------------
Every time you get the data, it's a little bit less, and it's a lot less time to take 10,000 loops.
------Solution--------------------
discuss

The ID is the primary key, and the ID is continuous
SELECT * from Tuangoua where id>= 6000000 limit 10;

------Solution--------------------
Too much data can be divided into tables
------Solution--------------------
It's not a conditional query, it's slow.
------Solution--------------------
If you're not going to choose all of them, do not use SELECT * with the Select field from which you will select * Fast but use the order by more obviously
------Solution--------------------
Refer to the following paragraph for "High performance MySQL (2nd edition) Chinese version"
  • 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.