Optimising Database Calls
- From: "Martin Eyles" <martin.eyles@xxxxxxxxxxxxxxxxxx>
- Date: Wed, 20 Sep 2006 14:44:02 +0100
I have an ASP page that makes a vml/svg graph out of data. In order to
extract all the necessary data I have to perform 68 SQL queries, which is
unfortunatley a bit slow at the moment.
For each of the procedures I go through code of this form
Dim conn As New SqlClient.SqlConnection("Data Source=" & ServerName & ";
User ID=***; Password=***")
conn.Open()
SQL = "" 'in operation has code to dynamically construct one of the
queries.
Dim command As New SqlClient.SqlCommand(SQL, conn)
Dim r As SqlClient.SqlDataReader
r = command.ExecuteReader
While r.Read
'Code here to extract data and plot one section of the graph
End While
r.Close()
conn.Close()
Is there anything I am doing here that would make the code slower. For
instance, can I share one connection, and with this speed things up? Is
there a way to keep the same command object and keep changing the SQL? would
this be any faster? Any other ideas on how to speed this up?
Thanks,
Martin
.
- Follow-Ups:
- Re: Optimising Database Calls
- From: bruce barker \(sqlwork.com\)
- Re: Optimising Database Calls
- From: Richard Brown
- Re: Optimising Database Calls
- Prev by Date: Re: Menu Control - current node
- Next by Date: Re: Detecting script enabled
- Previous by thread: Need Advice?
- Next by thread: Re: Optimising Database Calls
- Index(es):
Relevant Pages
|