sql page optimization

Index Tuning

Note that multiple columns, the index may lead to failure. With a limit or specify the data area reduction column can be solved.

limit Page Optimization

Paging limit can be used when two or three million or so, first check out the front page n-1 times the maximum value max (date) when more than one hundred thousand records this as the start time. Only change parameters here below 300,000, there is a query on page 30001 of the data.

select * FROM
    tbl where sysDate >=(select max(sysDate) from (select sysDate from tbl where sysDate>='2018-03-01 00:00:00' order by sysdate asc limit 0,300000) aa)
    AND sysDate <=  '2019-08-27 23:59:59' limit 0,10

 

 

Guess you like

Origin www.cnblogs.com/aeolian/p/11420030.html