Do Indexes Help Writes?

Sep 26, 2005

I have an application that is insertting thousands of records houlry. The server's hard drives are staying maxxed out. My boss says there is an index problem. I say it is a drive subsystem issue.

Any help would be appreciated to understand this performance problem.

View 2 Replies


ADVERTISEMENT

SQL Server Admin 2014 :: Indexes With More Writes Than Reads

Jul 17, 2015

I have inherited a database that is over-indexed, i.e. there are sometimes 10-20 indexes on a table. The performance is at times not great due to blocking from long running queries. I want to clean up the indexes as a starting point.

Through a query I found some time ago on the SQLCat blog I have discovered a large number of indexes in the database that have a huge disparity between reads and writes. The range of difference is sometimes almost 2 million more writes than reads. Should I just drop the indexes that have say, more than 100,000 more writes than reads and then see what the Missing Index DMVs tell me after a few days of running without those indexes?

In some cases there are a few hundred thousand reads but maybe a million writes on the index. Thus, there are a fair number of reads happening, just not in comparison to the number of writes. In some cases there are almost no reads and a million or more writes. I am obviously dropping those indexes. I just am not sure what to do about the indexes that do have a fair number of reads.

View 9 Replies View Related

Reads / Writes Per Second.

Oct 30, 2006

How can You find the reads and writes per second of your hard drives in sql. I am reading my SQL book and it says that your average disk should have 125 or less i/o's. And it gave the forumal but as mentioned I don't know how to find the reads and writes.

View 4 Replies View Related

Writes Are Not Commited Right Away

Mar 25, 2008

Hi!

First of all I want to tell you that I'm not a dba or tuning expert but I've ran a trace on a database with perfomance problems and I've found a strange thing.

The user creates orders for their service people in the organisation. I can see in the trace that inserts are done but they don't produce any writes rightaway. However after 10-15 minutes all the writes are done, what could make the actual write be delayed so much. The application is developed using .net.

/Magnus

Jesus saves. But Gretzky slaps in the rebound.

View 8 Replies View Related

COUNT Of READS And WRITES On A 6.5 Db.

Jul 21, 2000

Is there a way to get a total count of all SELECT, UPDATE, DELETE and INSERT statements to a SQL Server 6.5 database during a 12 hour period? I'm thinking maybe someone knows of a software that reads the log or monitors the server... I've been looking at the performance monitor and, although it has good information, it doesn't capture DML's.

FYI - it's for capacity planning.

TIA,
Mike

View 1 Replies View Related

Track Reads And Writes

Mar 5, 2008

GUys,

Is there any way track tables which have most no of reads and writes from a database of 400 tables.

Thanks

View 9 Replies View Related

Removal Of Selected Indexes / Script Index Create For List Of Indexes

Jul 1, 2014

I'm working to improve performance on a database I've inherited, and there are several thousand indexes. I've got a list of ones which should definitely exist within the database, and I'm looking to strip out all the others and start fresh, though this list is still quite large (1000 or so).

Is there a way I can remove all the indexes that are not in my list without too much trouble? I.e. without having to manually go through them all individually. The list is currently in a csv file.

I'm looking to either automate the removal of indexes not in the list, or possibly to generate the Create statements for the indexes on the list and simply remove all indexes and then run these statements.

As an aside, when trying to list all indexes in the database, I've found various scripts to do this, but found they all seem to produce differing results. What is the best script to list all indexes?

View 5 Replies View Related

Got An Expensive Server, SQL Is Very Slow On Writes

Feb 2, 2004

Hi,

i am experiencing SQl write performance problems on a very shiny server. Got data files on a Raid 1+0, log files on a separate drive, all SCSI, Win2003 server, 6G RAM, 2 Xeon processors. I've created a small benchmarking program and run it on my desktop pc and this 'big' server. Here are the results:

Desktop: SQL server inserts: 78 Seconds, Direct writes to the harddisk(Just write a string to the file 10000 times): 13 seconds

SQLServer: SQL server inserts: 422 Seconds, Direct writes to the harddisk: 16 seconds

So, for some reason, my 'shiny' machine is 6 times slower on writes than my desktop. When i tried comparing the select performance, my shiny server is 10 times faster than my desktop.

Initially i had Raid5 on my server and it had poorer direct write performance but now, direct writes seem to be ok, so, i recon this is a problem related to SQL server.

What can i do to improve the insert performance?

Thanks in advance

View 8 Replies View Related

Too Many Writes At Once Causing Time Outs?

Feb 18, 2004

Hi everyone! I'm new to this forum and I suspect I'll be using this forum frequently. Good stuff.

Allow this question may appear to be Web-related, I think the problem is with what I'm doing with the database. Please read.

I'm trying to implement a page tracking solution using ASP and SQL 2000. It basically writes a new record to a table every time a user visits a page on the site. It appeared to work fine at first, then I've increasingly been getting time out errors on my pages -- all pointing to the include file that fires the database write.

Here's the code that's referenced on every page:

Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "dsn=x;uid=y;pwd=z;"

Set objRecordset1= Server.CreateObject("ADODB.Recordset")
objRecordset1.Open "SELECT * FROM table",Conn,1,2
objRecordset1.AddNew
objRecordset1.Fi elds("PAGE") = Left(request.servervariables("SCRIPT_NAME"),100)
objReco rdset1.Fields("QUERY_STRING") = Left(request.servervariables("QUERY_STRING"),100)
objRec ordset1.Fields("DATE") = Date()
objRecordset1.Fields("TIME") = Time()
objRecordset1.Fields("PLATFORM") = Left(request.servervariables("HTTP_USER_AGENT"),100)
obj Recordset1.Fields("REFERRER") = Left(request.servervariables("HTTP_REFERER"),100)
objRec ordset1.Fields("USER_IP") = Left(request.servervariables("REMOTE_ADDR"),20)
If Request.Cookies("TEST")("ID")<>"" Then
objRecordset1.Fields("VISITOR_ID") = Request.Cookies("TEST")("ID")
End If
objRecordset1.Update

Conn.Close
Set Conn=Nothing
%>

After taking out the reference to the above code everything speeds back up. So, I know the performance hit and time out issues have to do with the code above.

Is it the simultaneous write to the table, the constant opening and closing of the recordset, the cursor type, the lock type – or combination of things?

HELP!! Thanks!

David

View 3 Replies View Related

Checking For Dirty Reads/writes

Apr 17, 2008



Problem Statement........


Lets say user A accesses a record and is making an update to a column... next user B accesses the same record and makes an update to the same column and saves the data... how can user A check to see if an update has been made to prevent overwriting the data..

Is there a query statement that user A can write to check for this?

I understand locking can be used to prevent this but is there an alternative to locking.

View 5 Replies View Related

How To Make Sure No Other Table Writes Happen Between 2 SQL Statements ?

Nov 25, 2007

Ok, here is my situation.....
When someone navigates to a user's profile page on my site, I present them with a slideshow of the user's photos using the AJAX slideshow extender.  I obtain the querystring value in the URL (to determine which user's page I'm on) and feed that into a webservice via a context value where an array of photos is created for the slideshow.  Now, in order to create the array's size, I do a COUNT of all of that specific user's photos.  Then, I run another SQL statement to obtain the path of those photos in the file system.  However, during the time of that first SQL query's execution (the COUNT statement) to the time of the second SQL query (getting the paths of the photos), the owner of that profile may upload or delete a photo from his profile.  I understand this would be a very rare occurrence since SQL statements 1 and 2 will be executed within milliseconds of each other, but it is still possible I suppose.  When this happens, when I try to populate the array, either the array will be too small or too large.  I'm using SqlDataReader for this as it seems to be less memory and resource intensive than datasets, but I could be wrong since I'm a relative beginner and newbie.   This is what I have in my vb file for the webservice.....Public Function GetSlides(ByVal contextKey As String) As AjaxControlToolkit.Slide()     Dim dbConnection As New SqlConnection("string for the data source, etc.")     Try          dbConnection.Open()          Dim memberId = CInt(contextKey)          Dim photoCountLookupCmd As New SqlCommand _               ("SELECT COUNT(*) FROM Photo WHERE memberId = " & memberId, dbConnection)          Dim thisReader As SqlDataReader = photoCountLookupCmd.ExecuteReader()          Dim photoCount As Integer          While (thisReader.Read())               photoCount = thisReader.GetInt32(0)          End While          thisReader.Close()          Dim MySlides(photoCount - 1) As AjaxControlToolkit.Slide          Dim photoLookupCmd As New SqlCommand _               ("SELECT fullPath FROM Photo WHERE memberId = " & memberId, dbConnection)          thisReader = photoLookupCmd.ExecuteReader()
          Dim i As Integer          For i = 0 To 2               thisReader.Read()               Dim photoUrl As String = thisReader.GetString(0)               MySlides(i) = New AjaxControlToolkit.Slide(photoUrl, "", "")          Next i          thisReader.Close()          Return MySlides     Catch ex As SqlException     Finally          dbConnection.Close()
     End Try
End FunctionI'm trying to use the most efficient method to interact with the database since I don't have unlimited hardware and there may be moderate traffic on the site.  Is SqlDataReader the way to go or do I use something else?  If I do use SqlDataReader, can someone show me how I can run those 2 SQL statements in best practice?  Would I have to somehow lock writing to that table when I start the first SQL statement, then release the lock after I execute the second SQL statement?  What's the best practice in this kind of scenario.
Thanks in advance.

View 3 Replies View Related

After Upgrading To SQL 7.0 Database Writes/saves Are Slow...

Apr 18, 2002

I upgraded from 6.5 to 7.0 SP3. Now when I save (write) an invoice it takes about 10-12 seconds, at 6.5 it was 1-3 seconds. SQL Server and my Materials App are the only thing running on this box. This is the only area that has gotten slower everything else works great. I have 3 users saving invoices and about 15 people total using the system at one time. It's a compaq DL580 loaded with memory, database is 2,195MB in size. Same 6.5 client to access system as before. Should I rebuild/reindex the database? Is there something from the old 6.5 version I need to remove?? Thanks in advance!!!

View 1 Replies View Related

SQL Server 2008 :: Disk Reads And Writes

Nov 5, 2015

How can I measure the disk reads and writes to see if I need to add aditional disks to the server?

View 2 Replies View Related

Large Binary Writes Slower Than Expected

Jul 23, 2005

Hello, we are investigating the use of SQL Server as a backend to ourscientific imaging application. We have found that when we write alarge image (60 Megabytes) the performance is quite a bit slower thanwriting 60 single megabyte images. The tests were performed runningSQL Server 2000 on Windows 2003 Enterprise on a single machine toeliminate the network's contribution. Perhaps there is a configurationoption that will allow us to tune SQL Server to better handle largewrites?TIA

View 1 Replies View Related

Reads And Writes To A Sql Server Database Per Table

Aug 1, 2006

Is it possible to find the reads/writes to a sql server table ?

View 2 Replies View Related

How To Avoid That My Application Writes To Windows' EventLog?

Oct 25, 2006

Hi everyone,

Every time that my application throws an .DTSX file I don't know who or what is writing on eventviewer.application if failed or successful.
Execute method implements a customized class which implements IDTEVENTS but I promise that in any place of my code I'm writing that information.

app.execute(nothing,... MYEVENTS)

Public Class MYEVENTS
Implements IDTEVENTS

..
..
..
..

All the methods are declared although empty but OnQueryCancel which is customized.

How to disable this behaviour?


I'm concerned for that because of we could launch (when it's gonna in live) 300 or 400 packages on-daily basis!!!


Thanks in advance and regards,



















View 3 Replies View Related

SQL Server 2008 :: High Volume Reads And Writes?

Jul 6, 2015

We are in the process of moving existing clustered SQL server databases to AWS. There is one major database that has intensive reads and writes transactions. I'm wondering what is the best design to optimize the performance for both R/W since we have constant issues historically with the current environment when massive updates are happening. Reads shall have higher priority over writes.

View 2 Replies View Related

What Is The Best Way To Achieve Best Latency For Reads And Writes To SQL Server 2005?

Oct 18, 2007

I am looking into various options to improve latency of our application (we figured the latency is mainly because data persistence - writes and reads from DB). I am looking into In-Memory databases also. But, before making that decision (of using in memory databases), I would like to see if there is a way to configure SQL Server 2005 to get as close performance as in-memory databases?

My question:
1. Is there a way that I can configure SQL Server 2005 to use a CACHE that gets loaded as needed basis, so that future database reads/writes will happen to the cache as opposed to disk (db writes)?
2. Is SQL Server 2005 recoverable in such configurations?
3. Are there any ideas/resources where I can get more details? (Such as sample configurations with bench mark numbers, rpevious experiences..etc)

Thanks
Murthy

View 1 Replies View Related

Looking For A Good Example Of A Script Task In The Dataflow That Writes To A File

Jul 4, 2006

I need to write back to a legacy system in the form of flat file --the first row would be a header and the remaining rows would be the actuals rows of data--each field would have a column delimiter of , and a row delimter of CRLF.

The source is a SQL Server 2005 table.

Im looking for a good example of a script task in the dataflow section that writes to a file.

Can anyone show me the code how to do this or point me to a link.

thanks in advance

Dave



View 10 Replies View Related

My Error Handler Writes Duplicate Messages To Email!

Aug 22, 2007

I am using an error handler that was provided to me from another source. However, I notice that there's something in the code that writes the error message twice. I tried to discover what it was, but could not seem to pinpoint it. Here's an example of what my email messages look like:

Is activity file current?
The Script returned a failure result.
The extracts in D:myFolder are not current! Data NOT loaded.
Is activity file current?
The Script returned a failure result.
The extracts in D:myFolder are not current! Data NOT loaded.

Obviously, I just want my email to read:

Is activity file current?
The Script returned a failure result.
The extracts in D:myFolder are not current! Data NOT loaded.

Somewhere, errorMessages is being written to more than once. Need help finding the error.

Thanks!

Here is the code from my Event Handlers:

OnError event:


Public Sub Main()

Dim messages As Collections.ArrayList


Try

messages = CType(Dts.Variables("errorMessages").Value, Collections.ArrayList)

Catch ex As Exception

messages = New Collections.ArrayList()

End Try


messages.Add(Dts.Variables("SourceName").Value.ToString())

messages.Add(Dts.Variables("ErrorDescription").Value.ToString())

messages.Add(Dts.Variables("scriptError").Value.ToString())

Dts.Variables("errorMessages").Value = messages

Dts.TaskResult = Dts.Results.Success

End Sub


On PostExecute:


Public Sub Main()

Dim errorDesc As String

Dim messages As Collections.ArrayList

Try

messages = CType(Dts.Variables("errorMessages").Value, Collections.ArrayList)

Catch ex As Exception

Return

End Try


For Each errorDesc In messages

Dts.Variables("emailText").Value = Dts.Variables("emailText").Value.ToString + errorDesc + vbCrLf

Next

Dts.TaskResult = Dts.Results.Success

End Sub

View 4 Replies View Related

Deploy To Production Server / SSIS Writes Out Garbage Data

Apr 2, 2015

I built a SSIS(writing out to a flat file ) in 32 bit machine and it woks fine . But however when I deploy to the produciton server(64 bit) the SSIS writes out garbage data . After some research I found out that the problem with the 32 bit OS and 64 bit OS problem.What is my next step. Am I out of luck that now I will have to redesing the SSIS in 64 bit?

View 5 Replies View Related

SQL Server Admin 2014 :: Backing Up To Mount Point - Perfmon Shows Zero Writes

Apr 20, 2015

Im backing up to a network directory thats actually a mount point on a different server.My backup was slower than usual so i opened up perfmon to have a look.

When selecting the mount point from the Logical Disks section in perfmon i can see that writes/sec & write bytes/sec both show zero for a long period of time, even though the backup percent complete is increasing.Then all of a sudden the writes to the network share jump massively.

Is there some caching mechanism for backups in sql where during a backup data is only flushed to the disk periodically during backup?

View 1 Replies View Related

SQL Server Admin 2014 :: How Data Writes In Multiple Secondary Files If There Is No Filegroup Created

Nov 12, 2014

I read , When sql server Database having multiple data files within single filegroup then sql server writes data in multiple proportional file algorithm where the amount of data written to a file is proportionate to the amount of free space in that file, compared to other files in the filegroup.

so if there is no filegroups created and multiple secondary files are attached in databse , is there same way data stored and writes data in multiple files by the same algorithm or any different way.

View 2 Replies View Related

A Question About Clustered Indexes Forcing Rebuild Of Non-clustered Indexes.

Sep 18, 2007

So I'm reading http://www.sql-server-performance.com/tips/clustered_indexes_p2.aspx and I come across this:
When selecting a column to base your clustered index on, try to avoid columns that are frequently updated. Every time that a column used for a clustered index is modified, all of the non-clustered indexes must also be updated, creating additional overhead. [6.5, 7.0, 2000, 2005] Updated 3-5-2004
Does this mean if I have say a table called Item with a clustered index on a column in it called itemaddeddate, and several non-clustered indexes associated with that table, that if a record gets modified and it's itemaddeddate value changes, that ALL my indexes on that table will get rebuilt? Or is it referring to the table structure changing?
If so does this "pseudocode" example also cause this to occur:
sqlstring="select * from item where itemid=12345"
rs.open sqlstring, etc, etc, etc
rs.Fields("ItemName")="My New Item Name"
rs.Fields("ItemPrice")=1.00
rs.Update
Note I didn't explicitly change the value of rs.fields("ItemAddedDate")...does rs.Fields("ItemAddedDate")=rs.Fields("ItemAddedDate") occur implicitly, which would force the rebuild of all the non-clustered indexes?

View 4 Replies View Related

Total Page Writes/total Amount Of Data Change In A Set Period Of Time

Jun 9, 2004

Does anyone know how I can determine the number of page writes that have been performed during a set period of time? I need to figure out the data churn in that time period.

TIA

View 5 Replies View Related

SQL Server 2008 :: Logic To Rebuild Only Clustered Indexes / Skipping To Rebuild Non Clustered Indexes In Same Table

Jun 25, 2015

I have a requirement to only rebuild the Clustered Indexes in the table ignoring the non clustered indexes as those are taken care of by the Clustered indexes.

In order to do that, I have taken the records based on the fragmentation %.

But unable to come up with a logic to only consider rebuilding the clustered indexes in the table.

create table #fragmentation
(
FragIndexId BigInt Identity(1,1),
--IDENTITY(int, 1, 1) AS FragIndexId,
DBNAME nvarchar(4000),
TableName nvarchar(4000),

[Code] ....

View 5 Replies View Related

Indexes Vs Clustered Indexes

Sep 17, 2006

What is the difference please?

View 1 Replies View Related

Indexes

Jul 31, 2002

Sir,

1. How do I call the indexes created in SQL server for a table from Front end VB programming ?
2. How can I use SEEK command with ADODB control ?

Please give me some tips & samples

Sundar Raman

View 1 Replies View Related

Indexes

Jul 23, 2001

Does anyone have the idea why the Indexes with _WA.....(like _WA_Sys_au_fname_07020F21) gets created.I don't how this index got created. I did not create this Index.
My Question is does the system creates these indexes or something else does this.
Thanks
Chak

View 1 Replies View Related

DB Indexes

Jul 27, 2000

Is there a way to tell how many indexes exist for an entire database, all I'm looking is for a count or generating a report list.
any help would be appreciated, thank you

View 2 Replies View Related

Indexes

Sep 13, 2000

At present I have been assigned to create indexes to retrieve the information fast, from the table. The existing table doesn’t have primary key, foreign key and unique constraints but I found to many default indexes already created by the system. I would like to know how this happened? Please inform how to delete these default indexes. Further, inform me other possible ways for the faster retrieval in SQL sever 7.0, if there are any.

I would appreciate if you send me a step by step explanations for the above problems.

Thanks a lot

View 1 Replies View Related

Indexes Not Being Used

Nov 20, 2000

I have run into a snag on my development server. Queries that are selecting data based on indexed fields in a where clause are using the wrong indexes. They are arbitrarily using the clustered index which isn't in the select at all and causing big performance problems. I can run the same statements on my production server and it runs based on the proper indexes. I used query execution plans to determine that this was infact the case.

I run DBCC Checkdb everynight and it comes back with no errors. I also rebuild the indexes. We also don't receive any other errors inputting or updating data. This sounds like corruption to me but if it's something else I don't want to spend the night restoring from production if there is another reason.

Has anyone encountered this before? Any ideas?

Appreciate it, K.

View 1 Replies View Related

6.5 Indexes

Jan 10, 2001

Is there any way for me to find out when last indexes have been used so that the one I don't need can be dropped.And also the one's that are of no use at all.
I need this as i am trying to dump all duplicated indexe . i know i can do this in ver 7

thanks

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved