Hi,
I'm currently running a delete process based on the results of a sub query but its taking forever to run. I'm new to using Oracle, and am constantly looking for better ways of doing things and wondered if anyone could help......
delete FROM DELTA_OD001
WHERE order_no in
(SELECT Td.order_no
FROM IMPORT_OD001_CU STOMERS CD, DELTA_OD001 TD
WHERE CD.ORANGE_ID = TD.ORANGE_ID);
The volume of rows in Delta_od001 is approx 8.5million and will go up 250k per week. The number of records matched in the sub select if about 950k, and will be relatively constant each week, although will probably drop to about 700k on average.
Do you know of a better way to do this?
5 4548
Can you use PL/SQL as well?
Not got massive amounts of experience with it, however im doing this through SQL Developer so dont see why not...
Then try making a procedure of it.
Make a cursor and loop through that cursor and delete every record you find in that cursor. I think what is making the delete statement so slow, is the in clause you are using.
It should look something like this: -
declare
-
-
cursor c_ord
-
is
-
SELECT Td.order_no
-
FROM IMPORT_OD001_CUSTOMERS CD
-
, DELTA_OD001 TD
-
WHERE CD.ORANGE_ID = TD.ORANGE_ID
-
;
-
begin
-
for r_ord in c_ord loop
-
delete FROM DELTA_OD001
-
WHERE order_no = r_ord.order_no;
-
end loop;
-
commit;
-
end;
-
If you get a snapshot too old, let me know, then i will tell you how to get around that.
Pilgrim.
Then try making a procedure of it.
Make a cursor and loop through that cursor and delete every record you find in that cursor. I think what is making the delete statement so slow, is the in clause you are using.
It should look something like this: -
declare
-
-
cursor c_ord
-
is
-
SELECT Td.order_no
-
FROM IMPORT_OD001_CUSTOMERS CD
-
, DELTA_OD001 TD
-
WHERE CD.ORANGE_ID = TD.ORANGE_ID
-
;
-
begin
-
for r_ord in c_ord loop
-
delete FROM DELTA_OD001
-
WHERE order_no = r_ord.order_no;
-
end loop;
-
commit;
-
end;
-
If you get a snapshot too old, let me know, then i will tell you how to get around that.
Pilgrim.
Thanks, will give it a try!
Hi,
I'm currently running a delete process based on the results of a sub query but its taking forever to run. I'm new to using Oracle, and am constantly looking for better ways of doing things and wondered if anyone could help......
delete FROM DELTA_OD001
WHERE order_no in
(SELECT Td.order_no
FROM IMPORT_OD001_CU STOMERS CD, DELTA_OD001 TD
WHERE CD.ORANGE_ID = TD.ORANGE_ID);
The volume of rows in Delta_od001 is approx 8.5million and will go up 250k per week. The number of records matched in the sub select if about 950k, and will be relatively constant each week, although will probably drop to about 700k on average.
Do you know of a better way to do this?
Is this query not working fine?
Always rebuild an index after large deletes for better performance
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: michaaal |
last post by:
If I use a form to pass data (say, for example, through a textbox) the data
seems to be limited to somewhat smaller amounts. What should I do if I want
to pass a large amount of data? For example a list of 200 items?
|
by: Digety |
last post by:
We are looking to store a large amount of user data that will be
changed and accessed daily by a large number of people. We expect
around 6-8 million subscribers to our service with each record being
approximately 2000-2500 bytes. The system needs to be running 24/7
and therefore cannot be shut down. What is the best way to implement
this? We were thinking of setting up a cluster of servers to hold the
information and another cluster...
|
by: oshanahan |
last post by:
Does anyone have ideas on the best way to move large amounts of data
between tables? I am doing several simple insert/select statements
from a staging table to several holding tables, but because of the
volume it is taking an extraordinary amount of time. I considered
using cursors but have read that may not be the best thing for this
situation. Any thoughts?
--
Posted using the http://www.dbforumz.com interface, at author's request...
|
by: Olaf Gschweng |
last post by:
We're new into DB2 and have some problem with DB2 8.1 (?) on a Linux system.
We load some big tables of a DB2 database from files every day. We do a
"DELETE FROM table" for each table and then we load the data by something
like that:
LOAD FROM "/pathto/artikel.data" OF DEL MODIFIED BY DATESISO CHARDEL0xbf
SAVECOUNT 50000
MESSAGES "/pathto/artikel.msg"
INSERT INTO artikel;
|
by: Wayne Marsh |
last post by:
Hi all.
I am working on an audio application which needs reasonably fast access to
large amounts of data. For example, the program may load a 120 second
stereo sound sample stored at 4bytes per sample, which would mean over
40MB of data at a 44100Hz sampling rate.
Now, what would be a good way to handle all of this data? Ideally, for the
sake of my own sanity and the algorithms within directly functional
portions of the code, I'd like...
| |
by: Dennis C. Drumm |
last post by:
What is the best way to add several pages of text to a readonly TextBox? The
text does not change and was created in a Word rtf document but could as
easly be put in a ASCII text file. Can this be done using a resource or
something? Can TextBoxes be attached to data sources other than database
objects?
Thanks,
Dennis
|
by: Bart |
last post by:
Dear all,
I would like to encrypt a large amount of data by using public/private keys,
but I read on MSDN:
"Symmetric encryption is performed on streams and is therefore useful to
encrypt large amounts of data. Asymmetric encryption is performed on a small
number of bytes and is therefore only useful for small amounts of data."
There is not possibility to do it? I have tried to encrypt a 300kB file by
RSA Algorithm, but I received...
|
by: NAdir |
last post by:
Hi, thank you for your help.
My VB.Net application contains a document that the user can refresh at any
time.
The refresh works fine and needs to loop through few datatables (hundreds of
rows). This works fine until I delete some rows in two tables. Just after the
delete if I do the refresh there is a huge memory allocated and the time
needed to perform the refresh increase, the memory and time continue to
increase on each refresh until I...
|
by: =?Utf-8?B?TW9iaWxlTWFu?= |
last post by:
Hello everyone:
I am looking for everyone's thoughts on moving large amounts (actually, not
very large, but large enough that I'm throwing exceptions using the default
configurations).
We're doing a proof-of-concept on WCF whereby we have a Windows form client
and a Server. Our server is a middle-tier that interfaces with our SQL 05
database server.
|
by: bcomeara |
last post by:
I am writing a program which needs to include a large amount of data.
Basically, the data are p values for different possible outcomes from
trials with different number of observations (the p values are
necessarily based on slow simulations rather than on a standard
function, so I estimated them once and want the program to include
this information). Currently, I have this stored as a vector of
vectors of varying sizes (first vector is...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |