Third-party Indexing [ HP ALLBASE/BRW Software Update Notice (A.01.50) ] MPE/iX 5.0 Documentation
HP ALLBASE/BRW Software Update Notice (A.01.50)
Third-party Indexing
As of MPE 4.0, HP supports a front end to third-party indexing (TPI) for
IMAGE databases. TPI extensions allow any field in any IMAGE database to
support keyed access. In addition, the generic and keyword styles of
keyed access provide greater flexibility in keyed reads compared to
IMAGE's hashed keyed access.
This supersedes the information on page 6-20 of the HP ALLBASE BRW
Reference Manual. Also, refer to pages 6-26 to 6-28 in the Reference
Manual for information on tuning reports that use keyed access.
Prior to this A.01.50 release, HP ALLBASE/BRW had limited transparent
support for generic TPI keys. With this release, when you request BRW to
compile a report, BRW generates an internal list of all selection
conditions applied against datasets accessed with a serial read (that is,
no KEY is specified in the Tune Access screen).
When the report is run, if the selection condition (itemname = ?PARM) is
a TPI key, the serial dataset read is dynamically converted into a TPI
keyed read.
Wildcard and Range Retrievals
Wildcard and range retrievals are available through Comparison Predicate
parameters. Composite items are supported by Parent/Child items or
SUBSTRING functions to specify components of standard IMAGE items that
make up the TPI composite item.
Keyword Retrievals
Keyword retrievals are available by using a new operator, the tilde (~).
For keyword retrievals on multiple fields, you use the ~ operator on two
or more parameter/itemname pairs.
Examples of TPI Keyword Retrievals.
The following examples show TPI keyword retrievals:
------------------------------------------------------------------------------------------
| |
| Selection Condition Parm Value Result |
| |
------------------------------------------------------------------------------------------
| |
| (ship-date SATISFIES ?dateparm) dateparm = 04/@/93 Return everything shipped |
| in April, 1993 (assumes |
| that dates are stored |
| internally as YYYYMMDD or |
| YYYY/MM/DD). |
| |
| (customer-name SATISFIES ?custparm) custparm ~smith or Keyword read of any |
| jones customer with last name |
| Smith or Jones. |
| |
| (SUBSTRING(order-no,1,3) SATISFIES parm1 = ABC,XYZ Assuming there is a |
| ?parm1) AND (SUBSTRING(prod-no,4,2) parm2 = UX,HP composite key of the |
| SATISFIES ?parm2) first 3 bytes of order-no |
| and the 4th and 5th bytes |
| of prod-no, BRW makes a |
| keyed read for values |
| ABCUX, ABCHP, XYZUX, and |
| XYZHP. |
| |
------------------------------------------------------------------------------------------
Checking forKeyed Reads
Checking for TPI keyed reads at runtime allows BRW to match the
flexibility inherent in TPI indexing. As TPI keys are added or deleted,
BRW continues to look for the best retrieval method. If no values are
given for Comparison Predicate parameters, or if the referenced items are
not TPI keys, then BRW reads the data set serially.
If the user authorizes BRW to look for TPI keys, but the referenced
itemname is not a TPI item, BRW also checks for simple IMAGE chain or
Calc items, assuming the parameter values do not use wildcards or range
retrievals. This can be helpful in cases where the report developer did
not explicitly tune the report.
To enable TPI keyed reads on all new reports:
1. Start BRWSETUP.
: BRWSETUP
2. Go to the Specification Values screen.
3. Place an X in the Enable Third Party Indexing field.
This screen is described on page 17-13 of the HP ALLBASE/BRW Reference
Manual for MPE/XL. The Enable Third Party Indexing field is new to this
screen.
To enable TPI keyed reads on a specific report
only:
1. Start BRW.
: BRWXL
2. Go to the Define Report screen.
3. Place an X in the Enable Third Party Indexing field.
To disable third-party indexing for a specific report, remove the X from
the field.
The Define Report screen is described on page 16-26 of the HP
ALLBASE/BRW Reference Manual for MPE/XL. The Enable Third Party
Indexing field is new to this screen.
RSPEC files with third-party indexing enabled are not usable by versions
of BRW/iX prior to A.01.50.
If you need to support a customer base of old and new versions of BRW,
you can set a JCW (BRWTPIENABLE) instead of using an X in the Enable
Third Party Indexing field. This allows you to build either a TPI or a
non-TPI version of the report without going back into the report to
change the field.
BRWTPIENABLE = 1 Builds a TPI version even if the Enable Third
Party Indexing field is blank.
BRWTPIENABLE = 0 For 0 or no JCW, BRW only enables third party
indexing if there is an X in the Enable Third
Party Indexing field.
Execution Statistics
The user can determine what, if any TPI generic or keyword reads were
used by BRW through information provided by the execution statistics that
are listed to the $STDLIST when the report is executed.
To print execution statistics:
1. Start BRWSETUP and go to the Execution Values screen.
2. Type an X in the Print Execution Statistics field.
When the report is run, the execution statistics are listed to $STDLIST.
This screen is described on page 17-7 of the HP ALLBASE/BRW Reference
Manual for MPE/XL. The screen has not changed, but the TPI generic or
keyword read information is a new part of the Execution Statistics
printout.
Examples ofExecution Statistics
If no TPI index was used for a particular dataset, the execution
statistics look like this example:
___________________________________________
| |
| read-dset serial CUSTOMERS,TOYDB.PUB|
___________________________________________
If a generic TPI key was used, BRW lists one or more itemname/parameter
pairs, like this:
___________________________________________
| |
| read-tpi generic CUSTOMERS,TOYDB.PUB|
| ZIPCODE = ?ZIPPARM |
___________________________________________
The item name will be the TPI key, which may not be the same name as the
associated IMAGE data item.
If several parameters are needed to match a TPI composite item, or if two
or more conditions involving child items are combined to make a parent
item key, then the execution statistics list the TPI key used, and one or
more parameters as shown in this example:
_______________________________________________
| |
| read-tpi generic COST-ACCOUNTS,GLSYS.PUB|
| COMP-L-ACCT = ?COMPANYPARM, |
| ?LEDGERPARM, |
| ?ACCOUNTPARM |
_______________________________________________
If the ~ operator is used to get a TPI keyword read, the execution
statistics will look like this example:
___________________________________________
| |
| read-tpi keyword CUSTOMERS,TOYDB.PUB|
| CUSTOMER-NAME ~ ?CUSTPARM |
___________________________________________
If more than one ~ keyword parameter is used, each itemname/parameter
pair is listed in the order that BRW applies the conditions.
MPE/iX 5.0 Documentation