Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2001
    Posts
    32

    Unanswered: Performance degradation because of UPDATE

    I have a stored procedure which will insert into a table.When duplicate value on index exception arises,updates the same table based on Id column on which unique index is created.

    For the first time,i.e. table is empty ,The procedure is taking 1 minute to insert 24000 records.For the second time,the procedure does update and is taking 34 minutes.

    Question:
    1) Will Update take more time than Insert?
    2) How to overcome this problem?

    Please guide me.


    Thanks,
    Thangam

  2. #2
    Join Date
    Jul 2002
    Posts
    19

    Re: Performance degradation because of UPDATE

    HI
    I have 2 basic questions
    1. Can you pls explain more about what you are trying to do?
    2. I understand that you are trying to maintain a unique index (or a primary key). In that case why do you even go to the step of checking if there is duplicates , if you can actually create a unique id before inserting.
    That will be a redundant action and sure the performance will be degraded because you are "updating" an indexed field.(index sort and stuff like that)
    but to have a more clear understanding of the problem need more info on this

    regards
    C.Gajendran

  3. #3
    Join Date
    Jul 2001
    Posts
    32
    I have declared a cursor by joining 4 tables.Cursor may have duplicate values,whenever duplicate value comes,I will update the table with new value.But I am sure,I am not updating unique indexed column.I found the problem in updating the foreign key column of the table.Foreign key columns are required for that table.Do you have any idea to overcome this problem? Is this clear?
    Thanks,
    Thangam

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •