|
版本: |
其它(帖子中说明) |
小版本号: |
|
|
|
数据库: |
MySQL |
服务器操作系统: |
Windows |
应用服务器: |
Tomcat |
客户端操作系统: |
Windows 7 |
浏览器: |
Chrome |
|
|
这里有一个input框,可以根据输入的选项进行模糊查询,这是没有问题的,可是数据一定数量的时候,查询就会变得很慢,甚至页面会崩溃
根据控制台给出的sql查询语句是这么查的,有什么好办法可以优化一下这种情况?
--> sql:SELECT count(*) FROM YB_QYXX YB_QYXX WHERE (UPPER(YB_QYXX.FXYBH) LIKE ?) OR (UPPER(YB_QYXX.FXM) LIKE ?) OR (UPPER(YB_QYXX.FSFZH) LIKE ?) OR (UPPER(YB_QYXX.FYHKH) LIKE ?) OR (UPPER(YB_QYXX.FJTBH) LIKE ?) OR (UPPER(DATE_FORMAT(YB_QYXX.FZXSJ, '%Y-%m-%d %H:%i:%s')) LIKE ?)
--> binds:[%D%, %D%, %D%, %D%, %D%, %D%]
2017-10-30 16:19:50 [SQL Time]sql 执行时间:18133ms, exec KSQL:
--> sql:SELECT count(*) FROM YB_QYXX YB_QYXX WHERE (UPPER(YB_QYXX.FXYBH) LIKE ?) OR (UPPER(YB_QYXX.FXM) LIKE ?) OR (UPPER(YB_QYXX.FSFZH) LIKE ?) OR (UPPER(YB_QYXX.FYHKH) LIKE ?) OR (UPPER(YB_QYXX.FJTBH) LIKE ?) OR (UPPER(DATE_FORMAT(YB_QYXX.FZXSJ, '%Y-%m-%d %H:%i:%s')) LIKE ?)
--> binds:[%D1234567%, %D1234567%, %D1234567%, %D1234567%, %D1234567%, %D1234567%]
|
|