473,548 Members | 2,691 Online
Bytes | Software Development & Data Engineering Community
+ 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.Clea r(). 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 922
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**********@c cci.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.Clea r(). 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**********@c cci.org> wrote in message
news:OY******** ******@TK2MSFTN GP15.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
2348
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 can refresh the page a million times and each time it only sends 1 email. But its the first time the page is loaded (like I open a new IE browser...
3
2071
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 to get a working system just about finished. I am building an interface for our customer service folks to use to manage registered customers and...
82
5308
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 > emacs. I've gotten a book on lisp, and I must say lisp is the ugliest > looking language syntax wise. What is up with this: (defun(foo()). (DEFUN...
3
5449
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 @dTest='2001-1-1 1:1:1:997' SELECT @dTest
0
1818
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 code SHOULD do: - read new (=updated) licensetext from file $license_path then - read and modify recursively all files from $current_dir, replacing...
0
7518
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7711
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7805
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6039
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5367
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5085
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3497
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1054
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
755
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.