1、在用到的列上建立索引
2、查看一下执行计划,看看对资源的使用和语句的处理上是否合理,尽量避免全表扫描和多层嵌套排序
select
*
from
receivefax a,
(select staff_id from group_staff where group_id in
(select group_id from group_staff where staff_id='1000')) b
where
a.staff_id=b.staff;
2、查看一下执行计划,看看对资源的使用和语句的处理上是否合理,尽量避免全表扫描和多层嵌套排序
select
*
from
receivefax a,
(select staff_id from group_staff where group_id in
(select group_id from group_staff where staff_id='1000')) b
where
a.staff_id=b.staff;
from
receivefax tla,
group_staff tlb,
group_staff tlc
where
tlc.staff_Id='1000'
and tlc.group_id = tlb.group_id
and tla.staff_Id = tlb.staff_Id;如果好用了,你怎么给我月饼?