473,587 Members | 2,588 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to set priority

4 New Member
Hi Guys,

I have written a stored procedure having couple of insert and delete statements
example:
delete from mastertable1; //delete the records from master table
insert into mastertable1 select *from temptable1;
delete from temptable1; //delete the records from temp table

delete from mastertable2;
insert into mastertable2 select *from temptable2;
delete from temptable2;

Here the problem is some times the delete taking the priority than insert statement.... i.e "delete from temptable1;" statement executing first and then "insert into mastertable1 select *from temptable1;".

How can i avoid this... (in MS SQL server we have GO command.).. please help me out...

thanks in advance...
Mar 9 '08 #1
1 2749
docdiesel
297 Recognized Expert Contributor
Hi,

try to switch off autocommit and then use a COMMIT statement after each step. Furthermore, the DELETE statements may be taking a lot of time. If you need to delete all the records in a table, you could use a (very fast) LOAD command instead:

Expand|Select|Wrap|Line Numbers
  1. LOAD from /dev/null OF IXF REPLACE INTO temp.table ;
/dev/null will work on Linux or *nix systems. On Windows, "nul" may work. Otherwise use an empty file.

DB2 also enables you to use "Global Temporary Tablespaces" for temp. tables, which means the tables contents are valid for the current transactions and after disconnecting all the records just vanish by magic. You may even switch off the logging on these temp. tables, increasing the speed of your transactions.

Regards,

Bernd
Mar 9 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
4895
by: Joe Wong | last post by:
Hi, Is there any way to increase/decrease a thread priority in Python? Best regards, -- Wong
18
12572
by: Ken | last post by:
Hi. Can anyone refer me to any articles about the compatibility between c++ polymorphism and real-time programming? I'm currently on a real-time c++ project, and we're having a discussion about whether we should allow polymorphism. Our system is not embedded and does not need to be as real-time as, say, a pacemaker. But it does involve...
4
8914
by: Trev Hunter | last post by:
Hi All, I was just wondering if it is safe to change thread priorities with thread pool threads (threads used by System.Threading.Timer and those used by the ThreadPool class itself). Say I have a background task that runs periodically (it uses System.Threading.Timer to do this). As the execution speed of this task is not a priority, I...
1
5021
by: Norm | last post by:
I have a program that is cpu intensive so I want to change it's priority to BelowNormal. The code functions without error, the VS Debugger shows the change but when I then go to "Windows Task Manager" and look at my process it still has a "Base Pri" of "Normal". What thing am I missing? C# Code snippet:
38
5762
by: Aaron W. LaFramboise | last post by:
Hello, I understand that an easy way to make the standard std::priority_queue stable is by including an integer stamp with each node that is incremented each time a new node is pushed into the queue. However, no matter what reasonably-sized type I use for the stamp, eventually the stamp will 'wrap around' and possibly cause incorrect...
1
2903
by: Jim Strathmeyer | last post by:
So, I've been looking for a wrapper class for STL priority queues, and haven't been able to find one. (Websearching for info about the STL sure shows how much it's changed over the past few years.) I basically need to be able to queue up an object with a time, and retrieve and/or pop the element with the earliest time. So I coded a little...
5
13226
by: Dan H. | last post by:
Hello, I have implemented a C# priority queue using an ArrayList. The objects being inserted into the priority queue are being sorted by 2 fields, Time (ulong) and Priority (0-100). When I enqueue, I do a binary search on where to put the object and then insert using that index and arraylist.insert(index, obj) The bottom of my...
4
4207
by: Harry J. Smith | last post by:
How can a program change its execution priority in the operating system while it is running? -Harry
9
6087
by: Eugeny Balakhonov | last post by:
Hi! How to change query priority dynamically? I have a web site which uses PostgreSQL as a host database and a background program which uses this database too.
0
1737
by: savajx1 | last post by:
The programming task is to run a simulation model, as a distributed computing model, in the background on 250 departmental computers. I intend to allocate work (per machine) into say "5-10 cpu second units" of repetitive work, stealing CPU cycles when/where I can. I have a service that uses WCF to host a remote object that performs the...
0
7918
marktang
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...
0
7843
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...
0
8206
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8340
jinu1996
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...
1
7967
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...
0
6621
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5713
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5392
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3875
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.