473,396 Members | 1,894 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,396 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 2335
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...
5
by: Jesper Jensen | last post by:
Hello group. I have an issue, which has bothered me for a while now: I'm wondering why the column statistics, which SQL Server wants me to create, if I turn off auto-created statistics, are so...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...

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.