R
rgayle
I have a table that contains 231 k records, the current where clause
causes the sql to execute really slow (2 mins on 1.2ghz Amd Win2k).
removing this portion "or pgrpcode=listview.grpcode" and the query
returns in about 2 seconds.
select pqtybreak,pgrpcode,pprice,qty,grpcode,stock_code from pricing,
(select qty,partnum,stockcode,grpcode from listtbl ,pmethod, stocktbl
where pmethod.stock_code = stocktbl.stockcode
and stocktbl.partcode=listtbl.partnum
and listtbl.listid=123) as listview
where (pstockcode = listview.stock_code or pgrpcode=listview.grpcode)
and pqtybreak >= listview.qty
and pctrycode = 'c01'
causes the sql to execute really slow (2 mins on 1.2ghz Amd Win2k).
removing this portion "or pgrpcode=listview.grpcode" and the query
returns in about 2 seconds.
select pqtybreak,pgrpcode,pprice,qty,grpcode,stock_code from pricing,
(select qty,partnum,stockcode,grpcode from listtbl ,pmethod, stocktbl
where pmethod.stock_code = stocktbl.stockcode
and stocktbl.partcode=listtbl.partnum
and listtbl.listid=123) as listview
where (pstockcode = listview.stock_code or pgrpcode=listview.grpcode)
and pqtybreak >= listview.qty
and pctrycode = 'c01'