I've been recruited to assist in diagnosing and fixing a performance problem
on an application we have running on SQL Server 7.
The application itself is third party software, so we can't get at the
source code. It's a Client Management system, where consultants all over
the
country track their client meetings, results, action plans, etc. , and has
apparently been problematic for a long time now. I came into this
investigation
in mid-stream, but here's the situation as I understand it:
We have users reporting it's slow, with no discernable pattern with respect
to what part of the application they're using or now particular time of day.
I am told that it doesn't appear to be a bandwith or computer resource
problem. They apparently added two app servers a year or so ago, which
temporarily
improved the performance. We're using a nominal percentage of CPU and
memory.
There are three large tables (approx 8 million rows) that are queried often,
as users click to see their calendar of appointments or review past meetings
with a client, etc. The activity on these tables is over 90% reads
(SELECTS) with about 10% INSERTS/UPDATES. We have attempted to run the Index
Analyzer Wizard twice
but so far it just seems to hang (it could be that the workload file is too
big?) . So, what we're doing now is isolating the SELECT statements that
take a long time to run and manually comparing them to the indexes that
exist on these large tables. Since we can't alter the SQL source code,
we're trying to alter the indexes to improve performance.
What I would like to know is, is there a good way to get benchmark
measurements so we can explicitly measure any performance changes? Also, do
you think
we're going about this the right way, or is there some other avenue we could
be looking at to improve performance?
I recognize that performance questions are tricky to post/answer in a
newsgroup, because usually you need more information than is provided. The
problem is
that this is a high profile investigation (they're hauling us into meetings
every two days to report our progress) and I need to be able to convincingly
state that we have either improved performance by X% , or that it is the
application itself that's the problem and we're stuck with it.
I know it's bad to use the built-in SA account to access SQL Server from my ASP.NET application.
I did some reading but would like some suggestions as well. One article I read talked about Application roles in SQL Server. Is this the best way to handle SQL Server access for read/write/update/delete privileges from an ASP.NET application?
If this is the way to go, how do I set it up? Can anyone suggest a good web site to read up on this?
So I have been tasked with converting a pilot timesheet application (written in Access) into an all singing all dancing web app. I'm planning on using SQL Server to provide some scale but wondered if anyone had any advice about processing time calcs.
I can of course use the smalldatetime datatype to store all the start at, finish at and elapsed hours times but wonderd if there was any comparative advantage to using numerics instead and converting to/from HH:MM representation.
Maybe I need to finally figure out how to create and use custom data types?
There's lots of math to do on these things once the data is captured for reporting and such and smalldattime looks like a fairly big waste of space for something that really only deals in hours.
Anyone doen things like this before? Any advice on what not to do?
I have a VB.Net 2005/SQLCE desktop application that imports XML data into an SQLCE database. The needs of the application require that upon import, certain values in the incoming data are used to look up and store additional values in the import datatable. The completed import data is then stored in a 'production' table that constitutes the application's reason for being - the data is processed, assessments are made on it, and reports are generated.
Anyway, this valid value process is performed three times for different types of data. The way I currently have it running is that the three valid value lookup processes are built into loops through the incoming data.
<Pseudocode>
Read incomingData into datatable
For each row in incomingData for each row in refTable1 if incomingData.field1 = reftable1.Field1 then incomingData.Field2 = refTable1.Field2 incomingData.Field3 = refTable1.Field3 else send user to valid value mapping dialog collect dialog mappings add mapped data to incomingData end if next Next For each row in incomingData for each row in refTable2 if incomingData.field4 = reftable2.Field4 then incomingData.Field5 = refTable2.Field5 incomingData.Field6 = refTable2.Field6 incomingData.Field5 = refTable7.Field5 JOIN ON refTable2("ID") = refTable7("ID") incomingData.Field6 = refTable7.Field6 JOIN ON refTable2("ID") = refTable7("ID") else send user to valid value mapping dialog collect dialog mappings add mapped data to incomingData end if end if next Next For each row in incomingData for each row in refTable3 if incomingData.field7 = reftable3.Field7 then incomingData.Field8 = refTable3.Field8 else send user to valid value mapping dialog collect dialog mappings add mapped data to incomingData end if end if next Next
</Pseudocode>
One of these lookup processes, let's say the one involving refTable2, takes a long time; so long that I have it executing on a separate thread. For example. in a 512 kb incoming XML file, there may be around 700 records. Also, refTable2 contains around 800 possible matches. So, we are checking against 800 possible values, 700 times. That's a minimum of 56,000 operations, not counting the additional lookups to refTable7. For a 1.5 MB XML file, it may take ~40 seconds to do the following:
check each incoming record against refTable3 look up any matching values and store in the import datatable create a list of unmapped incoming values create a list of valid values from refTable2 present the user with the valid value mapping dialog
All that being said, a colleague recently suggested that before executing the CPU-intensive refTable2 lookup, that I first get a distinct list of Field7 from incomingData before performing the lookup (see pseudocode above) for that set of values.
QUESTIONS:
1) Would this really help performance? I don't see how, since I must still iterate through incomingData and add looked-up values to each record before storing it in the production datatable.
2) Is there a better way to achieve desired results rather than the brute-force matching routine described above?
This deadline has been ridiculous as usual, so I've done the first thing that came to mind with this import/lookup routine. However, I figured I'd check to see if I was overlooking anything fundamental that would speed things up a bit.
Hi,I am starting a new job next week. Part of what I am required to do isa "system diagnostic" on a SQL Server 2000 box to determine what areascan use improvement - this would include configuration settings,backup/recovery, sql tuning, etc... and anything else I may not havementioned here!What I need is a thorough and systematic approach to doing this. Cananyone please give me advice, or point to a FAQ or other links thatdiscuss this. I am running out of time.THANKS MUCH
I have an application that uses Acces as a backend and VBA as front end. Application is secured and is supplied on a CD with setup.exe.
Can I use VB 2005 and MS SQL to achieve the same?
Would I be able to package my application with all the neccessery files (assuming that client does not have any e.g. SQL server) so that multiple front ends can access data from common source?
Would I be able to secure such an application using only VS 2005?
What would I need to quickly learn how to achieve the above ( any books you can suggest maybe)?
I am a DBA working for a large business in the North East of England.
One of our main Database servers (SQL Server 2000 SP4) is configured as follows:
Storage - 1. Logical Drive configured as RAID5 with about 800MB of storage, 40% free space. Used for main database files. 8 Physical drives. - 2. Logical Drive configured as RAID1 with about 140MB of storage, 20% free space. Used for sql log files.
Both 1 and 2 are on the same controller (SCSI).
- 3. System Drive (C:)
Storage configuration was done by an external consultancy and disk performance (when benchmarked) was excellent.
Memory - 8GB of memory 6.5GB allocated to SQL Server Operating System: Windows server 2003 Enterprise Edition SQL Server: 2000 SP4
We would appreciate your advice regarding the following problem that we have on busy times:
Typical number of users/connections to SQL Server is between 200 to 250 (sysprocesses) Typical number of active processes can vary between 5 to 30 (all sorts of applications)
The problem we have is that on some busy days a combination of processes grinding the server to a halt. When we check the activity (normally using sp_who2) we can see that there are no blocked processes, cpu and DiskIO progressing as normal (some values maybe large but not beyond expectation).
However, when "the problem" occurs, everything (queries, updates, etc) is extremely slow for 5-20 minutes until the bottleneck is freed.
We would appreciate any advice (tempdb?, disk bottleneck?, etc) and recommendation for any useful tools.
Basically, I have a web-based application that queries aggregates from several big tables that grow rather quickly. I feel I am fairly accomplished at tuning individual queries and have optimized these particular stored procedures as much as I can and often see great results for a period of time. However, after time passes, it seems the stored procedures begins performing really badly. What's frustrating is that I have traced the server, located a stored procedure that consistently executes with an abnormally high duration, but when I run the exact same text directly against the sql server it returns instantly.
If I recompile the stored procedure using my direct connection by including the WITH RECOMPILE clause to the EXEC statement, the problem remains for the web-app. However, if I add the WITH RECOMPILE to the actual stored procedure, it is instantly resolved. I can then remove the WITH RECOMPILE from the stored procedure text and things will remain speedy for a period of time before they again slip back.
I'm curious as to what I can do from a SQL standpoint to correct for this. For now, the app team is setting a counter for each execution and then issuing a WITH RECOMPILE when the counter limit is exceeded.
I apologize if this question has most been asked before and I have attempted a review of the forums but was unable to find any material. Any suggestions, advice, links or general assistance would be most appreciated.
Dear Experts, I'm a DBA, Working for a Product based company. We are implementing our product for a certain client of huge OLTP. our reports team is facing problem (error: all the reports are timed out).though the queries are written properly, Each query is taking some minutes of time. I've given the command DBCC DROPCLEANBUFFERS. the time immediately dropped to 10 sec.
now my question is : please suggest me the DBCC commands or any DBA related commands to improve the performance of the application for my reports team.
I have a 32-bit application which sometimes runs against 64-bit servers. When it does, I can't read the performance counters published by the FTS service because they're 64-bit only. I get event #1022 from PerfLib in the event log:
Windows cannot open the 64-bit extensible counter DLL msftesqlFD in a 32-bit environment. Contact the file vendor to obtain a 32-bit version. Alternatively if you are running a 64-bit native environment, you can open the 64-bit extensible counter DLL by using the 64-bit version of Performance Monitor. To use this tool, open the Windows folder, open the System32 folder, and then start Perfmon.exe.
Does Microsoft make available 32-bit counter libraries for 32-bit clients of the 64-bit FTS? How do I obtain those bits?
We have Oracle-based enterprise resource planning (ERP) application that facilitates order entry, invoicing, dispatch, stock management, and purchasing. However, it took as much as 30 seconds to perform queries from the remote offices, which were linked via Frame Relay.
Any experiences or ideas shared will be greatly appreciated.
Hi everyone I am analyzing the performance on my SQL Server and need some advice on why I am seeing the results that I am.
One of my problems is that the SQL Server takes an extremely long time to execute the following command 'exec sp_spaceused' on my tempdb. This command usually displays how much free space is remaining on the selected server.
My other problem is that one of the applications that use SQL Server as a back end is acting extremely slugish. Navigating through screens, performing functions and refreshing grids take some time to execute however when I do a trace in SQL Profiler the queries seem to be executing instantly. My first thought was that the queries executed by the application needed to be optimized, but when I do a trace on the queries spawned by the application they seem fine. Does this mean that I have a network bottleneck problem or possibly a PC problem? The PC that we use to do our testing is a P4 3.0 with 512MB of ram running on Windows 2000. The SQL Server is running on Windows 2003 Server with a Raid 5 configuration 4 zeon 3.0 processors with 4 GB of ram. I feel that our desktop PC are sufficient to run any application but have received suggestions that I should upgrade my client PC's to at least 1GB of ram or move to a Citrix server, configure my SQL Server for Raid 10, try file splitting, use gigabit connections from the SQL Server to the desktops etc.
Given the facts above can someone give me advise on the most logical way to resolve my performance issue. Is my problem on the application end of things or do I need to change my network architecture and or hardware?
have SQL Server 2005 std edition SP1 installed on Windows 2003 Std edition .Configured Transactional (single Publisher and no clustered environment.) Replication past two months working fine, Now 1.Distrib.exe application err is coming.
Due to which my job is failing (Distributor to Subscriber). Iam attaching thw file. Thanks Sandeep
Hello Everyone,I have a very complex performance issue with our production database.Here's the scenario. We have a production webserver server and adevelopment web server. Both are running SQL Server 2000.I encounted various performance issues with the production server with aparticular query. It would take approximately 22 seconds to return 100rows, thats about 0.22 seconds per row. Note: I ran the query in singleuser mode. So I tested the query on the Development server by taking abackup (.dmp) of the database and moving it onto the dev server. I ranthe same query and found that it ran in less than a second.I took a look at the query execution plan and I found that they we'rethe exact same in both cases.Then I took a look at the various index's, and again I found nodifferences in the table indices.If both databases are identical, I'm assumeing that the issue is relatedto some external hardware issue like: disk space, memory etc. Or couldit be OS software related issues, like service packs, SQL Serverconfiguations etc.Here's what I've done to rule out some obvious hardware issues on theprod server:1. Moved all extraneous files to a secondary harddrive to free up spaceon the primary harddrive. There is 55gb's of free space on the disk.2. Applied SQL Server SP4 service packs3. Defragmented the primary harddrive4. Applied all Windows Server 2003 updatesHere is the prod servers system specs:2x Intel Xeon 2.67GHZTotal Physical Memory 2GB, Available Physical Memory 815MBWindows Server 2003 SE /w SP1Here is the dev serers system specs:2x Intel Xeon 2.80GHz2GB DDR2-SDRAMWindows Server 2003 SE /w SP1I'm not sure what else to do, the query performance is an order ofmagnitude difference and I can't explain it. To me its is a hardware oroperating system related issue.Any Ideas would help me greatly!Thanks,Brian T*** Sent via Developersdex http://www.developersdex.com ***
Hello Which is better and faster?? and WHY????Writing Select Statement with joins in Stored procedure, or creating view and calling it from stored procedure (select * from view)..
I am not entirely ignorant to web technologies, and best practices but i am having a bit of a planning dylema.
My company has a well established SQL 2000 database with windows application which has been created by myself, what i am planning on doing is creating a web site, using asp.net and publishing some of the information, so that our clients may use it, and stop pestering us on the phone. what i would like to know is what would be the best way forward, obviously i don't want to show them all our information, and don't want to put 5Gb worth of data onto a ISP website. What would you suggest i do?
DECLARE @returnDay int SELECT @returnDay = DatePart(day,GetDate()) If @returnDay = 8 BEGIN select * from Hospitals left join Units ON Units.HospitalID = Hospitals.HospitalID where Units.HospitalID is null RETURN END
this is just a part of the procedure I am trying to create, I am getting hospitals that haven't submitted any data and wish to send them an email.
on the other hand I have two tables that have all the data for emailing to hospitals but are not linked to tables giving the list of hospitals
I have been advised to create a cursor(easier said then done) that will go through my list of records that need to receive an email
nothing going very well with that at the moment.
so I was hoping to see if somebody has any other suggestions for me.....
Let me try to explain it...I am getting DEGREEID from one of the SELECT query . I want to OUTPUT (ie , COUNT) from procedure,the number of departments with the degreeid, got from the above query.
With below procedure, Since an employee can have multiple DEGREEID , the cursor is giving OUPTUT ie, COUNT for the LAST Degreeid. Eventhough the previous DEGREEID dont have any DEPARTMENT...but only for the LAST DEGREEID...!
How can I solve this..... whether I can solve this with CURSOR or I have to use someother way...Please advice me !
My first request for help here even if I read this site quite often and got tons of usueful information. Thanx all
I have an application (VB 6) calling store procedure on a SQLServer 2000 DB. One of the table gives me headache. I wrote a simple store procedure to insert a record into that table. If I call the store procedure from query manager it works perfect but if I call it from VB it looks like to work (return from the execute fine) but then I query the table for that record and it'll just take time and then return time out. I have to stop the VB application and then query it again then it'll return no record.
I suspect the table being locked somehow but I check inside the VB app code and that's the only place the table is called. Further more I have hundred of store procedures being used that way and they're all ok. I indexed the table , no use either...
I am just short of ideas how to debug this...I'll need your advice :)
Okay, given my newness to SQL, and the complexity of this query, I thought I'drun this by you for your opinion:SELECT DISTINCT a.WeekEnding, c.lastdate, c.numlate, b.totaldateFROM Accomplishment a LEFT OUTER JOIN(SELECT weekending, COUNT(weekending) AStotaldateFROM AccomplishmentWHERE (EmployeeID = 50)GROUP BY weekending) b ON a.WeekEnding =b.weekending LEFT OUTER JOIN(SELECT weekending, MAX(entrydate) ASlastdate, COUNT(weekending) AS numlateFROM accomplishmentWHERE employeeid = 50 AND entrydate >weekendingGROUP BY weekending) c ON a.WeekEnding =c.weekendingORDER BY a.WeekEndingWhat I'm trying to do is for each pay period find which ones the employeesubmitted a timesheet and which they were late (and if they were late, howmany of them). However, the query takes a good 5 seconds, and it seemsremoving the "entrydate > weekending" clause speeds things up to almostinstant, however it does ruin the count that I really want. No idea whythat makes such a difference..
I have an Accounting system(vb.net 2003, SQL server 2000), every new year data is cleared, but i may use some data from previous years (such as liabilities)??
whats the best way to that ???
-Shall I create programmatically a new clone DB every year (new DB with same structure as previous year) OR -Shall I add a "year field" for tables in DB????
knowing that data will keep growing every year??????
whats the best solution, knowing that i dont want the end user of my application to do anything manually, such as creating DB ......
I have a couple of files that I have that are comma seperated, and am looking for the best way to take those files, but them in a temp location to run some sql up against, and than update or insert a production sql database based on a SP i have written that takes a number of variable. I have played around with using the recordset destination and defining all the variables and than using a for each loop but seem to be stuck. Somewhat new to the whole programming field, and to be honest, seems a little intimidating with the little I know of the programming side. Just looking for some thoughts.
I am new to the CE OS, SQL CE and mobile computing in general. I have been developing database applications using MS products ever since Windows 3.11 and Visual Basic 1.0. I have used MS Access and SQL Server since they were first released. But, I have never worked with Windows CE or any of the mobile OSs or with SQL CE or SQL Mobile.
We now have a project that requires us to develop a database application on handheld devices using the CE 4.2 and CE 5.0 OSs.We will be using CF 2.0, VS 2005 and SQL 2005 for our development environment.
My questions are: 1. Which version of mobile SQL will allow us to best develop for both the CE 4.2 and 5.0 OSs usinf VS 2005? I have done a lot of reading online and it's pretty confusing. There are quite a number of different versions out there. It seems some work with 4.2 and some with 5.0. Is there a version that will work for both?
2. Is SQL CE 3.0 (Sql 2005 Mobile) available for other than Laptop and Tablet use? When i finaly got to the download page for this version there was verbiage there that suggested it was not available for smart devices.
3. What is a good source of info to resolve these questions? I am using the MSDN areas for CE and SQL Mobile but haven't really found what I need to get started. Any suggestions on forums, books, articles, blogs, etc... would be greatly appreciated.
I know these are very broad questions but I want to get some advice from the experienced before going to far here.
I just want to ask for any good advice here ragarding my project. I'm planning to create a program that will use an sql server as a database. I have 3 branches and I need the branches to be updated always when they create any transaction or changes. The sql server will be installed in a PC with Windows Server 2003 and with a public IP. the question is can I access the sql server from other branches by using the public IP of the ServerPC thru the Internet? If yes, how? if no, is there a best way to do this updating method?
I am totally new to SQL and need to ask some basic questions.
Can anybody tell me if SQL 2005 will run ok on Windows Server 2008 32bit and/or 64bit.
Also, we are currently planning to implement OCS 2007 and we are considering running it on Windows Server 2008 32bit with SQL 2005. Does anyone know if this combination is possibleand if not what implementation should we be looking at.
here is my situation, i have a central database server that contains all the data, running in an intranet, the client application, which is a thick client containing most of the biz logics is installed on a laptop,
i m required to develop a solution so that when the client application is disconnect to the database server (e.g. the laptop is taken away somewhere) the application can still work and when the client application gets connect to the database server again the application will be able to synchronize changes with the database and update all the changes. and i m not allow to develop a web-base application
my initial thinking is to use merge replication, however, i m conerning with the performance on the laptop if i have to install sql server on the laptop.
is there any other approach that can still achieve the requirement and have a better performance?
Hey, don't know if it's the right place for this question but i hope you help me. I made an application with VS 2005 that connecting to sql server file db.mdf Now i want this application work on another user computer, and of course i don't want to install vs 2005 there. I did install .net framework, but what i need to do to make the database work? do i have to install sql server on his computer? or is there something more simple? I know that if i was using access file than i need to install nothing else. please help! thanx. max
Hello Everyone,I have a very complex performance issue with our production database.Here's the scenario. We have a production webserver server and adevelopment web server. Both are running SQL Server 2000.I encounted various performance issues with the production server witha particular query. It would take approximately 22 seconds to return100 rows, thats about 0.22 seconds per row. Note: I ran the query insingle user mode. So I tested the query on the Development server bytaking a backup (.dmp) of the database and moving it onto the devserver. I ran the same query and found that it ran in less than asecond.I took a look at the query execution plan and I found that they we'rethe exact same in both cases.Then I took a look at the various index's, and again I found nodifferences in the table indices.If both databases are identical, I'm assumeing that the issue isrelated to some external hardware issue like: disk space, memory etc.Or could it be OS software related issues, like service packs, SQLServer configuations etc.Here's what I've done to rule out some obvious hardware issues on theprod server:1. Moved all extraneous files to a secondary harddrive to free up spaceon the primary harddrive. There is 55gb's of free space on the disk.2. Applied SQL Server SP4 service packs3. Defragmented the primary harddrive4. Applied all Windows Server 2003 updatesHere is the prod servers system specs:2x Intel Xeon 2.67GHZTotal Physical Memory 2GB, Available Physical Memory 815MBWindows Server 2003 SE /w SP1Here is the dev serers system specs:2x Intel Xeon 2.80GHz2GB DDR2-SDRAMWindows Server 2003 SE /w SP1I'm not sure what else to do, the query performance is an order ofmagnitude difference and I can't explain it. To me its is a hardware oroperating systemrelated issue.Any Ideas would help me greatly!Thanks,Brian T
I'm creating a DB to track clients, programs, and client participation in the programs. They are service programs. A client can be in more than one program and a program can have more than one client. Can someone give me an example of how they would layout the tables? My guess is: tblClient, ClientID tblClientProgramLog, ProLogID, ClientID tblProgramDetails, ProDetailID, ProLogID tblPrograms, ProgramID, ProDetailID I appreciate any suggestions,
Hello,Consider I have a String:Dim MyString As String = "Hello"or an Integer:Dim MyInteger As Integer = 100or a class which its properties:Dim MyClass As New MyCustomClass MyClass.Property1 = "Hello" MyClass.Property2 = Unit.Pixel(100) MyClass.Property3 = 100Or even a control:Dim MyLabel As Label MyLabel.Id = "MyLabel" MyLabel.CssClass = "MyLabelCssClass" Is there a way to save a String, an Integer, a Boolean, a Class, a Control in an SQL database?Something like: Define something (Integer, String, Class, Control, etc) Save in SQL 2005 Database Later in code Retrive from database given its IDIs this possible?How should I do this?What type of SQL 2005 table field should be used to store the information?Thanks,Miguel
Hello,I am creating a simple blog system using SQL 2005.I have a Blog table:[BlogId] > PostId (PK), BlogTitle, ...And a Posts table[Posts] > PostId (PK), BlogId (FK), PostContent, PostLabels, ...PostLabels would have the following format:Label1,Label2,Label3, etc ...I will need to perform 3 actions:1. Get all posts in blog2. Get all labels in a post3. Get all unique existing labels in all posts in a blog and make a list.I am not sure if my approach of using a simple labels column in my Posts table is a good idea.So my other idea would be to add two more tables:[BlogLabels] > BlogLabelId (PK), BlogId (FK), LabelName ...[LabelsInPosts] > BlogLabelId (PK), PostId (PK)So my idea is:1. When creating a post one of the parameters would be a comma separating string with all labels for the post. Inside SQL Procedure I will need to loop through each label and check if it exists in BlogLabels. If not then I added it. For each label I add a records in LabelsInPosts. How to create this loop? Am I thinking this right?2. To get a list of all labels in a blog I would need to go to BlogLabels and get all labels which are related with posts in LabelsInPosts. Those posts must be only the ones that are related with my given BlogId. Grrr, this is getting really confusing for me. Is this possible to to? How?Please, give me some advice about all this.Thanks,Miguel