My SQL Efficient Paging

Source: Internet
Author: User
/* * Normal paging * Offset on data file 1000000 isolated 10 */select *from zoldesk_92game_net_ecms_bjwhere classid=303order by ID asclimit 1000000,10 ;/* * Efficient paging, identifying the starting index on the index * 2, from the starting index to detect 10 */select * from ZOLDESK_92GAME_NET_ECMS_BJ WHERE ID >= (    SELECT ID from    z OLDESK_92GAME_NET_ECMS_BJ    where classid=303    ORDER by id ASC    LIMIT 1000000, 1) and Classid=303order by ID Asclimit 10;

This is the downstairs approach.

SELECT * FROM ZOLDESK_92GAME_NET_ECMS_BJ WHERE ID in    (        select id from     (        select id from            zoldesk_ 92GAME_NET_ECMS_BJ            where classid=303            ORDER by id ASC            LIMIT 1000000, as    temp)


My SQL Efficient Paging

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.