oracle查询语句 请教如何把这个查询的效率提高
select f.type_name, b.elec_string, e.source_name, d.supplyer_name
   from mobile_storage           a,
        mobile_sale_detail       b,
        mobile_contract          c,
        mobile_param_supplyer    d,
        mobile_param_mobile_type f,
        mobile_param_source      e
  where a.elec_string = b.elec_string
    and a.source_id = e.source_id
    and c.supplyer_id = d.supplyer_id
    and a.contract_id = c.contract_id
    and b.mobile_type = f.mobile_type
    and b.sale_id = '12345'               --条件1   id='12345'  (页面传入条件)  
    and b.mobile_type = 'HUAW0003';       --条件2   mobile_type = 'HUAW0003'  (页面传入条件)
这是我现在的查询方法,效率不高,我不知道怎么改进,而且不同的条件查询有差,快的在10秒左右,慢的在1分钟左右,无法接受。
下面我先介绍下几个表结构,只将所需关键列给出  (数据量很大,必须要效率高)
【mobile_storage】  a       
   [mobile_type]  //终端类型
   [elec_string]  //终端串号●,每个终端唯一,根据串号可唯一确定一个终端
   [source_id]    //用来关联【mobile_param_source表的source_id】查找终端的功能
   [contract_id]  //用来关联【mobile_contract表的contract_id】查找供应商[supplyer_id]
                    再用[supplyer_id]去对于【mobile_param_supplyer表的supplyer_id】查找供应商名称[supplyer_name]    
【mobile_sale_detail】 b  
   [sale_id]      //销售单号,一个单号可能包含多个终端    
   [mobile_type]  //终端类型   
                    (用[sale_id],[mobile_type]来确定[elec_string]去对应【mobile_storage表中的】[elec_string])
   [elec_string]  //终端串号,每个终端唯一,根据串号可唯一确定一个终端
【mobile_contract】 c
   [contract_id]  //
   [supplyer_id]  //用来关联【mobile_param_supplyer表】查询出供应商名称字段[supplyer_name]
【mobile_param_supplyer】 d
   [supplyer_id]  //供应商ID
   [supplyer_name]//供应商名称字段●  
【mobile_param_mobile_type】 f
   [mobile_type]  //终端类型
   [type_name]    //终端类型名称●    
【mobile_param_source】 e
   [source_id]    //功能ID
   [source_name]  //终端功能名称●        
   注:●为需要查询出来的四个字段    
基本逻辑:
   输入2个参数为   id='12345' 和  mobile_type='HUAW0003'
   从【b表】中查找到elec_string去关联【a表】查找到contract_id和source_id分别对应【c表】【e表】
   再根据【c表】中的supplyer_id去【d表】中找到supplyer_name
还有不清楚的请问我,我想应该很详细了
------解决方案--------------------每个表的数据量有多少? 相关字段建索引。如果还慢就把执行计划贴上来。
1:
b.sale_id  -- 数据类型是number型的还是varchar2型的,如果是number型的换成下面的语句试试:
and b.sale_id = 12345
2: 如果是web程序传过来的值,把下面换成绑定变量的方式:
and b.sale_id = '12345'              --条件1  id='12345'  (页面传入条件)  
and b.mobile_type = 'HUAW0003';      --条件2  mobile_type = 'HUAW0003'  (页面传入条件)  
比如:在JAVA里面,
...
and b.sale_id = ?
and b.mobile_type = ?;
...
------解决方案--------------------使用绑定变量,不要直接输入字符串。