Ticket #43 (closed 优化: fixed)
sql 优化
| Reported by: | chenchongqi | Owned by: | yuanhuoqing |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | 产品库 | Version: | 产品库3.0 |
| Keywords: | Cc: | ||
| Due Date: |
Description
这类查询比较多,需要改为绑定变量的方式。
select * from ( select f.name as variance_name, a.*,(
a.last_count_order-a.count_order) as rise_diff ,b.name as t_name,b.parent_id as
t_parent_id,b.forum_dir,b.forum_id as t_forum_id,b.pub_url as t_pub_url,b.pub_di
r ,d.price as area_price , nvl(e.min_price,0) as min_price, nvl(e.max_price,0)
as max_price from PDL_PRODUCT a, PDL_PRODUCT_TYPE b ,( SELECT * FROM PP_PRICE
WHERE PRICE BETWEEN 6001 AND 7000 AND AREA_ID = 100) d,eml_price e ,pdl_produc
t_variance f where a.status!=0 and a.review_status<>4 and a.order_type<2 and a.c
oncept is null and a.type_id=b.id and b.status=1 and b.type=3 and b.parent_id=:
1 and a.id=d.product_id and e.product_id(+)= a.id and a.variance_id=f.id(+)
order by a.last_count_order asc) where rownum <= :2
![(please configure the [header_logo] section in trac.ini)](http://www1.pconline.com.cn/hr/2009/global/images/logo.gif)