SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Server Performance


Server Performance

Author
Message
csarsonas
csarsonas
Forum Newbie
Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)

Group: General Forum Members
Points: 7 Visits: 17
Good day to all!
I'm new to SQL server environment...
right now, we are using it to our client.
I would like to check if the server is in the optimize settings or utilizing its cpu cores (8 cores) and memory capacity (8 gig).

Scenario is that our web apps (asp.net) is having performance problem.
Single user on a particular module will have an estimation of 4-5 sec data retrieval (stored procedure was used to retrieve data). row count of the table is 600,000+ records (optimized with indexes).

When we add 2 or more users, data retrieval estimated to 25-30 secs.

What should i do to optimize and maximize its performance?


Server specs:
CPU: Quad Core(2 cpu, 8 core)
Memory: 8gig
OS: Windows 2008 (32bit)
SQL Server: 2005 Standard Edition
tom.lemmer
tom.lemmer
Forum Newbie
Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)

Group: General Forum Members
Points: 7 Visits: 39
You still have a number of things to think about.
1. If SQL is set to 32 bit it can only access up to 4GB of memory and has to share the 4GB of memory with the OS and application. To get around this the AWE setting and Lock Pages in Memory will need to be set. http://support.microsoft.com/kb/811891

2. You may also need to set the PAE flag in the boot.ini file.
http://sfdoccentral.symantec.com/vom/4.0/win_unix/html/vom_winadm_addon_users/SFW_VOM40/ch10s07s05s01.htm

3. Do you have any re-indexing maintenance jobs created/running on your system? Check out the article: http://www.sqlservercentral.com/Forums/Topic150354-5-1.aspx

4. Have you evaluated if additional new indexes need to be created? How much do you understand about indexes needs to be determined first. The link to the video below is very informative but assumes you have a basic understanding of performance analysis and indexes to begin with. Before doing anything with this in a production environment - always try first on your test system and always ensure you have made backups!
Index Analysis: http://technet.microsoft.com/en-us/sqlserver/gg545020.aspx

About This Video: Overview of index analysis techniques, validating if your indexes are using the right combination of keys, if your indexes are being used and how, if there are missing indexes and if your indexes are still healthy and most optimal.
GilaMonster
GilaMonster
SSC Guru
SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)

Group: General Forum Members
Points: 86625 Visits: 45251
Performance has less to do with server settings and more to do with properly written code and good indexes

http://www.simple-talk.com/sql/performance/finding-the-causes-of-poor-performance-in-sql-server,-part-1/
http://www.simple-talk.com/sql/performance/finding-the-causes-of-poor-performance-in-sql-server,-part-2/

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


MVDBA
MVDBA
Hall of Fame
Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)

Group: General Forum Members
Points: 3047 Visits: 860


Single user on a particular module will have an estimation of 4-5 sec data retrieval (stored procedure was used to retrieve data). row count of the table is 600,000+ records (optimized with indexes).



i would seriously look at the locking involved - if your query is taking 5 seconds and then another user is queuing up for that data it would explain it.

can you post the procedure?

MVDBA
csarsonas
csarsonas
Forum Newbie
Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)

Group: General Forum Members
Points: 7 Visits: 17
Thank you tom.lemmer, GilaMonster, Michael Vessey for the response...

Correction on the specs i provided last time (just receive the full info from the client)
*Quad-Core Xeon E5420 (2x6 MB cache) 2.50 Ghz
*4X4 GB DDR2 667Mhz Memory
*Windows 2003 Enterprise Edition-32bit R2
*SQL Server 2005 Standard Edition


@tom.lemmer, i've check the system properties of the server and found that 16GB were found. In the boot.ini, PAE is not enable (how will i know if they are using Hot Add Memory or DEP is enable) but the system found it 16GB. Ill take a study on the re-indexing maintenance job (i haven't tried it and i check the server if they have a plan guide but nothing is there).

this is the table structure for the said module

CREATE TABLE [dbo].[DRSummTemp](
[ID] [int] IDENTITY(1,1) NOT NULL,
[DRID] [int] NULL,
[StyleNo] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Quantity] [int] NULL,
[UnitPrice] [money] NULL,
[Amount] [money] NULL,
[Cost] [money] NULL,
CONSTRAINT [PK_DRSummTemp] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY],
CONSTRAINT [IX_DRSummTemp] UNIQUE NONCLUSTERED
(
[DRID] ASC,
[StyleNo] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]


@GilaMonster, ill study that article, thanks

@Michael Vessey, this is the stored procedure for retrieval
ALTER PROCEDURE [dbo].[Get_DRTotalQuantityAndCost_SP]
-- Add the parameters for the stored procedure here
@CustomerNumber bigint,@DateFrom DateTime = Null, @DateTo DateTime = Null

AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
select sum(DRSummTemp.Quantity) As TOTAL_QUANTITY,sum((DRSummTemp.Quantity*DRSummTemp.cost)) as TOTAL_COST
from DRSummTemp where DRSummTemp.drid in
(select ID from DRTemp where DRDATE between @DateFrom and @DateTo and CUSTNO = @CustomerNumber);

END
GilaMonster
GilaMonster
SSC Guru
SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)

Group: General Forum Members
Points: 86625 Visits: 45251
Post the definition of DRTemp please.

Avoid plan guides unless you really, really know what you're doing and why you're using them

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


csarsonas
csarsonas
Forum Newbie
Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)

Group: General Forum Members
Points: 7 Visits: 17
@GilaMonster

CREATE TABLE [dbo].[DRTemp](
[ID] [bigint] IDENTITY(1,1) NOT NULL,
[DRNo] [nvarchar](15) NOT NULL,
[DRDate] [datetime] NOT NULL,
[CustNo] [int] NOT NULL,
[TotalAmt] [money] NULL,
[TotalQty] [int] NULL,
CONSTRAINT [PK_DRTemp] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_DRTemp] ON [dbo].[DRTemp]
(
[ID] ASC,
[DRNo] ASC,
[CustNo] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
MVDBA
MVDBA
Hall of Fame
Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)

Group: General Forum Members
Points: 3047 Visits: 860
no indexes on drsumtemp then ? - you said 600k rows.... i'm guessing the correct indexes will make a difference

MVDBA
MVDBA
MVDBA
Hall of Fame
Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)

Group: General Forum Members
Points: 3047 Visits: 860
also is DRID a foreign key? - it looks like it to me - why is it nullable? is there a foreign key constraint on it? - i'd definatly look at putting an index on that colum and re-check your query plan

MVDBA
GilaMonster
GilaMonster
SSC Guru
SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)

Group: General Forum Members
Points: 86625 Visits: 45251
You have no indexes on DRTemp that support that query.

Add an index (CUSTNO, DRDATE) INCLUDE (ID)

This index is likely useless
CREATE NONCLUSTERED INDEX [IX_DRTemp] ON [dbo].[DRTemp]
(
[ID] ASC,
[DRNo] ASC,
[CustNo] ASC
)

It has the same leading column as the clustered index, with a wider key. Drop it. Any queries that use it can use the clustered index.

I would also suggest that you drop this:
CONSTRAINT [IX_DRSummTemp] UNIQUE NONCLUSTERED
(
[DRID] ASC,
[StyleNo] ASC
)

and replace it with

CREATE UNIQUE NONCLUSTERED INDEX IX_DRSummTemp
ON DRSummTemp
(
[DRID] ASC,
[StyleNo] ASC
)
INCLUDE (Quantity, Cost)

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search