|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, December 17, 2012 6:44 PM
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
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Friday, August 03, 2012 10:01 AM
Points: 5,
Visits: 20
|
|
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.
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Yesterday @ 12:59 PM
Points: 37,640,
Visits: 29,895
|
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Monday, April 29, 2013 10:15 AM
Points: 2,261,
Visits: 758
|
|
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
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, December 17, 2012 6:44 PM
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
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Yesterday @ 12:59 PM
Points: 37,640,
Visits: 29,895
|
|
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 2008, MVP 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
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, December 17, 2012 6:44 PM
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
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Monday, April 29, 2013 10:15 AM
Points: 2,261,
Visits: 758
|
|
no indexes on drsumtemp then ? - you said 600k rows.... i'm guessing the correct indexes will make a difference
MVDBA
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Monday, April 29, 2013 10:15 AM
Points: 2,261,
Visits: 758
|
|
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
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Yesterday @ 12:59 PM
Points: 37,640,
Visits: 29,895
|
|
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 2008, MVP 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
|
|
|
|