当我尝试运行查询时,却发现了以下问题
**Incorrect key file for table '/tmp/#sql_53b8_0.MYI'; try to repair it**
以下是查询,我是否需要优化更多。
SELECT A.id,A.user_id,A.trans_id,A.work_order_id,A.total_ammount, A.work_order_status,B.first_name,B.last_name, DATE_FORMAT(transaction_date,'%d-%m-%Y')AS transaction_date1, o.status as tstatus,os.status as act_status FROM tbl_order A LEFT JOIN tech_order o ON A.id = o.orderId LEFT JOIN tech_orderstatus os ON o.orderId = os.orderId AND o.technicianID = os.techid,tbl_user B. 在'2016-11-08'和之间的A.user_id = B.id和A.transaction_date '2016-11-08'和os.status ='closed'OR order_status ='关闭'或 o.status ='关闭'ORDER BY transaction_date ASC
答案 0 :(得分:0)
您正在进行大型连接,并且临时表的磁盘空间不足。你可以做一些事情。
请参阅此处的解决方案:
MySQL: Incorrect key file for table '/tmp/#sql_185e_0.MYI'; try to repair it
Incorrect key file for table '/tmp/#sql_3c51_0.MYI'; try to repair it
How do you fix a MySQL "Incorrect key file" error when you can't repair the table?
此外,您可能通过搜索" mysql错误的密钥文件类型尝试修复它来找到其他堆栈溢出帖子"