An index makes access to groups of data very quick. One
creates (and
builds) an index on a field that is sorted on (BY...), or
selected (WITH
X = "").

Without an index, every process looking for specific records
has to
process the entire file searching each record to see if the
criteria
exist (even if you didn't realise it, that is what a SELECT
is doing)

With an index, a process merely extracts a defined list of
data (defined
to meet that criteria beforehand and updated each time data
changes in
those criteria) and searches that - a much much quicker
exercise.
------------------------------------------------------------
------------
-----------
An index is effectively a file that has the
                     (data you're looking for)

                       referenced against the

             (key to the DATAFILE record containing that
data)

Eg
      you want customer         SMITH,
        the index contains      SMATH,SMETH,SMITH,SMOTH,SMUTH
                                        00123,00168,00101,02111,11111
      the index returns         00101
        which is the key to the CUSTOMER whose name is SMITH
------------------------------------------------------------
------------
-----------
LIST.INDEX {filename} ALL
Gives you a synopsis of the indexes that have already been
created on a
file.

Example:
LIST.INDEX IN.MASTER ALL

Alternate Key Index Summary for file IN.MASTER
File........... IN.MASTER
Indices........ 3 (3 A-type, 0 C-type, 0 D-type, 0 I-type, 0
SQL, 0
S-type)
Index Updates.. Enabled, No updates pending

Index name      Type  Build    Nulls  In DICT  S/M  Just
Unique Field
num/I-type
SHORT.DESC       A    Required  Yes    Yes      M    L     N
59
SUPPLIER         A    Not Reqd  Yes    Yes      M    L     N
20
PL               A    Not Reqd  Yes    Yes      M    L     N
31


This tells you that
        (1) there are 3 indices on IN.MASTER
        (2) all three are A-type (ie they are actual data fields,
not
symbolic)
        (3) all transactions at the point of the LIST.INDEX were
posted
(not pending)
        (4) the indexes are on fields SHORT.DESC, SUPPLIER and PL
        (5) fields SUPPLIER and PL have had their indexes built
        (6) the index on field SHORT.DESC requires to be built

------------------------------------------------------------
------------
-----------
SET.INDEX IN.MASTER INFORM
Indices for file "IN.MASTER" reside in
"E:/ACCOUNTS/HYFLO/IN.MASTER/I_IN.MASTER"

This tells you that the operating system path to file
containing the
indexes that have been built on IN.MASTER are to be found at
         "E:/ACCOUNTS/HYFLO/IN.MASTER/I_IN.MASTER"
------------------------------------------------------------
------------
-----------
CREATE.INDEX IN.MASTER CUSTOMER
BUILD.INDEX IN.MASTER CUSTOMER

Creating an index of a file in UniVerse is a two stage
affair:
        (1) Build the structure of the index (CREATE.INDEX)
        (2) Populate the structure with data (BUILD.INDEX)

CREATE.INDEX
To tell the machine to maintain an index on a field, one
needs to CREATE
the index. Effectively this sets up the structure of the
index, but
doesn't actually process the file to extract the indexed
data itself.

BUILD.INDEX
Processes the data extracting whatever portion is required,
and updates
the index.
Hint: when building indexes put DET.SUP at the end of the
BUILD.INDEX
command line to prevent those lines of asterisks that take
up so much
time displaying!
------------------------------------------------------------
------------
-----------
DISABLE.INDEX
Use this to stop future updates of an index, without
removing existing
indexed information. Useful for running batch runs against a
file where
speed is the issue (normally overnight when there's little
processing
going on). You simply disable the index, run the batch job,
then UPDATE
the index afterwards.

UPDATE.INDEX
Used to update an index with all the transactions that have
occurred on
that index since it was disabled.
------------------------------------------------------------
------------
-----------
DELETE.INDEX
Should you decide you'll never use an index that has already
been
created on a file, you can delete it. By doing this you are
informing
the system not to maintain a watch on all transactions on
that file
regarding that field.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Amit Bhutani
Sent: 19 May 2004 11:41
To: [EMAIL PROTECTED]
Subject: [U2] Need Help on INDEX in universe


Hi group,

Can any body let me know about the INDEX, y to use it and
what are the
benefits of using it. What is the importance of LIST.INDEX,
SET.INDEX,
CREATE.INDEX, BUILD.INDEX, DISABLE.INDEX commands. I think
they are to
speed up the search.

Please reply me asap. Need urgent and detailed answer..
Thanks
Amit
-------
u2-users mailing list
[EMAIL PROTECTED]
http://www.u2ug.org/listinfo/u2-users
-------
u2-users mailing list
[EMAIL PROTECTED]
http://www.u2ug.org/listinfo/u2-users

Reply via email to