数据库复习(五) 1、分页 limit x,m:表x=m行 where nid > 10000 直接跳过 钱10000条数,继续往下扫 1,2,3,4,5,6,7,8 ......,90,91,92,93 1 17 31 45 16 29 42 90 nid 排列可能是中断的 方式:上一页 下一页 (1)用户查看时是第一页:limit 0,10: nid:1-16 (2)第一页:limit 10,10: nid:17-36 (3)第一页:where nid>16 limit 10: nid:17-36 (4)第一页:where nid>36 limit 10: nid:17-36 2、慢SQL记录 mysql默认存储位置:slow_query_log_file = D:\slow.log 启动慢sql记录 指定配置文件 slow_query_log = ON log_queries_not_using_indexes = ON long_query_time = 0.5 slow_query_log_file = D:\slow.log 方式一:在内存中直接修改 方式二:写一个配置文件 指定: slow_query_log = ON log_queries_not_using_indexes = ON long_query_time = 0.5 slow_query_log_file = D:\slow.log -重启 -在内存中直接修改
数据库复习(五)

最新推荐文章于 2024-06-09 14:23:07 发布
