|
Grouse219
Starting Member
2 Posts |
Posted - 2007-08-13 : 14:54:56
|
| A query was taking 20 seconds and consuming 70% CPU takes only 1 second after setting Maximum Memory property to 2048 MB - why?Server:OS Microsoft(R) Windows(R) Server 2003, Enterprise EditionVersion 5.2.3790 Service Pack 1 Build 37908 GB memoryTwo Dual-core AMD Opteron 285 2.6GHz ProcessorsServer is not configured for AWEFiber channel connection to EMC Clarion - two LUNs - one for MDF, one for LDFSQL 2005SQL 2005 32 bit Standard Edition - SP1 (version 9.0.2047)Three instances installed on server - only one instance in useBinaries and system databases on local mirrored diskDatabase file (MDF) on one EMC LUN - dedicated physical drivesLog file (LDF) on one EMC LUN - dedicated physical drivesQuery in question:SELECT TOP 10 Address.Address1, Address.Address2, Address.City, Address.County, Address.State, Address.ZIPCode, Address.Country, Client.Name, Quote.Deleted, Client.PrimaryContact, Client.DBA, Client.Type, Quote.Status, Quote.LOB, Client.ClientID, Quote.QuoteID, Quote.PolicyNumber, Quote.EffectiveDate, Quote.ExpirationDate, Quote.Description, Quote.Description2, Quote.DateModified, Quote.DateAccessed, Quote.CurrentPremium, Quote.TransactionDate, Quote.CreationDate, Quote.Producer FROM ((Client INNER JOIN Address ON Client.ClientID = Address.ClientID) INNER JOIN Quote ON Client.ClientID = Quote.ClientID) WHERE (Quote.Deleted = 0) AND ((Address.AddressType)='Mailing') ORDER BY Client.NameAddress table - 161,075 rowsClient table - 161,634 rowsQuote table - 59,145 rowsWith default maximum memory setting (2,147,483,647 MB) - query runs in 20 seconds and consumes over 70 % of the CPU.After changing maximum memory setting to 2048 MB, query runs in less than 1 second.Question is:What is the best practice for setting the minimum and maximum memory settings for SQL 2005?What can be monitored to identify the cause of these type of issues - using profiler, PerfMon, other tool?Thanks |
|