473,386 Members | 1,741 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Optimization of delete query

HI,

How can I optimize my delete query that currently takes less than 1 min . I want to improve my query such that it take only few 2-3 secs.

My query is


DELETE FROM table1 R WHERE ROWID <> (SELECT MAX(ROWID)
FROM table1 T WHERE R.col1 = T.col1
AND R.col2 = T.col2
AND R.col3 = T.col3
AND NVL(R.REP_FETCH_DT_TM,SYSDATE) =
NVL(T.REP_FETCH_DT_TM,SYSDATE)
AND NVL(TRIM(R.SLPN_NO),0) = NVL(TRIM(T.SLPN_NO),0) )

Above query takes less than 50 secs. still I want to improve it . how can i do that ?
Feb 21 '07 #1
1 3246
michaelb
534 Expert 512MB
Did you try to run EXPLAIN PLAN for your statement to gather more details?
Feb 22 '07 #2

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

Similar topics

1
by: Andrew DeFaria | last post by:
I created the following .sql file to demonstrate a problem I'm having. According to the manual: If |ON DELETE CASCADE| is specified, and a row in the parent table is deleted, then InnoDB...
2
by: rocky | last post by:
We're building a company wide network monitoring system in Java, and need some advice on the database design and tuning. The application will need to concurrently INSERT, DELETE, and SELECT...
5
by: AC Slater | last post by:
Whats the simplest way to change a single stored procedures query optimization level? In UDB8 that is. /F
2
by: Eugene | last post by:
I am trying to set query optimization class in a simple SQL UDF like this: CREATE FUNCTION udftest ( in_item_id INT ) SPECIFIC udftest MODIFIES SQL DATA RETURNS TABLE( location_id INT,...
12
by: WantedToBeDBA | last post by:
Hi all, db2 => create table emp(empno int not null primary key, \ db2 (cont.) => sex char(1) not null constraint s_check check \ db2 (cont.) => (sex in ('m','f')) \ db2 (cont.) => not enforced...
4
by: Bernard Dhooghe | last post by:
To retrieve data from a query where multiple rows can be returned, a cursor can be used. Different programming interface exist for cursors: embedded SQL, CLI, SQL PL, SQLJ, JDBC. I we look at...
14
by: Mickey | last post by:
I have a database in which I have 2 tables. One table is Employees, other is Events. I have only one field in Employees and it is EmployeeName (text 50 chars). Events has fields AutoNumber,...
4
by: specialdosa | last post by:
We use DB2-LUW-8.2. I am doing some research on performance issues and I read about the "OPTIMIZATION LEVELS' and their impacts on Joins. How do I get the Optimization level implemented here?...
2
by: db2admin | last post by:
hi, I have query which runs great when optimization level is changed to 3 but does not run fine with default optimization level of 5. since this is a query in java code, i do not know how can i...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...

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.