Introduction to Index Support in the Vo2Ado RDD

<< Click to Display Table of Contents >>

Navigation:  The Vo2Ado RDD > Indexes >

Introduction to Index Support in the Vo2Ado RDD

Previous pageReturn to chapter overviewNext page

Of course every serious application will use indexes. Therefore we also support Index creation with the VO2ADO RDD.

This is an area where you may find some differences between VO2ADO and the standard RDDs.

When you analyze the use of indexes in your application you will see that indexes are used for two different purposes:

 

Displaying your data in a particular order

Locating records using the Seek functionality

 

The standard RDD files achieve this by reading all the records in a table and storing a list of record numbers and key value pairs in a structured way in a file on the local disk, together with the index expression that created the key values.

Since the key values are calculated on the local workstation any VO expression (including user defined functions) may be used to calculate the key values.

 

Problems

 

VO2ADO also implements indexes for both purposes, but has to handle some problems:

It is not feasible to store the record number-key value pairs on the local hard disk. Indexing should be handled by the server

Record numbers in general are not available in a SQL environment.

For that reason we can not use User Defined Functions in an index key expression, since these would not be available for the server

Most of the built-in functions of Clipper, such as SUBSTR(), LEFT(), RIGHT(), UPPER(), STR(), DTOS() are available on the server but have a different name or different parameters.

In a Client/Server environment you usually try to reduce the number of records that get send to the workstation. So it makes sense to use the Seek() functionality to limit the number of rows that get returned to the workstation

 

Solution

 

We have come up with the following solution:

When creating an index file we split the work between the client and the server:

The Client stores the index and order(tag) name on the local hard disk, together with the index expression

The Client asks the Server to create an index using the field(s) included in the index

When selection an order the client will generate an order by clause that gets sent to the server so the rows get returned in the proper order

When seeking a record, the client will generate a where clause, using the index expression, so the proper record(s) get(s) returned.

 

During this process the RDD has to parse the index expression, and to translate the VO functions used in the expression to functions supported by the server. Since this may be server specific, the RDD will call back into the client application for help with this translation process.