473,388 Members | 1,199 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Updating statistics

Hello all,

I've written a stored procedure which runs OK for the
first few thousand records it processes, then around
about the 10,000th record it suffers a sudden and dramatic
drop in performance (from about 40 records per second to
about 1 per second).

I've found that when this happens, if I run an UPDATE STATISTICS
query on the affected tables, performance picks up again,
which is good. However, this is a query that will be
running unattended, so I thought that I good idea would
be to put the UPDATE STATISTICS statement in the stored
procedure and have it run after about eight thousand records
have been processed.

However, I find that even though the statement is run
after the 8,000th record, the performance drop *still*
occurs after the 10,000th record. I find this odd because
the statistics have just recently been updated. Is there
anything else I should be looking at?

TIA,

--
Akin

aknak at aksoto dot idps dot co dot uk
Jul 20 '05 #1
4 2675
Sky
Have you looked at execution plan of the query? Does the query optimizer
available to use indexes which defined on the table?
"Sky Fly" <no****@blackhole.com> wrote in message
news:c6************@ID-18325.news.uni-berlin.de...
Hello all,

I've written a stored procedure which runs OK for the
first few thousand records it processes, then around
about the 10,000th record it suffers a sudden and dramatic
drop in performance (from about 40 records per second to
about 1 per second).

I've found that when this happens, if I run an UPDATE STATISTICS
query on the affected tables, performance picks up again,
which is good. However, this is a query that will be
running unattended, so I thought that I good idea would
be to put the UPDATE STATISTICS statement in the stored
procedure and have it run after about eight thousand records
have been processed.

However, I find that even though the statement is run
after the 8,000th record, the performance drop *still*
occurs after the 10,000th record. I find this odd because
the statistics have just recently been updated. Is there
anything else I should be looking at?

TIA,

--
Akin

aknak at aksoto dot idps dot co dot uk

Jul 20 '05 #2
OK,

I think I've found out what's causing the problem. After examining
a trace I ran on the db, I found out that at the times when the
performance drops, a system stored procedure - sp_sqlagent_get_perf_counters
- is running.

What I would like to know is: what does this sp do? Why does it run?
Is it safe to stop it or prevent it from running on occasion?
How do I do this?

TIA,

--
Akin

aknak at aksoto dot idps dot co dot uk

"Uri Dimant" <ur**@iscar.co.il> wrote in message
news:u9**************@tk2msftngp13.phx.gbl...
Sky
Have you looked at execution plan of the query? Does the query optimizer
available to use indexes which defined on the table?
"Sky Fly" <no****@blackhole.com> wrote in message
news:c6************@ID-18325.news.uni-berlin.de...
Hello all,

I've written a stored procedure which runs OK for the
first few thousand records it processes, then around
about the 10,000th record it suffers a sudden and dramatic
drop in performance (from about 40 records per second to
about 1 per second).

I've found that when this happens, if I run an UPDATE STATISTICS
query on the affected tables, performance picks up again,
which is good. However, this is a query that will be
running unattended, so I thought that I good idea would
be to put the UPDATE STATISTICS statement in the stored
procedure and have it run after about eight thousand records
have been processed.

However, I find that even though the statement is run
after the 8,000th record, the performance drop *still*
occurs after the 10,000th record. I find this odd because
the statistics have just recently been updated. Is there
anything else I should be looking at?

TIA,

--
Akin

aknak at aksoto dot idps dot co dot uk


Jul 20 '05 #3
Sky
By running this stored procedure SQLAgent is determined if there are any
thresholds changed for
the alerting system. However you can change the interval by editing registry
key. ( May be danger)
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL
Server\Server_Name\SQLServerAgent\PerformanceSampl ingInterval
"Sky Fly" <no****@blackhole.com> wrote in message
news:c6************@ID-18325.news.uni-berlin.de...
OK,

I think I've found out what's causing the problem. After examining
a trace I ran on the db, I found out that at the times when the
performance drops, a system stored procedure - sp_sqlagent_get_perf_counters - is running.

What I would like to know is: what does this sp do? Why does it run?
Is it safe to stop it or prevent it from running on occasion?
How do I do this?

TIA,

--
Akin

aknak at aksoto dot idps dot co dot uk

"Uri Dimant" <ur**@iscar.co.il> wrote in message
news:u9**************@tk2msftngp13.phx.gbl...
Sky
Have you looked at execution plan of the query? Does the query optimizer
available to use indexes which defined on the table?
"Sky Fly" <no****@blackhole.com> wrote in message
news:c6************@ID-18325.news.uni-berlin.de...
Hello all,

I've written a stored procedure which runs OK for the
first few thousand records it processes, then around
about the 10,000th record it suffers a sudden and dramatic
drop in performance (from about 40 records per second to
about 1 per second).

I've found that when this happens, if I run an UPDATE STATISTICS
query on the affected tables, performance picks up again,
which is good. However, this is a query that will be
running unattended, so I thought that I good idea would
be to put the UPDATE STATISTICS statement in the stored
procedure and have it run after about eight thousand records
have been processed.

However, I find that even though the statement is run
after the 8,000th record, the performance drop *still*
occurs after the 10,000th record. I find this odd because
the statistics have just recently been updated. Is there
anything else I should be looking at?

TIA,

--
Akin

aknak at aksoto dot idps dot co dot uk



Jul 20 '05 #4
Hello Uri,

I tried changing this setting in the registry to 0; I tried changing
it to a very large value; I tried deleting the alerts in EM;
all made no difference.

So I've decided that I will call update statistics every 10 seconds
or so. This appears to minimise the original problem, but I don't
know if it will have any effect on the performance of the database.
Can you advise?

"Uri Dimant" <ur**@iscar.co.il> wrote in message
news:uA*************@tk2msftngp13.phx.gbl...
Sky
By running this stored procedure SQLAgent is determined if there are any
thresholds changed for
the alerting system. However you can change the interval by editing registry key. ( May be danger)
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL
Server\Server_Name\SQLServerAgent\PerformanceSampl ingInterval
"Sky Fly" <no****@blackhole.com> wrote in message
news:c6************@ID-18325.news.uni-berlin.de...
OK,

I think I've found out what's causing the problem. After examining
a trace I ran on the db, I found out that at the times when the
performance drops, a system stored procedure -

sp_sqlagent_get_perf_counters
- is running.

What I would like to know is: what does this sp do? Why does it run?
Is it safe to stop it or prevent it from running on occasion?
How do I do this?

TIA,

--
Akin

aknak at aksoto dot idps dot co dot uk

"Uri Dimant" <ur**@iscar.co.il> wrote in message
news:u9**************@tk2msftngp13.phx.gbl...
Sky
Have you looked at execution plan of the query? Does the query optimizer available to use indexes which defined on the table?
"Sky Fly" <no****@blackhole.com> wrote in message
news:c6************@ID-18325.news.uni-berlin.de...
> Hello all,
>
> I've written a stored procedure which runs OK for the
> first few thousand records it processes, then around
> about the 10,000th record it suffers a sudden and dramatic
> drop in performance (from about 40 records per second to
> about 1 per second).
>
> I've found that when this happens, if I run an UPDATE STATISTICS
> query on the affected tables, performance picks up again,
> which is good. However, this is a query that will be
> running unattended, so I thought that I good idea would
> be to put the UPDATE STATISTICS statement in the stored
> procedure and have it run after about eight thousand records
> have been processed.
>
> However, I find that even though the statement is run
> after the 8,000th record, the performance drop *still*
> occurs after the 10,000th record. I find this odd because
> the statistics have just recently been updated. Is there
> anything else I should be looking at?
>
> TIA,
>
> --
> Akin
>
> aknak at aksoto dot idps dot co dot uk
>
>



Jul 20 '05 #5

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

Similar topics

17
by: Felix | last post by:
Dear Sql Server experts: First off, I am no sql server expert :) A few months ago I put a database into a production environment. Recently, It was brought to my attention that a particular...
4
by: Sky Fly | last post by:
Hello all, I've written a stored procedure which runs OK for the first few thousand records it processes, then around about the 10,000th record it suffers a sudden and dramatic drop in...
3
by: Metal Dave | last post by:
Hello, A script we run against the database as part of the upgrade of our product is failing with the following message: ALTER TABLE ALTER COLUMN EncodedID failed because STATISTICS hind_61_3...
4
by: Bob Alston | last post by:
I have a subform with multiple records tied to a main record and main form. In the subform I create and update the subform records. However, there are other pieces of data, statistics, I want to...
17
by: romixnews | last post by:
Hi, I'm facing the problem of analyzing a memory allocation dynamic and object creation dynamics of a very big C++ application with a goal of optimizing its performance and eventually also...
5
by: Allan Ebdrup | last post by:
Hi We have a large class library of different classes, now we are going to implement a lot of usage statistics that we need, stuff like how many times a user has logged in, how many times a...
2
by: cccompton via DBMonster.com | last post by:
Greetings all. We recently upgraded from DB2 v8.2 to 9.1 FP1 and tested the AUTO_REORG functionality. As recommended by SAP, we scheduled the job REORGCHK_ALL weekly. This spews out an error...
2
by: Ralf | last post by:
Hi, is it possible to programmatically update table statistics by executing SQL-statements via Jdbc-driver? My DB-application fills an initially empty table with a huge number of rows and I try...
0
ADezii
by: ADezii | last post by:
In last week's Tip, I showed you how to use the ISAMStats Method of the DBEngine (DAO) to return vital statistics concerning Query executions such as: Disk Reads and Writes, Cache Reads and Writes,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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...

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.