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

SQL Optimizer - Picks different Logicals/Index when same job run twice in a row

I created an index in the exact order(18 Fields) called AD214X12.
The first time I submit the job it picks a different logical AD214L09 and performs miserably
Message . . . . : All access paths were considered for file AD214M01.
Cause . . . . . : The query optimizer considered all access paths built over
member AD214M01 of file AD214M01 in library EPLIB. The list below shows the
access paths considered. If file AD214M01 in library EPLIB is a logical file
then the access paths specified are actually built over member AD214M01 of
physical file AD214M01 in library EPLIB. Following each access path name in
the list is a reason code which explains how the optimizer considered the
access path. EPLIB/AD214L07 4, EPLIB/AD214L01 4, EPLIB/AD214L12 11,
EPLIB/AD214X12 4, EPLIB/AD214L08 4, EPLIB/AD214L09 0. The reason codes
and their meanings follow: 0 - The access path was used to implement the
query. 1 - Access path was not in a valid state. The system invalidated the
access path. 2 - Access path was not in a valid state. The user requested
that the access path be rebuilt. 3 - Access path is a temporary access path
(resides in library QTEMP) and was not specified as the file to be queried.
4 - The cost to use this access path, as determined by the optimizer, was
higher than the cost associated with the chosen access method. 5 - The keys


The second time I submit and third it pick my index AD214X12
Message . . . . : All access paths were considered for file AD214M01.
Cause . . . . . : The query optimizer considered all access paths built ove
member AD214M01 of file AD214M01 in library EPLIB. The list below shows the
access paths considered. If file AD214M01 in library EPLIB is a logical fil
then the access paths specified are actually built over member AD214M01 of
physical file AD214M01 in library EPLIB. Following each access path name in
the list is a reason code which explains how the optimizer considered the
access path. EPLIB/AD214L09 4, EPLIB/AD214L07 4, EPLIB/AD214L01 4,
EPLIB/AD214L12 11, EPLIB/AD214L08 4, EPLIB/AD214X12 0. The reason codes
and their meanings follow: 0 - The access path was used to implement the
query. 1 - Access path was not in a valid state. The system invalidated the
access path. 2 - Access path was not in a valid state. The user requested
that the access path be rebuilt. 3 - Access path is a temporary access path
(resides in library QTEMP) and was not specified as the file to be queried.
4 - The cost to use this access path, as determined by the optimizer, was
higher than the cost associated with the chosen access method. 5 - The keys

Any help would be appreciated. This file had 106 million records. When it picks my index it runs in a few minutes but when it picks the other logical it would take days as it's only keyed on two of the fields.
Jan 25 '19 #1
1 3562
Rabbit
12,516 Expert Mod 8TB
It would be helpful to see the actual query you're trying to run. We would just be guessing otherwise.

For example, one guess on my part could be that you're using a calculation somewhere that precludes the use of the index on the first run. But once that first run is completed and the results have been cached by the server, then it is able to combine the cache with the other index so it doesn't have to recalculate the formula.

But that's just one possible explanation and may not even apply to your situation.
Jan 25 '19 #2

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

Similar topics

3
by: DeadCert | last post by:
Hi, Could somebody explain if I can use CSS to have a menu item look different when I'm on the URL that matches the href of the link i.e. I have a menu: home - about - links A stylesheet is in...
14
by: Bupp Phillips | last post by:
I have a customer table that has the field CUSTOMER_ID as the primary key (cust_pkkey), the table has 102,834 records in it. The following select statement works fine: select * from customer...
5
by: Venkatesh Subbaramu | last post by:
Hi Expert DBAs, I am facing an issue with a query, can anyone help me through? I have a Query: UPDATE VMUS.MSG_MSTR a SET MSG_STA_ID =5 WHERE a.PROC_ID =2 AND a.file_type_id =1 AND MSG_STA_ID...
2
by: bobby_b_ | last post by:
I have a table where fields 1 and 2 make up the primary key. Because of this, I have a unique composite index on fields 1 and 2 (as required by DB2). Now my question is: Fields 1 and 2 are also...
6
by: RaulAbHK | last post by:
Dear all, I guess this is a basic question with an easy answer but I am a beginner and I would much apreciate your feedbacks. Let's say I have a library with some functionality to perform some...
1
by: jobs | last post by:
CommandArgument does not contain row index when command under Templatefield of- Gridview It appears CommandArgument passed to the rowcommand event does not contain row index when the command is...
12
by: dino d. | last post by:
hi everyone- my subject pretty much says it all- is there a secure way to do this? the non-secure ways are, as i understand it, to populate a listbox with indices as names, or maybe use a hidden...
8
by: John Salerno | last post by:
Hey all. I've decided I let my Python skills (minor though they were) slip away so I started reading the new edition of Learning Python to brush up. I just read about lists again and I'm wondering...
2
by: jackinnh | last post by:
When I save a database on a remote hard drive for backup purposes, the file on my C drive is larger than the file on the remote hard drive. The data seems to be the same. Why the different file...
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
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: 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
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...
0
tracyyun
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...
0
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,...

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.