473,387 Members | 1,362 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,387 software developers and data experts.

Why OR extremely slows down the query?

I have a query, which takes about 4 seconds to execute
Expand|Select|Wrap|Line Numbers
  1. SELECT wq.nr
  2. FROM wq, wq_xml
  3. WHERE wq.nr = wq_xml.nr
  4. AND wq.type = 2
  5. AND SUBSTR(wq_xml.xml_data, POSSTR(SUBSTR(wq_xml.xml_data, 1, 200), 'bagmeGd=') IN ('41', '42', '43', '44', '45', '47')
  6. AND state = 91
If I change the last row to AND (state = 91 OR state = 93) it takes more than 10 minutes to execute. What is wrong with this query?
I have DB2 v.8.1.11.973 installed on Win XPSP2 machine
Sep 18 '07 #1
1 1117
docdiesel
297 Expert 100+
Hi Ovartomortes,

use the DB2 explain function ( http://publib.boulder.ibm.com/infoce...n/c0005135.htm ). It shows you graphically how DB2 is working on a statement, if/how it's using indexes, joining tables etc. It will show you the difference you're looking for.

You also might try "AND state in (91,93)" and see the influence.

Regards, Bernd
Sep 18 '07 #2

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

Similar topics

0
by: AM | last post by:
Hi, I use Xorg's XWin in rootless mode on cygwin on XP Pro for quite a bit of my work. Unfortunately it seems to slow down SQL Query Analyzer's UI terribly. If I exit out of X and/or kill it,...
5
by: Ken Brubaker | last post by:
Using DB2 8.1 FP5 on Win2000 After creating and configuring a new database, we stop db2 and start it again. We then launch our application and the SQLExecute calls start slowly and get...
2
by: Mrs Howl | last post by:
I have a query that just reads one table and appends to an output table, one-for-one. No criteria. It's not a Total query (i.e. no group by). It normally run run in minutes, but gets horribly...
6
by: Larry R Harrison Jr | last post by:
I have a database I'm designing in Access 97. I have a custom field in a query which looks in {Table of Documents} and shows them all. It then needs a "latest revision number," stored in another...
9
by: cow3 | last post by:
Is there anyone who can help me with this: I have written a fairly complicated vb application of hydrological model that does a lot of number crunching. The model creates a set of object...
1
by: Jose Walker | last post by:
Hi there, I've an ASP.NET 2 web application that I want to publish, but it happened that the application slows down in performance compared with the version managed by VS.NET 2005. When the...
0
by: Lars | last post by:
I am using Microsoft .NET (2.0) PrintPreviewDialog and all works well when the Windows default printer is set to a local printer or a network printer on a Windows server, but if I set it to a...
0
by: DV6 | last post by:
Hi, I'm creating a high preformance server which uses udp to query at least 100 servers continiously. The application is made in VS2005 using I/O Completion ports. In the beginning,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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...
0
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...

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.