Re: SqlServer DataBase Update Performance Problem

  • From: "tim.brugh" <isfeldt@xxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Wed, 9 Jan 2008 14:38:25 -0600

hi, got a question for any one who may be able to answer it.  using the latest 
version of EdSharp, and went to compile a little program I am working on in 
java.  compile went well but when I went to run it.  got the following lengthy 
error message.  Confirm
Unexpected event!
Application not found
Exit EdSharp?
Stack trace:
   at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo 
startInfo)
   at System.Diagnostics.Process.Start()
   at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start(String fileName)
   at EdSharp.MdiFrame.menuItem_Click(Object sender, EventArgs e)
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, 
ToolStripItemEventType met)
   at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, 
ToolStripItemEventType met)
   at System.Windows.Forms.ToolStripItem.ProcessDialogKey(Keys keyData)
   at System.Windows.Forms.ToolStripDropDownItem.ProcessDialogKey(Keys keyData)
   at System.Windows.Forms.ToolStrip.ProcessDialogKey(Keys keyData)
   at System.Windows.Forms.ToolStripDropDown.ProcessDialogKey(Keys keyData)
   at System.Windows.Forms.Control.PreProcessMessage(Message& msg)
   at System.Windows.Forms.Control.PreProcessControlMessageInternal(Control 
target, Message& msg)
   at System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(MSG& 
msg).
Exit EdSharp?
Yes No Cancel any help would be most grately appriciated and welcomed.  my 
screen names if any of you want to add me are as follows.  AIM. johan hegg666,  
 MSN is my email address, isfeldt@xxxxxxxxxx  Yahoo is hegg_johan.  thanks 
much.  sorry if this message is not related to the one posted.  
  ----- Original Message ----- 
  From: Will Pearson 
  To: programmingblind@xxxxxxxxxxxxx 
  Sent: Wednesday, January 09, 2008 13:53
  Subject: Re: SqlServer DataBase Update Performance Problem


  Hi Rick,

  Unfortunately, one profiler that you want to give a miss, at least for the 
moment, is Intel's VTune.  VTune displays most of it's profile data in the form 
of graphs.  It's a shame that VTune uses graphs as it's the profiler that gives 
you the most detailed performance information if you're running on Intel 
silicon.  I looked into using it a few months ago as I wanted to get access to 
the low level performance counters that Intel put on their chips to assess 
things like branch misprediction and cache misses in my code.

  The profiler that Microsoft built into Visual Studio is pretty accessible.  
There are a couple of places wthat don't respond too well to the keyboard but 
you can get around these very easily using the mouse functionality built into 
whatever screen reader someone is using.

  Will
    ----- Original Message ----- 
    From: Richard Thomas 
    To: programmingblind@xxxxxxxxxxxxx 
    Sent: Tuesday, January 08, 2008 3:55 PM
    Subject: Re: SqlServer DataBase Update Performance Problem


    Hi SuperGuy:
    Good to hear from across the pond again!
    Thanks and I'll take a look into profilers.  Perhaps one of the guys on 
list have some experience with an accessible one.
    By the way, I found the problem.  Sql Server AutoGenerates a Where Clause 
for an update that tests all columns for any changes against all records in the 
Table.  In my case that was 5,000 rows of about 4k bytes per row, 37 columns 
and allot of text.  I just dropped the use of the DataSet, extended the 
TableAdapter using the Partial class and used the SqlCommand and SqlParameter 
to execute only the desired code.  Time went from about 10 minuts to about 10 
seconds!
    Rick Farmington Mich. USA
      ----- Original Message ----- 
      From: Will Pearson 
      To: programmingblind@xxxxxxxxxxxxx 
      Sent: Monday, January 07, 2008 2:33 AM
      Subject: Re: SqlServer DataBase Update Performance Problem


      Hi Rick,

      I don't use databases, and so can't help with the specifics of your 
situation; however, the first step in optimisation is usually to use a profiler 
to see what parts of your code are taking a long time to run.  This helps in 
establishing where the problem is.  Performance problems are often not where 
you think they are, and so profiling is a really valuable step in optimisation.

      There are quite a lot of profilers out there.  Some cost money but I 
think there are some free ones as well.  The one I use is the one that is built 
into Visual Studio 2005's Team Developer and Team Suite editions.

      You might also find Rico Mariani's blog useful.  Rico is now the Cheif 
Architect for Visual Studio but before that he was the performance guru for 
Microsoft's Developer Division.  You can find Rico's blog at:
      http://blogs.msdn.com/ricom

      Will
        ----- Original Message ----- 
        From: Richard Thomas 
        To: programmingblind@xxxxxxxxxxxxx 
        Sent: Friday, January 04, 2008 12:14 PM
        Subject: SqlServer DataBase Update Performance Problem


        Hi Gang:
        I have a Sql Server DB.  I use the DataSet approach, strongly typed, to 
do the following for about 5,000 rows.
        Load MyDataTable using MyTableAdapter.
        Iterate the DataSet, DataTable using the 
        For Each MyRow in MyDataTable
        update about 25 columns for each MyRow.xxx
        Next MyRow
        When all rows updated, do Batch Push To DB:
        MyDataAdapter.Update( MyDataTable )
        The above is from memory but I think the syntax is ok, anyway, it takes 
over 10 minuts to run the batch push for only 5,000 rows.
        First, that is not acceptable to me so I would like to know the fastest 
method of updating my DataBase.
        Should I use a CommandBuilder, I read some bad things about that, a 
DataAdapter, ditto or what?  A cursor?
        Do you have anything on my problem as updating only a few thousand 
records should be almost a matter of a few seconds at most shouldn't it?
        It would be a split second for a flat or indexed file.
        Rick Farmington Mich. USA 

Other related posts: