<Snip>
I tried looking online for more information about how indexing occurs and
couldn't pinpoint it.
</Snip>
I believe the information you are looking for is available on page 55-57
of System i Database programming Version 6 Release 1 , available at
http://publib.boulder.ibm.com/infocenter/systems/scope/i5os/index.jsp
--> i5/OS PDF files and manuals
From what I gather, if the keys of the index being created in the new LF
are same as beginning portion of an existing access path, then the new
index will share the existing access path and system will not create a new
one.
For example, If an access path exists with an index over Fld 1, Fld & Fld3
in LF1 and you go ahead and create a new index(LF2) with keys Fld1 & Fld2,
then system will reuse existing access path and not create a new one.
But if the index-LF2 with Keys Fld 1 & Fld2 was already existing and you
created index LF1 with keys Fld 1, Fld2 & Fld 3 after that, then the
initial access path will not be destroyed but system will create a new
access path for the new LF.
The order of the records returned by LF2 may be different in the 2
scenarios.
It seems, It doesn't really matter if the access path being reused was
existing in a logical or physical file.
Thanks and Regards,
Rajesh Kumar
Analyst - Software Development
BACI Pvt Ltd
Kurt Anderson <kurt.anderson@xxxxxxxxxxxxxx>
Sent by: midrange-l-bounces@xxxxxxxxxxxx
03/27/2009 12:18 AM
Please respond to
Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
To
'Midrange Systems Technical Discussion' <midrange-l@xxxxxxxxxxxx>
cc
Subject
RE: To Key or Not To Key a Physical
Maybe an example will help.
I want two keys over a file:
Key1: FieldA, FieldB
Key2: FieldB, FieldA
Option 1 is to have an arrival sequence Physical and 2 Logicals.
Option 2 is to key the Physical (let's say Key1) and then make a Logical,
Key2.
I've always preferred Option 2 for the simple reason of: hey, 2 files
instead of 3; however I've been approached with the thought that Option2
will index over an index which would be less preferable to indexing over a
non-keyed Physical. Is this a valid concern?
Charles, you say that it's the general standard to always key the
Physical. I guess I'm looking for the reasoning behind that.
Thanks,
Kurt
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Charles Wilt
Sent: Thursday, March 26, 2009 1:21 PM
To: Midrange Systems Technical Discussion
Subject: Re: To Key or Not To Key a Physical
Huh?
If you create a logical with the same access path as the physical, the
logical will share the PF access path.
Now-a-days, the recomendation is to always define a primary (aka
unique, non-NULL) key for the physical.
Charles
On Thu, Mar 26, 2009 at 2:13 PM, Kurt Anderson
<kurt.anderson@xxxxxxxxxxxxxx> wrote:
If I'm going to have multiple logical files over a physical file, is it
better to not key the physical file or is there no implication if I do key
the physical file (and reduce the number of logicals needed by 1)?
I'm not that familiar with how indexing works, and the concern is that a
logical over a keyed physical will be indexing from an index.
Thoughts?
Thanks,
Kurt Anderson
Sr. Programmer/Analyst
CustomCall Data Systems
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.