借鉴https://www.cnblogs.com/ssrstm/p/5753068.html和https://www.cnblogs.com/exe19/p/5786806.html 1. 对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引. 2. 应尽量避免在 where 子句中对字段进行 null 值判断,应尽量避免在 where 子句中使用!=或<>操作符,应尽量避免在 where 子句中使用 or 来连接条件因为以上的查询会导致导致…
select * from gmvcsbase.base_file file,gmvcsbase.base_user user,gmvcsbase.base_department dep,gmvcsbase.base_workstation work where file.police_id=user.police_id and user.dep_code=dep.code and file.workstation_sid=work.sid and file.capture_time>='201…