如何加入索引语句?
假设有一存储过程:(对两个表进行联合查询)
CREATE procedure orderselect
@orderform varchar(15)='',
@types nvarchar(15)=''
AS
select distinct
a.orderform,a.orderdate,a.clientid,b.types,b.resname,b.unit,b.orderqty,
b.orderprice,b.moneys,b.criterionprice,b.remark,a.subscription,a.consignmentdate,a.consignmentlocus,a.dealwithman,a.PO,a.remark2,b.states from ordermaster a,orderdetail b
where a.orderform=b.orderform
and a.orderform like '%'+@orderform+'%'
and b.types like '%'+@types+'%'
查询结果量很大,导致速度很慢,请问在此基础上如何创建索引?