sql优化记录

来源:互联网 发布:linux deepin15 编辑:程序博客网 时间:2024/05/21 09:03
select a.* from test_quartz a LEFT JOIN loan_app b on a.del_flag = b.del_flag LIMIT 1000003,19


SELECT a.* from test_quartz a LEFT JOIN loan_app b on a.del_flag = b.del_flag where a.test_quartz_id>(
select a1.test_quartz_id from test_quartz a1 LEFT JOIN loan_app b1 on a1.del_flag = b1.del_flag LIMIT 1000000,1
) LIMIT 19


select a.* from test_quartz a INNER JOIN (select test_quartz_id from test_quartz a LEFT JOIN loan_app b on a.del_flag = b.del_flag LIMIT 1000002,19) t1 USING(test_quartz_id)


CREATE VIEW test_view AS  
SELECT a.test_quartz_id,a.cur_status,a.del_flag 
FROM ( test_quartz a LEFT JOIN loan_app b on a.del_flag = b.del_flag )


drop view test_view


select test_quartz_id from test_view LIMIT 1000007,19
select a.* from test_view a INNER JOIN (select test_quartz_id from test_view LIMIT 1000006,19) t1 USING(test_quartz_id)  
select a.* from test_view a where a.test_quartz_id>(select b.test_quartz_id from test_view b LIMIT 1000007,1) LIMIT 19
0 0
原创粉丝点击