View, Table / Index Statistics Creation

This section provides details about the views, table/index statistics creation in RDBMS.

Views

The following command creates a view on an RDBMS stub file.

$  create-view CUSTOMER

This command does the following.

  1. Interrogates the stub file to determine whether it is schema based (long tag) or non-schema based (short tag).

    • For schema-based types, it reads in the CUSTOMER@XMLREF item from the Schemas file

    • For short tag it selects the dictionary file and builds a list of extended dictionaries, including those which refer the multi-value (or even sub-value) of another dictionary (LOCAL.REF I-types)

  2. Writes an SQL script to the current working directory

  3. Invokes the driver to read the SQL script and execute it on RDBMS

The following example shows CUSTOMER as a short tag.

$  create-view CUSTOMER
V_CUSTOMER generated
$

You can use the -v option to get a visual display of the SQL commands. Refer Appendix B and Appendix C for examples.

Each view includes the RECID as the first column and, by default, the XMLRECORD column as well. You can omit the XMLRECORD column from the view by using the -x option.

$  create-view -x CUSTOMER
V_CUSTOMER generated
$

The CREATE-VIEW command supports the following options:

Verbose

Description

-v

verbose

-m

include multi-value groups (not fully supported)

-x

don’t include the XMLRECORD column

-s

simple multi-value field representation (this may not be supported for all drivers)

Table / Index Statistics

It is a common misconception that to speed up a query you simply create an index on one or more of the columns (or expressions) used in the query and the next time the query is run it will be faster.

When a query is issued, the SQL parser needs statistics on the table (and its indices) to help determine which method will be the most efficient in producing the desired results. Just because an index is created it doesn’t mean it will be used.

After creating an index on a table, it is important to update the statistics. Note that if you plan on creating more than one index on a table you should preferably update the statistics after creating the last index.

Along with the create-extindex command, a new jBASE utility create-extstats is provided. The syntax is as follows.

create-extstats {-v} {-pn{<s>|b}} filename {index_name|dictionary_name}

The options in the above command are as follows.

Verbose

Description

-v

Verbose option to display more information on the command and/or errors.

-p

Percentage option where n is the percentage value. The method of calculating the percentage of rows to process can be s for System (the default) or b for Bernoulli.

NOTE: The s and b options are used only for the DB2 driver. Although the CREATE-EXTSTATS syntax includes the optional index_name /dictionary_name, it is not relevant for SQL Server.

The following are examples for the various drivers.


Bookmark Name Actions
Feedback
x