作者:小古 | 来源:互联网 | 2023-05-17 14:15
Ihavetwotablesletssayemployeesandorder,bothtablehavemillionsofrecords.我有两个表让员工和订单说,两个
I have two tables lets say employees and order, both table have millions of records.
我有两个表让员工和订单说,两个表都有数百万条记录。
Select orders.*
from orders
INNER JOIN employees
on Employees.id = orders.employeeid
WHERE orders.type='daily'
and orders.date > Employees.registerDate
and orders.date
The above query is rough query, there may be syntax error, but is just considerations.
以上查询是粗略查询,可能存在语法错误,但仅仅是考虑因素。
The query consuming almost 60 seconds to load, any body know how can i optimize this query
该查询耗费近60秒加载,任何机构都知道如何优化此查询
2 个解决方案