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

DB2 don't use an index

Hello,

I have a table with an index on PERNR. The table contains 350.000 rows,
349.000 of them PERNR is empty.
If I start a query "SELECT * FROM Mytable WHERE PERNR = '4711' DB2 don't use
the index and I wait 5 minutes for the result.

Is it possible to force DB2 to use the index?

Thanks in advance,

Reiner
Dec 17 '06 #1
1 1593
Reiner Wagner wrote:
Hello,

I have a table with an index on PERNR. The table contains 350.000 rows,
349.000 of them PERNR is empty.
If I start a query "SELECT * FROM Mytable WHERE PERNR = '4711' DB2 don't use
the index and I wait 5 minutes for the result.

Is it possible to force DB2 to use the index?

Thanks in advance,

Reiner
Thogh it may take heavy workload, how about run runstats with column
distribution?
RUNSTATS ON Mytable WITH DISTRIBUTION ON COLUMES (PERNR NUM_FREQVALUES
1000) AND INDEX <your-index>

Dec 17 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: lkrubner | last post by:
A friend using my software called me and said some templates were being reset to default when he submitted a form. I'm trying to track down the problem. It looks like when he assigns a template to...
303
by: mike420 | last post by:
In the context of LATEX, some Pythonista asked what the big successes of Lisp were. I think there were at least three *big* successes. a. orbitz.com web site uses Lisp for algorithms, etc. b....
1
by: Steve_CA | last post by:
Hi, The more I read, the more confused I'm getting ! (no wonder they say ignorance is bliss) I just got back from the bookstore and was flipping through some SQL Server Administration...
4
by: Gregor | last post by:
I am trying to use an image map with a mouseover function to show various DIV tags. I am not an expert, but what I've come up with works in IE but not in FireFox. Any insight would be greatly...
12
by: AFN | last post by:
I am running the code below to generate XML from a data table. But some fields in the data table are Null for every record. Suppose field5 has a null database value. I would expect to see: ...
2
by: Pavel Stehule | last post by:
Hello, Pg make query 1. and 2. very fast (use index), but for query 3. dont use index. I can solve its using select union, but I readed so pg 7.5 don't problem with OR operator. I use cvs pg. I...
17
by: =?Utf-8?B?Y2F0aGFyaW51cyB2YW4gZGVyIHdlcmY=?= | last post by:
Hello, I have build a website with approximately 30 html-pages. When I search this website in Google, I see the index.html or home.html on this website, but also other html-pages on this...
16
by: Tony Girgenti | last post by:
Hello. I just finished reading two articles about javascript here: http://msdn2.microsoft.com/en-us/library/bb332123(VS.80).aspx I tried some javascript testing in VS2005, SP1, VB , .NET 2.0,...
1
by: Jahamos | last post by:
Background: I have copy and pasted an Excel flowchart into a Dreamweaver html page. I created a frame on the top of the page as a viewer. I created hotspot links over the flowchart items. Each...
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:
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
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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.