473,480 Members | 2,269 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Weird one.

I have a dataset named "dsMessages" that has a single table. I have a timer
that runs a query against an SQL db every 5 seconds. At the beginning I have
it run dsMessages.Clear(). The first time this runs, it causes a long pause,
but then it runs fine every time thereafter. I have other datasets in the
application that seem to do the same thing... Any ideas?
Nov 21 '05 #1
2 912
It's likely the result of the way SQLS handles query execution plan
caching. The first time a query runs, it takes longer. Subsequent
executions are faster because the plan is reused. See the topic
"Execution Plan Caching and Reuse" in SQL Server Books Online for more
information. One workaround to avoid the first-time perf hit is on
startup to run those queries in the background so plans are cached and
available for reuse. This may or may not work depending on the type of
applicaton you have.

--Mary

On Mon, 8 Aug 2005 12:01:27 -0400, "Shawn" <sh**********@ccci.org>
wrote:
I have a dataset named "dsMessages" that has a single table. I have a timer
that runs a query against an SQL db every 5 seconds. At the beginning I have
it run dsMessages.Clear(). The first time this runs, it causes a long pause,
but then it runs fine every time thereafter. I have other datasets in the
application that seem to do the same thing... Any ideas?


Nov 21 '05 #2
"Shawn" <sh**********@ccci.org> wrote in message
news:OY**************@TK2MSFTNGP15.phx.gbl...
The first time this runs, it causes a long pause, but then it runs
fine every time thereafter. I have other datasets in the application
that seem to do the same thing...


As will just about every other, complex class you ever use or write
in .Net's Managed Code (although I'm surprised that /more/ than
one DataSet should do it in the same application).

It's because the first time you use any [method within a] class, the
RunTime has to go off, pull the relevant code out of the assembly,
and pop it through the Just-In-Time "Compiler" (actually, a Linker,
but what's in a name?) before it can actually execute it. Fortunately,
it only has to do this once for each method within any running process.

HTH,
Phill W.
Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2345
by: Gabriel Afana | last post by:
I have a simple php script to just send email.....When I first load the script in a browser...it sends 2 emails. Why?? The weird thing is then when I refresh the page, it send only one email...I...
3
2063
by: redneck_kiwi | last post by:
Hi all: I have a really weird problem. I am developing a customer catalog system for my company and as such have delved into sessions for authentication and access levels. So far, I have managed...
82
5281
by: nobody | last post by:
Howdy, Mike! mikecoxlinux@yahoo.com (Mike Cox) wrote in message news:<3d6111f1.0402271647.c20aea3@posting.google.com>... > I'm a C++ programmer, and have to use lisp because I want to use >...
3
5442
by: aling | last post by:
Execute following T-SQL within Queary Analyzer of SQL Server 2000: ======================================= DECLARE @dTest DATETIME SET @dTest='2001-1-1 1:1:1:991' SELECT @dTest SET...
0
1808
by: P Pulkkinen | last post by:
Dear all, sorry, i know this code is far little too long to debug here, but there is really annoying logical error. If someone debugs this, I really offer warm virtual handshake. What this...
0
7051
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7097
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6750
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5353
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4794
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3003
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2993
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
567
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.