build index from key field - IBM AS400

This is a discussion on build index from key field - IBM AS400 ; hi, I have (On AS/400) a physical file (with keyed access path )with a key field. How can i build an index from this field? (i need it for the SQLStatistics) Thank, Dror...

+ Reply to Thread
Results 1 to 8 of 8

Thread: build index from key field

  1. build index from key field

    hi,

    I have (On AS/400) a physical file (with keyed access path )with a key
    field.
    How can i build an index from this field?
    (i need it for the SQLStatistics)

    Thank,
    Dror


  2. Re: build index from key field

    On an AS/400 or i5 server, the key fields on the PF already ARE an
    index, and are used by the SQL engines.

    You can also create indexes by creating a LF, by using SQL CREATE
    INDEX. It supports both binary radix indexes as well as EVI (encoded
    vector indexes).

    Genarraly, stats are managed automatcially.


  3. Re: build index from key field

    Thanks for the reply but,
    I hav a bunch of physical files (i think they created by DDS) with key
    field but no index.
    I'm looking for the easiest/fastest way to convert these key fields to
    indexes.
    Thanks,
    Dror

    arrowcomputer@bigfoot.com wrote:
    > On an AS/400 or i5 server, the key fields on the PF already ARE an
    > index, and are used by the SQL engines.
    >
    > You can also create indexes by creating a LF, by using SQL CREATE
    > INDEX. It supports both binary radix indexes as well as EVI (encoded
    > vector indexes).
    >
    > Genarraly, stats are managed automatcially.



  4. Re: build index from key field

    Key field is an index. You don't have to do anything.

    D.R. wrote:
    > Thanks for the reply but,
    > I hav a bunch of physical files (i think they created by DDS) with key
    > field but no index.
    > I'm looking for the easiest/fastest way to convert these key fields to
    > indexes.
    > Thanks,
    > Dror
    >
    > arrowcomputer@bigfoot.com wrote:
    > > On an AS/400 or i5 server, the key fields on the PF already ARE an
    > > index, and are used by the SQL engines.
    > >
    > > You can also create indexes by creating a LF, by using SQL CREATE
    > > INDEX. It supports both binary radix indexes as well as EVI (encoded
    > > vector indexes).
    > >
    > > Genarraly, stats are managed automatcially.



  5. Re: build index from key field

    D.R. wrote:
    > Thanks for the reply but,
    > I hav a bunch of physical files (i think they created by DDS) with key
    > field but no index.
    > I'm looking for the easiest/fastest way to convert these key fields to
    > indexes.
    > Thanks,
    > Dror

    I agree that you don't really need it, to change a keyed phisical file
    to e sequence-only one, use sql statement CREATE INDEX specifying the
    key fields in the ON clause and change the DDS source deleting the K
    lines, use the command CHGPF specifying SRCFILE parameter.

    --
    Dr.Ugo Gagliardelli,Modena,ItalyCertifiedUindoscrasherAñe joAlcoolInside
    Spaccamaroni andate a cagare/Spammers not welcome/Spammers vão à merda
    Spamers iros a la mierda/Spamers allez vous faire foutre/Spammers loop
    schijten/Spammers macht Euch vom Acker/Spamerzy wypierdalac'

  6. Re: build index from key field


    I know this is old fashion but you can make logical files (Key - Index
    over physical file) if an index can not be done. Just So you know.


  7. Re: build index from key field

    Hi,
    I'm sorry but i am just a beginner in as/400 platform can anyone
    explain in simple steps
    what should i do for SQLStatistics (ODBC DB2 CLI) function recognize
    the key field as
    an index.
    I suspect that SQLStatistics dont recognize the key as an index because
    the key field is not under sysindexes tables.

    what is your advice?

    P.S. bare in mind that i have a bunch of these files, i cant really use
    SQL (create
    index) on every file...

    Thanks,
    Dror

    Roscoe wrote:
    > I know this is old fashion but you can make logical files (Key - Index
    > over physical file) if an index can not be done. Just So you know.



  8. Re: build index from key field

    D.R. wrote:
    > what should i do for SQLStatistics (ODBC DB2 CLI) function recognize
    > the key field as
    > an index.
    > I suspect that SQLStatistics dont recognize the key as an index because
    > the key field is not under sysindexes tables.
    >
    > P.S. bare in mind that i have a bunch of these files, i cant really use
    > SQL (create
    > index) on every file...



    Why not? I've never built SQL INDEXes over PF keys, so I don't actually
    know what would happen. But I'd certainly try one or two. I'd hope that
    the INDEX would share the existing access path and not really add
    anything to the system except an entry to the system catalog.

    Tom Liotta
    http://zap.to/tl400

+ Reply to Thread