JRI's Help page indexing data in UniVerse
Using native UniData indexing will greatly improve performance with SELECT statements.
However, they do come at a cost of notable disk space.
Older versions of UniData (which I think we use), store the absolute path to the file, so when doing a data refresh, you will need to delete and rebuild the index file(s).
Updating and using indexes also incures overhead on the system, so do not index fields causually - only do the ones that make sence.
Commands
For our purposes, there are 4 main commands. There are others, but they are not at critical as these four.For examples, the SOHDR file is used. LIST.INDEX filename [ALL]
This will show index info associated with the specified filename.
It's a good idea to take a look at this info as you work through index manipulation.
LIST.INDEX SOHDR ALLDELETE.INDEX filename [attribute1] [attribute2...] [ALL]
This command is used to delete indexes for filename. Using this command, a single index, multiple, indexes, or all indexes for filename can be deleted.
When doing a data refresh, this should always be done since the index file itself is tied (internally) to the original file (in LIVE).
DELETE.INDEX SOHDR ALLCREATE.INDEX filename [attribute1] [attribute2...] [NO.NULLS]
This command is used to create the indexes for filename, but not populate the index file.
Using this command, a single index or multiple indexes can be built for filename.
Always use the NO.NULLS option so that null values are not indexed.
CREATE.INDEX SOHDR BILL.CNO SHIP.CNO ALT.BILL.TO NO.NULLSBUILD.INDEX filename [attribute1] [attribute2...] [ALL]
This command is used to POPULATE the indexes for filename.
This will take some time to do, but once done, the indexes will automatically be updated via UniData.
One of the nice features about indexes is that it will work for any Dict item for a given field. For example, if the SOHDR file has an index on BILL.CNO (which is field 2), the index will work for any SOHDR Dict for field 2.
BUILD.INDEX SOHDR ALLDetermine Index File Size
When an index file is initially created, UniData will build a Unix file called: X_filename.
Even empty, this file takes up a bit of space (about 20k?).
As the index file gets populated, it will grow suprisingly fast.
To see its size as well as the size of its parent file, run the following Unix command:
ll | grep SOHDR