Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

speed in asp

Status
Not open for further replies.

parames

MIS
Jun 26, 2000
71
MY
Hi list,

Need to know how to customize the below code, so, that it can be faster a bit..

1) If i run this code, it takes about 18/19 seconds to load the page.
2) And If i eliminate the Query2 (from 'start of Query2' to 'End of Query2') inside the Query Loop, it takes about 7/8 seconds..

Any suggestions please..


Dim count_1
count_1=0

Query = "select p_code, product_name, pm, substance, width_mm, from fg_lcb order by no desc"
Set RS=Conn.Execute(Query)

Do while Not RS.EOF
product_code = RS1("product_code")
%><tr bgcolor=#eeeeee>
<td><input type=checkbox name=sel_value value=&quot;<%=p_code%></td>
<td><font size=2><%=product_code%></font></td>
<td><select name=&quot;serial<%=count_1%>&quot;><%

'Start of Query2
Query2 = &quot;select serial_no,from_location,qty,weight,quality,remark from fg_lcb where product_code='&quot;&product_code&&quot;' order by no desc limit 2&quot;
Set RS2=Conn.Execute(Query2)

Do while Not RS2.EOF %>
<option value=&quot;<%=RS2(&quot;serial_no&quot;)%>&quot;><%=RS2(&quot;serial_no&quot;)%><%
RS2.Movenext
Loop
RS2.close

response.write &quot;</select></td>&quot; %>
'End of Query2

<td><font size=2><%=RS(&quot;product_name&quot;)%></font></td>
<td><font size=2><%=RS(&quot;pm&quot;)%></font></td>
<td><font size=2><%=RS(&quot;substance&quot;)%></font></td>
<td><font size=2><%=RS(&quot;width_mm&quot;)%></font></td>
<td><font size=2><%=RS(&quot;length_mm&quot;)%></font></td>
</tr><%
count_1=count_1+1
RS.Movenext
Loop
RS.close
Conn.close
%>

Thanks a lot,
Best Regards,
Parames.S
 
You are using loop within a loop.
Cant you eliminate that ??

Try to make a view which combines 2 tables through some key field and then try to fetch results.Or Use joins.

Well you give me structure of 2 tables.

Because here in both the queries I am seeing there is the same table being used so that can not be possible.

Have you normalized the database properly?? Rushi Shroff Rushi@emqube.com
&quot;Life is beautiful.&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top