Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: It took more than an hour to update 10,000 records

RE: It took more than an hour to update 10,000 records

From: Mercadante, Thomas F <NDATFM_at_labor.state.ny.us>
Date: Wed, 14 Aug 2002 06:48:35 -0800
Message-ID: <F001.004B4698.20020814064835@fatcity.com>


that would help. my guess is what others have said - that he is somehow issuing 10,000 individual update statements. each one requires the statement to be parsed, compiled then executed. there is little that one can do in the database to help that type of process. the real answer is to re-write the update into something that Oracle can run with much better efficiency. we can then add indexs to the table to support the update.

-----Original Message-----
Sent: Wednesday, August 14, 2002 10:18 AM To: Multiple recipients of list ORACLE-L

What's about creating a index on columns nxx_id, npa_id
?

Volker Schoen
E-Mail: mailto:v.schoen_at_inplan.de
http://www.inplan.de

-----Ursprüngliche Nachricht-----
Von: Mercadante, Thomas F [mailto:NDATFM_at_labor.state.ny.us] Gesendet: Mittwoch, 14. August 2002 15:14 An: Multiple recipients of list ORACLE-L Betreff: RE: It took more than an hour to update 10,000 records

It's tough trying to help someone when they don't provide the answers to the questions from the people trying to help!

-----Original Message-----
Sent: Tuesday, August 13, 2002 11:48 PM
To: Multiple recipients of list ORACLE-L

Is the instance running in archive log mode? If so, Was the archiver stuck? We run into similar 'slow' response issues once in a while, when the automated archived log directory maintenance job falls behind the rate of archive log generation.

-----Original Message-----
Sent: Tuesday, August 13, 2002 8:43 PM
To: Multiple recipients of list ORACLE-L

His problem is not reducing 60 sec to 20 seconds but why an hour or more was taken to update 10,000 rows.

It's obvious there are other things (which I indicated in my email) that need to be sorted out to reduce the hour to few minutes.

Regards,

Waleed  

-----Original Message-----
Sent: Tuesday, August 13, 2002 9:08 PM
To: Multiple recipients of list ORACLE-L

David,

You don't yet know why it's slow.

Why not turn tracing on for the session doing the inserts and then run tkprof on the trace file?

Since the inserts seem to be taking so long, you should also be able to join v$session_wait with v$session to catch the waits in action and determine exactly what they are.

You should also join v$session and v$session_event while the insert job is running.

Actually, using bind variables will probably help. The insert statements will be less resource intensive and run much faster, and this will result in less contention for other sessions.

My tests of insert statements with and without bind variables show that using bind variables resulted in an insert job of 27k rows running in 15 seconds and < 1/100 sec of parse time.

Not using bind variables required 60 seconds, 20 of which were CPU parse time.

The increased run time also resulted in 3x as many buffer busy waits for other sessions trying to hit the same table.

HTH Jared

"Nguyen, David M" <david.m.nguyen_at_xo.com> Sent by: root_at_fatcity.com
08/13/2002 01:34 PM
Please respond to ORACLE-L  

        To:     Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com>
        cc: 
        Subject:        RE: It took more than an hour to update 10,000
records

Is there a parameter that I can tune in init.ora file to improve this process?

Thanks,
David

-----Original Message-----
Sent: Tuesday, August 13, 2002 2:00 PM
To: Multiple recipients of list ORACLE-L

Bind variables will not buy you anything. The time taken is mainly dependent
on the execution plan and the cardinality of the indexes being used. Also any overhead like updating a column that's part of an index, triggers, referential constraints, etc.

Waleed

-----Original Message-----
Sent: Tuesday, August 13, 2002 2:35 PM
To: Multiple recipients of list ORACLE-L

I run it on the server. How do I use bind variables?

Thanks,
David

-----Original Message-----
Sent: Tuesday, August 13, 2002 1:13 PM
To: Multiple recipients of list ORACLE-L

>From the look of your sql statements it seems that each statement will be
hard parsed because the values are different. If you will use bind variables you can save a lot of time.

Is the script runs on the server or from another computer? If you run the script from another computer you also have the network time added.

Yechiel Adar
Mehish
----- Original Message -----
To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com> Sent: Tuesday, August 13, 2002 6:24 PM

> Hi all,
>
> I write a script to update 10,000 records in my database and noticed
> it

took
> more than an hour to update 10,000 records. The script just includes
10,000
> SQL update commands as shown below. Is the time too long to update
10,000
> records? Is it a way to improve the update task to run faster.
> Please advise.
>
> *** A portion of my update script is shown below:
>
> update dbimpl.npa_nxx set ported_flag = 1 where nxx_id = 206 and
> npa_id

=
> 201 and lata_id = 224;
>
> update dbimpl.npa_nxx set ported_flag = 1 where nxx_id = 207 and
> npa_id

=
> 201 and lata_id = 224;
>
>
> Thanks,
> David
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Nguyen, David M
> INET: david.m.nguyen_at_xo.com
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L (or the
> name of mailing list you want to be removed from). You may also send
> the HELP command for other information (like subscribing).

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Yechiel Adar
  INET: adar76_at_inter.net.il

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the
message BODY, include a line containing: UNSUB ORACLE-L (or the name of
mailing list you want to be removed from).  You may also send the HELP
command for other information (like subscribing).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Nguyen, David M
  INET: david.m.nguyen_at_xo.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the
message BODY, include a line containing: UNSUB ORACLE-L (or the name of
mailing list you want to be removed from).  You may also send the HELP
command for other information (like subscribing).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Khedr, Waleed
  INET: Waleed.Khedr_at_FMR.COM

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the
message BODY, include a line containing: UNSUB ORACLE-L (or the name of
mailing list you want to be removed from).  You may also send the HELP
command for other information (like subscribing).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Nguyen, David M
  INET: david.m.nguyen_at_xo.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the
message BODY, include a line containing: UNSUB ORACLE-L (or the name of
mailing list you want to be removed from).  You may also send the HELP
command for other information (like subscribing).



-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: 
  INET: Jared.Still_at_radisys.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the
message BODY, include a line containing: UNSUB ORACLE-L (or the name of
mailing list you want to be removed from).  You may also send the HELP
command for other information (like subscribing).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Khedr, Waleed
  INET: Waleed.Khedr_at_FMR.COM

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the
message BODY, include a line containing: UNSUB ORACLE-L (or the name of
mailing list you want to be removed from).  You may also send the HELP
command for other information (like subscribing).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Deshpande, Kirti
  INET: kirti.deshpande_at_verizon.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the
message BODY, include a line containing: UNSUB ORACLE-L (or the name of
mailing list you want to be removed from).  You may also send the HELP
command for other information (like subscribing).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Mercadante, Thomas F
  INET: NDATFM_at_labor.state.ny.us

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the
message BODY, include a line containing: UNSUB ORACLE-L (or the name of
mailing list you want to be removed from).  You may also send the HELP
command for other information (like subscribing).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: 
  INET: v.schoen_at_inplan.de

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Mercadante, Thomas F
  INET: NDATFM_at_labor.state.ny.us

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Wed Aug 14 2002 - 09:48:35 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US