Showing posts with label performance. Show all posts
Showing posts with label performance. Show all posts

Tuesday, March 27, 2012

Database Snapshots Performance

Hi,
I'm developing a Data Mart and i'm experiencing a performance gap between my fact table and its snapshot.
I create snapshot with the istruction:

CREATE DATABASE DB_SNAP ON

( NAME = DB_SNAP_Data, FILENAME =

'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\DB_SNAP_Data.ss' )

AS SNAPSHOT OF DB;

And it works. But executing queries on the snapshot result very "low".
Can anyone tell me why?

Tanks.

F.

There is a section in Books Online titled "How Database Snapshots Work" which shows the extra level of redirection for snapshots. For a newly created snapshot, the data will not be in cache so it might take a little while to pull the data into the buffer pool. Once it is "warmed up" though, the performance should not be that different.

You can look at the sys.dm_db_index_operational_stats and sys.dm_io_virtual_file_stats DMVs to try to determine where the issues are.

|||Yes, but I always have a "newly created snapshot". Infact, to update the snapshot, i need to drop and re-create. And i do this every day at least.|||

So, do the performance problems persist, or are they temporary until the cache is populated?

This will help narrow down where the problem may be.

Database Snapshots Performance

Hi,
I'm developing a Data Mart and i'm experiencing a performance gap between my fact table and its snapshot.
I create snapshot with the istruction:

CREATE DATABASE DB_SNAP ON

( NAME = DB_SNAP_Data, FILENAME =

'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\DB_SNAP_Data.ss' )

AS SNAPSHOT OF DB;

And it works. But executing queries on the snapshot result very "low".
Can anyone tell me why?

Tanks.

F.

There is a section in Books Online titled "How Database Snapshots Work" which shows the extra level of redirection for snapshots. For a newly created snapshot, the data will not be in cache so it might take a little while to pull the data into the buffer pool. Once it is "warmed up" though, the performance should not be that different.

You can look at the sys.dm_db_index_operational_stats and sys.dm_io_virtual_file_stats DMVs to try to determine where the issues are.

|||Yes, but I always have a "newly created snapshot". Infact, to update the snapshot, i need to drop and re-create. And i do this every day at least.|||

So, do the performance problems persist, or are they temporary until the cache is populated?

This will help narrow down where the problem may be.

Database Snapshots

Hi,
I'm developing a Data Mart and i'm experiencing a performance gap between my fact table and its snapshot.
I create snapshot with the istruction:

CREATE DATABASE DB_SNAP ON

( NAME = DB_SNAP_Data, FILENAME =

'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\DB_SNAP_Data.ss' )

AS SNAPSHOT OF DB;

And it works. But executing queries on the snapshot result very "low".
Can anyone tell me why?

Tanks.

F.Can you please explain the term about 'low', is it the data size or data?|||

Satya SKJ wrote:

Can you please explain the term about 'low', is it the data size or data?

It was "Slow" and not "low". Sorry.
I mean the time to execute a query.|||

It is by design@.

Performance is reduced, due to increased I/O on the source database resulting from a copy-on-write operation to the snapshot every time a page is updated.

|||

Satya SKJ wrote:

It is by design@.

Performance is reduced, due to increased I/O on the source database resulting from a copy-on-write operation to the snapshot every time a page is updated.

Ok. I read that note.
But what does it mean "Performance is reduced"?
Query on the normal table executed in about 40 seconds; on the snapshot it's over 8 minutes...

Database Snapshot Performance

Hi,
I'm developing a Data Mart and i'm experiencing a performance gap
between my fact table and its snapshot.
I create snapshot with the istruction:
CREATE DATABASE DB_SNAP ON ( NAME = DB_SNAP_Data, FILENAME = 'C:
\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data
\DB_SNAP_Data.ss' ) AS SNAPSHOT OF DB;
And it works. But executing queries on the snapshot result very
"Slow".
Can anyone tell me why?
Tanks.
F.
A snapshot is slow because it makes a copy of of modified data in tempdb.
Thus reads are scattered all over. The real question is why would you NEED
a snapshot of a fact table? This is non-standard DW practice AFAIK.
TheSQLGuru
President
Indicium Resources, Inc.
"Johnny" <xxx.johnny@.gmail.com> wrote in message
news:1171290125.043815.129030@.v33g2000cwv.googlegr oups.com...
> Hi,
> I'm developing a Data Mart and i'm experiencing a performance gap
> between my fact table and its snapshot.
> I create snapshot with the istruction:
> CREATE DATABASE DB_SNAP ON ( NAME = DB_SNAP_Data, FILENAME = 'C:
> \Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data
> \DB_SNAP_Data.ss' ) AS SNAPSHOT OF DB;
> And it works. But executing queries on the snapshot result very
> "Slow".
> Can anyone tell me why?
> Tanks.
> F.
>

Database Snapshot Performance

Hi,
I'm developing a Data Mart and i'm experiencing a performance gap
between my fact table and its snapshot.
I create snapshot with the istruction:
CREATE DATABASE DB_SNAP ON ( NAME = DB_SNAP_Data, FILENAME = 'C:
\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data
\DB_SNAP_Data.ss' ) AS SNAPSHOT OF DB;
And it works. But executing queries on the snapshot result very
"Slow".
Can anyone tell me why?
Tanks.
F.A snapshot is slow because it makes a copy of of modified data in tempdb.
Thus reads are scattered all over. The real question is why would you NEED
a snapshot of a fact table? This is non-standard DW practice AFAIK.
TheSQLGuru
President
Indicium Resources, Inc.
"Johnny" <xxx.johnny@.gmail.com> wrote in message
news:1171290125.043815.129030@.v33g2000cwv.googlegroups.com...
> Hi,
> I'm developing a Data Mart and i'm experiencing a performance gap
> between my fact table and its snapshot.
> I create snapshot with the istruction:
> CREATE DATABASE DB_SNAP ON ( NAME = DB_SNAP_Data, FILENAME = 'C:
> \Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data
> \DB_SNAP_Data.ss' ) AS SNAPSHOT OF DB;
> And it works. But executing queries on the snapshot result very
> "Slow".
> Can anyone tell me why?
> Tanks.
> F.
>

Friday, February 24, 2012

database recommendations....

I have been asked to look at a database and provide
ecommendations regarding architecture, performance, backup
and recovery, and support. The database owners need dba
support for their product. Can anyone please tell me what
type of questions to ask them? Thank you
Josea
First you should ask yourself "Am I the right person for this job?"
You did not put anything in your question to indicate that you have any
experience with SQL Server or that you have any idea where to start your
investigation. If you do not know what questions to ask or how to interpret
the answers to those questions you might not help the company and you could
cause them harm by giving them the "green light" on a database and/or
product that is not ready to ship.
Keith
"Josea Ating" <anonymous@.discussions.microsoft.com> wrote in message
news:3ae501c4ab16$b593d090$a301280a@.phx.gbl...
> I have been asked to look at a database and provide
> ecommendations regarding architecture, performance, backup
> and recovery, and support. The database owners need dba
> support for their product. Can anyone please tell me what
> type of questions to ask them? Thank you
> Josea
|||I'll second what Keith has said and just add that an online forum really
isn't the place to get advice on such a big set of questions.
Maybe you could suggest that they hire a database specialist on a short-term
contract to make some recommendations.
David Portas
SQL Server MVP

database recommendations....

I have been asked to look at a database and provide
ecommendations regarding architecture, performance, backup
and recovery, and support. The database owners need dba
support for their product. Can anyone please tell me what
type of questions to ask them? Thank you
JoseaFirst you should ask yourself "Am I the right person for this job?"
You did not put anything in your question to indicate that you have any
experience with SQL Server or that you have any idea where to start your
investigation. If you do not know what questions to ask or how to interpret
the answers to those questions you might not help the company and you could
cause them harm by giving them the "green light" on a database and/or
product that is not ready to ship.
--
Keith
"Josea Ating" <anonymous@.discussions.microsoft.com> wrote in message
news:3ae501c4ab16$b593d090$a301280a@.phx.gbl...
> I have been asked to look at a database and provide
> ecommendations regarding architecture, performance, backup
> and recovery, and support. The database owners need dba
> support for their product. Can anyone please tell me what
> type of questions to ask them? Thank you
> Josea|||I'll second what Keith has said and just add that an online forum really
isn't the place to get advice on such a big set of questions.
Maybe you could suggest that they hire a database specialist on a short-term
contract to make some recommendations.
--
David Portas
SQL Server MVP
--

Sunday, February 19, 2012

Database query performance

I have a database table. The table has number of fields. Out of those fields one is Company and
another is DateTime. The table has thousands of records. I want to get the most recent
record for each company. In order to do that I am using the following query

SELECT * from CompanyDetail AS X
WHERE [DateTime]=(SELECT max([DateTime]) FROM CompanyDetail WHERE Company=X.Company)
ORDER BY Company


Note: There is only one record exists for the given company on a given date

The problem is that this query is very slow. Am I doing something wrong or there could be another
alternative way to improve it ?

Thanks in advance
KDV


Your best bet is to ask this question in the Transact-SQL forum:
http://forums.microsoft.com/msdn/ShowForum.aspx?ForumID=85

David Sceppa
Microsoft

Friday, February 17, 2012

Database performance very slow

Hello all,
I have setup a new Database Server (P4, 1G RAM, RAID 1), but i feel the
performance is no good at all..
how can I tune the performance better and make all connections faster'
Basically, i have 1G Ram, and it only have 130MB RAM available from
"Performance Monitor" as it should have 7XXMB memory when system started.
I am afraid that the database will more slow after replication of 10
databases are running...
Now, the replication is setup already, but no database will distribute.
Thanks in advanced.Hi
1GB memory is really small nowadays
"beachboy" <stanley@.javacatz.com> wrote in message
news:OYk%23gDRPGHA.3460@.TK2MSFTNGP15.phx.gbl...
> Hello all,
> I have setup a new Database Server (P4, 1G RAM, RAID 1), but i feel the
> performance is no good at all..
> how can I tune the performance better and make all connections faster'
> Basically, i have 1G Ram, and it only have 130MB RAM available from
> "Performance Monitor" as it should have 7XXMB memory when system started.
> I am afraid that the database will more slow after replication of 10
> databases are running...
> Now, the replication is setup already, but no database will distribute.
> Thanks in advanced.
>

Database performance very slow

Hello all,
I have setup a new Database Server (P4, 1G RAM, RAID 1), but i feel the
performance is no good at all..
how can I tune the performance better and make all connections faster?
Basically, i have 1G Ram, and it only have 130MB RAM available from
"Performance Monitor" as it should have 7XXMB memory when system started.
I am afraid that the database will more slow after replication of 10
databases are running...
Now, the replication is setup already, but no database will distribute.
Thanks in advanced.
Hi
1GB memory is really small nowadays
"beachboy" <stanley@.javacatz.com> wrote in message
news:OYk%23gDRPGHA.3460@.TK2MSFTNGP15.phx.gbl...
> Hello all,
> I have setup a new Database Server (P4, 1G RAM, RAID 1), but i feel the
> performance is no good at all..
> how can I tune the performance better and make all connections faster?
> Basically, i have 1G Ram, and it only have 130MB RAM available from
> "Performance Monitor" as it should have 7XXMB memory when system started.
> I am afraid that the database will more slow after replication of 10
> databases are running...
> Now, the replication is setup already, but no database will distribute.
> Thanks in advanced.
>

Database performance very slow

Hello all,
I have setup a new Database Server (P4, 1G RAM, RAID 1), but i feel the
performance is no good at all..
how can I tune the performance better and make all connections faster'
Basically, i have 1G Ram, and it only have 130MB RAM available from
"Performance Monitor" as it should have 7XXMB memory when system started.
I am afraid that the database will more slow after replication of 10
databases are running...
Now, the replication is setup already, but no database will distribute.
Thanks in advanced.Hi
1GB memory is really small nowadays
"beachboy" <stanley@.javacatz.com> wrote in message
news:OYk%23gDRPGHA.3460@.TK2MSFTNGP15.phx.gbl...
> Hello all,
> I have setup a new Database Server (P4, 1G RAM, RAID 1), but i feel the
> performance is no good at all..
> how can I tune the performance better and make all connections faster'
> Basically, i have 1G Ram, and it only have 130MB RAM available from
> "Performance Monitor" as it should have 7XXMB memory when system started.
> I am afraid that the database will more slow after replication of 10
> databases are running...
> Now, the replication is setup already, but no database will distribute.
> Thanks in advanced.
>

database performance very bad, any advice?

check cpu, harddisk queue, read & write, memory usage, all very normal.

but one purticular database is very slow( all others are normal). it took 10 seconds to insert one record into the slow database. each record is less than 300 byte, all varchar. now there are 1 million records in the core table.

use DBCC showcontig to check the slow db, found out this:

Extent Scan Fragmentation -- 99.47%

will a "DBCC indexdefrag" help in this case?

Thanks for any help!Possible causes for poor performance:

* Statistics out of date. Use auto update statistics option or UPDATE STATISTICS

* Slow insert, could be due to the indexes needing an update with say a 90% fill factor. Don't use clustered index for data that is always changing.

* Have you got too many indexes?

* Try using data striping using file groups. Eg if you have 2 heavily used tables in a database, performance would be better if they were on separate disks / RAID arrays

* Is your transaction log being truncated (normally happens when tranaction log is backed up). Use DBCC sqlperf(logspace) .

* Is your transaction log file expanding every time you add more data?

* Is your database file expanding every time you add more data?

* Have you tried a DBCC checkdb ?

* Use NT Performance monitor to look at Disk, CPU and Memory activity counters.

database performance management

Hi
I am using SQL server database with asp as front end. I use asp command object to call sql stored procedure. The procedure runs a while loop for say 100,000 records and based on the IF condition calls particular stored procs which process the record.
I am running this app on a p4 IBM pc with win 2000 sever and IIS on same m/c . The cpu utilisation goes upto 98-99% and the process has started running very slow of late. Is this slow processing speed a hardware/OS problem or is it due to calls for stored proc within stored proc? how can i optimise the process. Each stored proc called does have if conditions,table scans etc.

please adviseYou might post your SP for more help, might try recompiling it as well.|||I have attatched the main stored proc(fetchobktotmp_SP_March08.txt) and the proc which is called most often(sot_Sp_March08.txt.. please have a look
regds|||Both SQL & ISS on same machine will have resource crunch and performance would be affected, try to seperate them or add more physical memory to the box. And also assign more memory to SQL itself.

As suggested recompile the SP, update stats the involved tables etc etc.|||Having SQL Server as well as IIS on the same machine leads to a perrformance crunch but inorder to really identify what is the issue you would need to check, RAM & Processor speed. They play a big part.

It is important to identify if this is processor issue or RAM issue, and you would need to check through performance monitor what are the CPU cycle consumption patterns of the IIS and SQL Server.

At the SQL Server level itself, you can check using the trace files if there are any other issues. But i guess, these kind of performance testing has to be done over a period of time and then analyse the results.|||Contribution- http://www.sql-server-performance.com/q&a45.asp|||Hi
currently the machine has 512MB RAM.. we hve observed that as no of records in the table increases (say 600000 or so) thge performance degrades.. for starters we hve decided to hve a serer grade machine for SQL server and iis both.. may be we wud even seperate them ..|||I feel the server is stressed out due to both at one place and SQL is not able to exeucte queries due to less available resources, such as memory which will have major affect for any performance.

DataBase Performance Issues

Hello,

A couple of things -
Does too many stored procedures in your database affect the performance and speed of the calls?
I have many stored procedures and it seems like the more I create the slower it is to create them. Each time I use enterprise manager it also seems slower and slower to open tables, create tables and create stored procedures for code.

How can I increase the performance of my database by starting and stopping the server at a specified time. and how often should I do this restart?

Thanks in advance for input,
EIt may depend on your DBMS. In general, I wouldn't think more stored procedures would slow down the database. In my experience running Enterprise Manager is always slow when connecting to a remote machine. It is sometimes fast and sometimes slow when connecting to my localmachine's SQL server. Using Query Analyzer is ALWAYS fast (remote or local).

You may want to post this question to the forum at SQLMag.com|||No. Number of stored procedures donot slow performance by any means.

The GUI of using Enterprise manager can be a little heavy ... Is the performance same when using isqlw (Query Analyzer) ... I suppose that would be pretty fast ...

::how often should I do this restart?::

I am not sure why you would like to do this ... I've a SQL Server running for quite a while now without a restart ... So whay are you keen on doing this ...

Database performance improvement

People:

I work with IBM DB2 and there is a tool called REORGCHK and REORG.

It is used to eveluate the status of tables and indexes(REORGCHK) and in case we run the REORG to fix any fragmentation problem in tables and indexes...

The question is Is there something similar in SQL Server?

I have deleted lots of records and looks like after that the performance of the database is not very good.

Thankswhat version of SQLserver?

Sounds like a rebuild of the index may be needed, it can't hurt to rebuild
after a large delete.

At a low level you could run
DBCC INDEXDEFRAG

Via Enterprise (SQLserver 2000) you can create a maintenance plan to cleanup space and indexes. Just run the wizard to create the optimisation job and run it straight away.

Have Fun|||I have SQL 2000 Server.
Can I run the dbcc command during the day??|||Hi,

If you using SQLserver 2000, the easiest solution is to create a maintenance plan to do this periodically eg once per week.

In Enterprise Manager choose the database -> management
right click on database maintenance plans -> choose new plan

Follow the wizard to create an optimisation maintenance plan.

I tend to create a plan for optimisation and integrity checking and a separate one for back of database / logs.

If your database is really under the weather running the DBCC (or a maintenance doing the same thing) would the highest priority. So running during the day is justified.

Have Fun

Database Performance Halts

Hi,

I have been running a reporting App on an SQL 2000 server, which reads from one large table (roughly 80 million records which grows at around 2 million records a week).

However, it would seem that when multi-users try to access the App and the one large table is Read from using 1 database user name up to approximately 25 times, the system would slow to a halt. Essentially, each request on the App would be a new connection to the SQL database using the same database user name. Recently, we have been running into performance issues since we have increased the number of users for the App.

What would be causing this slow down? and what could solve this problem?

>>What would be causing this slow down? and what could solve this problem?

Do you have indexes on the table? are the queries sargable? are your statistics up to date?

>>and the one large table is Read

What does this mean how is the table read? Are you just doing a select * from table?

Denis the SQL Menace

http://sqlservercode.blogspot.com/

|||

>>Do you have indexes on the table? are the queries sargable? are your statistics up to date?

I have indexes on the table and seems to work perfectly fine when there is only 1 query running. All the queries I am running are based on atleast 1 index on that table. Also which statistics are you referring to?

>>What does this mean how is the table read? Are you just doing a select * from table?

From what I can tell, it should only be a series of select statements or nested select statements that the report App runs and stores on the report App side. The reporting App is making from 10-30 of these requests on that 1 indexed table at a single moment in time.

Database performance degrading (again)

We have an application with a SQL Server 2000 back end that is fairly
database intensive -- lots of fairly frequent queries, inserts, updates
-- the gamut. The application does not make use of performance hogs
like cursors, but I know there are lots of ways the application could
be made more efficient database-wise. The server code is running VB6
of all things, using COM+ database interfaces. There are some
clustered and non-clustered indexes defined, but I'm pretty sure
there's room for improvement there as well.

Some tables have grown into the millions of records in recent months,
and performance of the application slowed to a crawl. Optimizing the
database helped a little, but not much. We know that several million
records in a table is a lot, but one would think that SQL Server should
be able to still handle that pretty well. We do have plans to archive
a lot of old data, but in the meantime, we were hurting for a quick
fix.

So we threw hardware at the problem, and transferred the database to a
new, more powerful server. The performance improvement was dramatic.
Transactions were many many times faster than before. Without
implementing any of the other more difficult performance improvements
we have planned, we suddenly became minor heros. :-)

Well, the honeymoon seems to be somewhat over. While performance is
still much better than when the database resided on our old server,
performance appears to have degraded rather significantly again.
Performance is also not significantly better with fewer users on our
system. What the heck?

Yes, the database continues to grow unchecked as we haven't quite got
an archive utility in place yet, but the growth is relatively gradual,
so you wouldn't think that would be the issue. The database is
optimized on a weekly basis, and our web and database servers are both
rebooted monthly. Our database administrators don't seem to have
answers, so I appeal to the experts reading this forum to maybe offer
some clues.

Prior to posting I did do a fair amount of research to see what people
have suggested in similar situations, and ran this by our database
admin. Here's what I can tell you from this research:

- Statistics are updated weekly along with whatever else the database
optimization does

- We do not use the "autoshrink" option for automatically shrinking log
files

- Regarding preallocating space and setting growth factors for log and
data files to minimize time spent allocating disk space, our admin
says, "We do allow database files to grow unchecked, but we do monitor
growth and manually expand as needed. Autogrow is typically set in
50MB increments or less as the amount of time it takes to expand this
amount is negligible."

- Transaction logging is turned on, and data and log devices are on
separate physical disks

- The database server is monitored to ensure no process is hogging all
of the CPU, I/O or memory> We know that several million records in a table is a lot
Not really. It all depends on your hardware and how your application
has been written. I've used tables that are in the tens of millions of
records (even close to 100 million) without encountering performance
problems.

Have you run Profiler to see where the slowness is originating? A good
idea would be to run profiler, logging to a table, for a day. Use that
data to find the longest running SQL statements as well as the most
commonly used SQL statements. Concentrate your efforts on improving
those queries that appear in both categories - i.e. SQL statements that
take a long time to run and which are frequently used. If you check out
Microsoft's website I'm sure that you can find a whitepaper on using
Profiler to optimize a database application.

Another thing to look at is how the front end application is accessing
the server. Is it making a lot of unnecessary round trips to the SQL
Server? Network latency can also play into this a lot. If your frontend
application is scrolling through records in your table one at a time,
retrieving each one individually, it doesn't matter how fast your
database is, the application will be slow.

This is one problem with throwing hardware at a database issue. The
problem that is causing the slowness will almost always come up again
until you fix the part of the database/application that is causing the
issue in the first place.

Hopefully these ideas will yield some improvements for you.

Good luck,
-Tom.|||(teedilo@.hotmail.com) writes:
> Some tables have grown into the millions of records in recent months,
> and performance of the application slowed to a crawl. Optimizing the
> database helped a little, but not much. We know that several million
> records in a table is a lot, but one would think that SQL Server should
> be able to still handle that pretty well.

Well, let me put it this way: a couple of million row tables is
enough to make SQL Server slower than a snail if you have poor indexing
or malformed queries. But as Thomas said: you can have over 100 million
rows, and excellent performance. All depends on the matching between
queries and indexes.

> So we threw hardware at the problem, and transferred the database to a
> new, more powerful server. The performance improvement was dramatic.
> Transactions were many many times faster than before.

Since SQL Server uses a cost-based optimizer, the same query with the
same indexes can give different qurey plans, with a little difference
in statistics. If there was such a drastic changes, it seems that the
tables were turned in favour of better plans.

> Well, the honeymoon seems to be somewhat over. While performance is
> still much better than when the database resided on our old server,
> performance appears to have degraded rather significantly again.
> Performance is also not significantly better with fewer users on our
> system. What the heck?

And you ask us who don't even see the system!

As Thomas said, use the Profiler to track down slow-running queries,
and address them one by one; either by rewriting or modifying indexes.
Or take a shortcut: save a day's workload, and feed it to the Index
Tunig Wizard.

> - Statistics are updated weekly along with whatever else the database
> optimization does

Nevertheless, if can be good idea to do DBCC SHOWCONTIG on some
big table, to check for fragmentation.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Thanks for your replies, Tom and Erland.

Yes, I know that several million records in a table is not necessarily
a lot, especially if the application, database, indexes, etc. are all
well designed. I'll concede that that's probably not the case here!

And yes, I'm sure that network latency contributes to our problems, as
there are a fair amount of round trips going on that probably wouldn't
be necessary if the application were better designed. The consistency
of the bad performance seems to suggest that the degradation in
performance has more to do with the database, however.

I like the Profiler suggestion, which we've been talking about doing
anyway. It's too bad that we didn't do that right after moving to this
new server so we could maybe pinpoint what has changed to make it run
slower.

I also like the suggestion of running DBCC SHOWCONTIG on the bigger
tables to see if there's significant fragmentation even though we've
been optimizing every week.

I also appreciate Erland's comment that it's difficult for someone on
the outside to know what's really going on. I just figured that there
*might* be fairly common/general things to look for/do in the situation
where 1) performance was awful on an old server, 2) performance was
vastly improved when the database was moved to a new server, and 3)
performance quickly degraded again on the new server.

Yes, I know that throwing hardware at the problem is not a silver
bullet. Our old server needed replacing anyway, so we figured it was
worth doing, at least as a stopgap measure to improve performance,
while we were still working on the more difficult fixes. And while I
am not surprised that some slowness would arise again as Tom suggests,
I am rather surprised that the degradation was as significant as it was
in a relatively few short months since the new server was put into
place. In fact, my theory is that reformatting the new server and
starting completely from scratch would suddenly give us improved
performance again -- just a hunch.

One thing that confuses me a little in relation to Erland's comments
about SQL Server's cost-based optimizer. I've read a little about
this, how SQL Server continually tries to find better execution plans,
etc. But wouldn't that lead to *improved* performance instead of worse
performance? Or is it possible that SQL Server will occasionally make
the "wrong choice" in terms of finding execution plans that offer
better performance?

Thanks much again for your suggestions. They're probably about as good
as I can expect given the lack of specific information that I can offer
on this problem.|||> One thing that confuses me a little in relation to Erland's comments
> about SQL Server's cost-based optimizer. I've read a little about
> this, how SQL Server continually tries to find better execution plans,
> etc. But wouldn't that lead to *improved* performance instead of worse
> performance?

Indexes are the key to an efficient execution plan. Statistics on
non-indexed columns can help too (but to a lesser extent) and SQL Server can
generate column statistics automatically. However, indexes are entirely up
to you because you need to balance the cost of maintaining indexes with data
retrieval performance benefits. This is where Profiler and execution plan
analysis can help you out.

When you start with a well-designed database and application, the SQL Server
cost-based optimizer usually does a pretty good job of adapting to changes
in data volume and cardinality. When you don't have appropriate indexes,
the optimizer can't do much to help you out and performance degrades with
data volume. This appears to be the case in your environment based on your
description of the problem.

> Or is it possible that SQL Server will occasionally make
> the "wrong choice" in terms of finding execution plans that offer
> better performance?

Yes, it possible that the optimizer makes the wrong choice. When you find
an execution plan that isn't using indexes effectively, first ensure stats
are up-to-date and expressions are sargable. You can specify hints to
override the cost-based optimizer choices but this should be done as a only
as a last resort.

--
Hope this helps.

Dan Guzman
SQL Server MVP

<teedilo@.hotmail.com> wrote in message
news:1109981213.142149.22520@.o13g2000cwo.googlegro ups.com...
> Thanks for your replies, Tom and Erland.
> Yes, I know that several million records in a table is not necessarily
> a lot, especially if the application, database, indexes, etc. are all
> well designed. I'll concede that that's probably not the case here!
> And yes, I'm sure that network latency contributes to our problems, as
> there are a fair amount of round trips going on that probably wouldn't
> be necessary if the application were better designed. The consistency
> of the bad performance seems to suggest that the degradation in
> performance has more to do with the database, however.
> I like the Profiler suggestion, which we've been talking about doing
> anyway. It's too bad that we didn't do that right after moving to this
> new server so we could maybe pinpoint what has changed to make it run
> slower.
> I also like the suggestion of running DBCC SHOWCONTIG on the bigger
> tables to see if there's significant fragmentation even though we've
> been optimizing every week.
> I also appreciate Erland's comment that it's difficult for someone on
> the outside to know what's really going on. I just figured that there
> *might* be fairly common/general things to look for/do in the situation
> where 1) performance was awful on an old server, 2) performance was
> vastly improved when the database was moved to a new server, and 3)
> performance quickly degraded again on the new server.
> Yes, I know that throwing hardware at the problem is not a silver
> bullet. Our old server needed replacing anyway, so we figured it was
> worth doing, at least as a stopgap measure to improve performance,
> while we were still working on the more difficult fixes. And while I
> am not surprised that some slowness would arise again as Tom suggests,
> I am rather surprised that the degradation was as significant as it was
> in a relatively few short months since the new server was put into
> place. In fact, my theory is that reformatting the new server and
> starting completely from scratch would suddenly give us improved
> performance again -- just a hunch.
> One thing that confuses me a little in relation to Erland's comments
> about SQL Server's cost-based optimizer. I've read a little about
> this, how SQL Server continually tries to find better execution plans,
> etc. But wouldn't that lead to *improved* performance instead of worse
> performance? Or is it possible that SQL Server will occasionally make
> the "wrong choice" in terms of finding execution plans that offer
> better performance?
> Thanks much again for your suggestions. They're probably about as good
> as I can expect given the lack of specific information that I can offer
> on this problem.|||(teedilo@.hotmail.com) writes:
> I also appreciate Erland's comment that it's difficult for someone on
> the outside to know what's really going on. I just figured that there
> *might* be fairly common/general things to look for/do in the situation
> where 1) performance was awful on an old server, 2) performance was
> vastly improved when the database was moved to a new server, and 3)
> performance quickly degraded again on the new server.

So how did you migrate the database? If you now say "Copy Database
Wizard" or any other methods that include rebuild of the database,
I'm tempted to place my bets on fragmentation as the main issue. To
wit, if you move the database in this way, you get quite a well-
defragmented database in the other end.

If you migrated the database my means of backup/restore or detach/attach,
your also copied the fragmentation. In this case... I could go into
speculation, but it would not really address the actual problem.

> One thing that confuses me a little in relation to Erland's comments
> about SQL Server's cost-based optimizer. I've read a little about
> this, how SQL Server continually tries to find better execution plans,
> etc. But wouldn't that lead to *improved* performance instead of worse
> performance? Or is it possible that SQL Server will occasionally make
> the "wrong choice" in terms of finding execution plans that offer
> better performance?

To say that SQL Server constantly try to find better query plans, is
not maybe really correct. (That's more applicable to the SQL Server
dev team.) But SQL Server do occasionally review query plans, because
statistics have changed - or because the query plan has fallen out of
cache.

And plans are bulit on estimates from statistics, and they are indeed
a gamble. Sometimes the opimtizer makes very bad picks for one reason
or another. This also applies to different SQL Server versions. MS
does some tweak to the optimizer, which in many cases are beneficiary,
but at some sites can backfire.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Hi

Glancing through the posts it is not clear what maintenace you are doing
other than the weekly updating the statistics, so I will add my two pence
worth!!!

Your DBCC SHOWCONTIG will probably indicate fragmentation if you don't have
maintenace in place that calls DBCC INDEXDEFRAG and/or DBCC DBREINDEX. You
may also want to look at running the index tuning wizard on your profiles to
see if it suggests alternate fill factors. You may want to try alternate
fill factors on a different (controlled) system and replay the profiles
against it to see what fragmentation and speed you can achieve.

John

<teedilo@.hotmail.com> wrote in message
news:1109981213.142149.22520@.o13g2000cwo.googlegro ups.com...
> Thanks for your replies, Tom and Erland.
> Yes, I know that several million records in a table is not necessarily
> a lot, especially if the application, database, indexes, etc. are all
> well designed. I'll concede that that's probably not the case here!
> And yes, I'm sure that network latency contributes to our problems, as
> there are a fair amount of round trips going on that probably wouldn't
> be necessary if the application were better designed. The consistency
> of the bad performance seems to suggest that the degradation in
> performance has more to do with the database, however.
> I like the Profiler suggestion, which we've been talking about doing
> anyway. It's too bad that we didn't do that right after moving to this
> new server so we could maybe pinpoint what has changed to make it run
> slower.
> I also like the suggestion of running DBCC SHOWCONTIG on the bigger
> tables to see if there's significant fragmentation even though we've
> been optimizing every week.
> I also appreciate Erland's comment that it's difficult for someone on
> the outside to know what's really going on. I just figured that there
> *might* be fairly common/general things to look for/do in the situation
> where 1) performance was awful on an old server, 2) performance was
> vastly improved when the database was moved to a new server, and 3)
> performance quickly degraded again on the new server.
> Yes, I know that throwing hardware at the problem is not a silver
> bullet. Our old server needed replacing anyway, so we figured it was
> worth doing, at least as a stopgap measure to improve performance,
> while we were still working on the more difficult fixes. And while I
> am not surprised that some slowness would arise again as Tom suggests,
> I am rather surprised that the degradation was as significant as it was
> in a relatively few short months since the new server was put into
> place. In fact, my theory is that reformatting the new server and
> starting completely from scratch would suddenly give us improved
> performance again -- just a hunch.
> One thing that confuses me a little in relation to Erland's comments
> about SQL Server's cost-based optimizer. I've read a little about
> this, how SQL Server continually tries to find better execution plans,
> etc. But wouldn't that lead to *improved* performance instead of worse
> performance? Or is it possible that SQL Server will occasionally make
> the "wrong choice" in terms of finding execution plans that offer
> better performance?
> Thanks much again for your suggestions. They're probably about as good
> as I can expect given the lack of specific information that I can offer
> on this problem.

database performance

Hi All

In Oracle i can get Performance varables like Library Cache Hits, Dictionary Cache Hits, Database Buffers Read ,Redolog Buffers Read etc from the system dynamic tables.

I want to know how to get the same / related performance details in sql server 2000 and 2005. ( which are the parameters , Optimal value and which table/dynamic view to query).

Thanks in Advance

You can use dynamic management views, new to 2005.

http://msdn2.microsoft.com/en-us/library/ms188754.aspx|||

Hi,

In SQL 2000 (and 2005), you can query master.dbo.sysperfinfo to find most of what your looking for.

Additionally, sp_monitor and some DBCC commands have additional information, see http://www.sql-server-performance.com/dbcc_commands.asp and http://www.sqldev.net/articles/dbcc_sqlperf.htm for more details.

Hope that helps.

Jamie

|||

In addition to the other references already provided, you might find the examples and information in this white paper useful: http://www.microsoft.com/technet/prodtechnol/sql/2005/tsprfprb.mspx

Regards,

Gail

|||

Hi .... Thanks for your reply........

I need a query/queries to find the following in MS sql server.

1) To find most frequently accessed/executed tables/procedures

Please help me

Thanks in advance

|||

You might find that exploring the dynamic system views to be useful.

For example:

SELECT * FROM sys.dm_os_performance_counters

And there are quite a few additional dynamic system views to choose from. In Object Explorer, click on your database, VIEWS, and then System Views.

Often, the quality of the responses received is related to our ability to ‘bounce’ ideas off of each other. In the future, to make it easier for us to offer you assistance, and to prevent folks from wasting time on already answered questions, please don't post to multiple newsgroups. Choose the one that best fits your question and post there. Only post to another newsgroup if you get no answer in a day or two (or if you accidentally posted to the wrong newsgroup –and you indicate that you've already posted elsewhere).

|||

Check the response in your duplicate post in the Transact-SQL forum.

Often, the quality of the responses received is related to our ability to ‘bounce’ ideas off of each other. In the future, to make it easier for us to offer you assistance, and to prevent folks from wasting time on already answered questions, please:

Don't post to multiple newsgroups. Choose the one that best fits your question and post there. Only post to another newsgroup if you get no answer in a day or two (or if you accidentally posted to the wrong newsgroup –and you indicate that you've already posted elsewhere).

|||

Hi Arnie...

I made the post in the other forum by mistake ......

thanks for the reminder

|||

can u send me the reply link for ur question

I need a query/queries to find the following in MS sql server.

1) To find most frequently accessed/executed tables/procedures

database performance

Hi All

In Oracle i can get Performance varables like Library Cache Hits, Dictionary Cache Hits, Database Buffers Read ,Redolog Buffers Read etc from the system dynamic tables.

I want to know how to get the same / related performance details in sql server 2000 and 2005. ( which are the parameters , Optimal value and which table/dynamic view to query).

Thanks in Advance

You can use dynamic management views, new to 2005.

http://msdn2.microsoft.com/en-us/library/ms188754.aspx|||

Hi,

In SQL 2000 (and 2005), you can query master.dbo.sysperfinfo to find most of what your looking for.

Additionally, sp_monitor and some DBCC commands have additional information, see http://www.sql-server-performance.com/dbcc_commands.asp and http://www.sqldev.net/articles/dbcc_sqlperf.htm for more details.

Hope that helps.

Jamie

|||

In addition to the other references already provided, you might find the examples and information in this white paper useful: http://www.microsoft.com/technet/prodtechnol/sql/2005/tsprfprb.mspx

Regards,

Gail

|||

Hi .... Thanks for your reply........

I need a query/queries to find the following in MS sql server.

1) To find most frequently accessed/executed tables/procedures

Please help me

Thanks in advance

|||

You might find that exploring the dynamic system views to be useful.

For example:

SELECT * FROM sys.dm_os_performance_counters

And there are quite a few additional dynamic system views to choose from. In Object Explorer, click on your database, VIEWS, and then System Views.

Often, the quality of the responses received is related to our ability to ‘bounce’ ideas off of each other. In the future, to make it easier for us to offer you assistance, and to prevent folks from wasting time on already answered questions, please don't post to multiple newsgroups. Choose the one that best fits your question and post there. Only post to another newsgroup if you get no answer in a day or two (or if you accidentally posted to the wrong newsgroup –and you indicate that you've already posted elsewhere).

|||

Check the response in your duplicate post in the Transact-SQL forum.

Often, the quality of the responses received is related to our ability to ‘bounce’ ideas off of each other. In the future, to make it easier for us to offer you assistance, and to prevent folks from wasting time on already answered questions, please:

Don't post to multiple newsgroups. Choose the one that best fits your question and post there. Only post to another newsgroup if you get no answer in a day or two (or if you accidentally posted to the wrong newsgroup –and you indicate that you've already posted elsewhere).

|||

Hi Arnie...

I made the post in the other forum by mistake ......

thanks for the reminder

|||

can u send me the reply link for ur question

I need a query/queries to find the following in MS sql server.

1) To find most frequently accessed/executed tables/procedures

Database Performance

Hello there,
I am experiencing performance problems with an aplication running over a SQL
Server 2000 Database. The server that holds SQL Server has 2.8 GB of RAM
memory. When there are just on or two users working, the aplication
performance is suportable, but when more users are using the aplication,
there picks when its almost impossible work normaly.
My question is: what can possible cause this loss of performance?
All workstations have an ODBC connection with 'sa' user. Can it be
important?
What can I do to troubleshoot this problem?
The are serveral important tables with many fields and many records. I think
that I have created indexes correctly.
Can anybody help me? Thanks.
Regards,
Marco Pais
Usually the causes are bad design, poorly written queries, and
poor/inadequate indexing. BOL has a lot of trouble-shooting information
under the topic "Troubleshooting". You probably want to look at blocking
first.
"Marco Pais" <mpaisIGNORE@.foruminformatica.pt> wrote in message
news:ebcvgSTBFHA.3644@.TK2MSFTNGP15.phx.gbl...
> Hello there,
> I am experiencing performance problems with an aplication running over a
SQL
> Server 2000 Database. The server that holds SQL Server has 2.8 GB of RAM
> memory. When there are just on or two users working, the aplication
> performance is suportable, but when more users are using the aplication,
> there picks when its almost impossible work normaly.
> My question is: what can possible cause this loss of performance?
> All workstations have an ODBC connection with 'sa' user. Can it be
> important?
> What can I do to troubleshoot this problem?
> The are serveral important tables with many fields and many records. I
think
> that I have created indexes correctly.
> Can anybody help me? Thanks.
> Regards,
> Marco Pais
>
|||There are lots of things it can be and you need to narrow down the
possibilities. Blocking does indeed sound like a good possibility. Try
running sp_who2 when you have multiple users in the slow state and see if
any show up with a spid in the Blcked by column. These articles should help
to get you going in the right direction.
http://www.microsoft.com/sql/techinf...perftuning.asp
Performance WP's
http://www.swynk.com/friends/vandenberg/perfmonitor.asp Perfmon counters
http://www.sql-server-performance.co...ance_audit.asp
Hardware Performance CheckList
http://www.sql-server-performance.co...mance_tips.asp
SQL 2000 Performance tuning tips
http://www.support.microsoft.com/?id=q224587 Troubleshooting App
Performance
http://msdn.microsoft.com/library/de...rfmon_24u1.asp
Disk Monitoring
Andrew J. Kelly SQL MVP
"Marco Pais" <mpaisIGNORE@.foruminformatica.pt> wrote in message
news:ebcvgSTBFHA.3644@.TK2MSFTNGP15.phx.gbl...
> Hello there,
> I am experiencing performance problems with an aplication running over a
> SQL Server 2000 Database. The server that holds SQL Server has 2.8 GB of
> RAM memory. When there are just on or two users working, the aplication
> performance is suportable, but when more users are using the aplication,
> there picks when its almost impossible work normaly.
> My question is: what can possible cause this loss of performance?
> All workstations have an ODBC connection with 'sa' user. Can it be
> important?
> What can I do to troubleshoot this problem?
> The are serveral important tables with many fields and many records. I
> think that I have created indexes correctly.
> Can anybody help me? Thanks.
> Regards,
> Marco Pais
>