HPlogo Communicator 3000 MPE/iX Release 6.0 (Platform Software Release C.60.00): HP 3000 MPE/iX Computer Systems > Chapter 10 Technical Articles

IMAGE/SQL with TurboIMAGE/XL Enhancements

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

by IMAGE/SQL Team Commercial Systems Division

Overview

This article discusses enhancements as well as other important information commencing with the Express 3 release of MPE/iX 5.5. Express 3 (and later releases) also includes the revised editions of some selected manuals.

Highlights

Highlights of this release of IMAGE/SQL, version B.G3.00 or later, and TurboIMAGE/XL, version C.07.14 or later, are the following:

  • Dynamic data set expansion for master sets (MDX or DDXM)

  • Performance enhancement for databases with third-party indices

  • 80 GB data sets

  • Predicate locks when updating manual masters

  • DBSCHEMA and P type with odd sub-item length

  • B-Tree indices enhancement

  • New 16-bit and 32-bit ODBC driver, ODBCLink/SE, bundled with IMAGE/SQL

  • Support for third-party composite indices in IMAGE/SQL

  • Scalability for DBPUT, DBDELETE, and DBUPDATE (CIU on)

  • Dynamic detail data set expansion (DDX) fix

Manuals Bundled with IMAGE/SQL

The following manuals are included with IMAGE/SQL:

  • HP IMAGE/SQL Administration Guide

  • Getting Started With HP IMAGE/SQL

  • TurboIMAGE/XL Database Management System Reference Manual
    (Revised August 1997)

  • ALLBASE/SQL Database Administration Guide

  • ALLBASE/SQL Reference Manual (36216-90001)

  • ALLBASE/SQL Message Manual

  • ALLBASE/SQL Performance and Monitoring Guidelines

  • ISQL Reference Manual for ALLBASE/SQL and IMAGE/SQL

  • ODBCLink/SE Reference Manual

Updating IMAGE/SQL

If you are updating from an earlier release of IMAGE/SQL and you have databases which are already ATTACHed to one or more DBEnvironments, you must DETACH and ATTACH again in order to benefit from the enhancements. Also, it is recommended that you issue the UPDATE STATISTICS command of ISQL for each of the tables you access frequently. This may enable you to attain performance improvement.

Furthermore, if you have created SQL data using an earlier release of IMAGE/SQL and are now updating to a latter release, you must perform the ALLBASE/SQL migration using SQLINSTL or SQLMigrate. For more information, refer to the ALLBASE/SQL Database Administration Guide and the Read Before Installing for this release.

TurboIMAGE/XL Enhancements

The following are TurboIMAGE/XL enhancements, independent of SQL access:

  • Dynamic data set expansion for masters (MDX or DDXM)

  • 80 GB data sets

  • Performance Enhancement for databases with third-party indices

  • DBSCHEMA and P type with odd sub-item length

  • B-Tree indices

  • Scalability for DBPUT, DBDELETE, and DBUPDATE (CIU on)

Dynamic Data Set Expansion for Masters

Dynamic data set expansion feature for non-jumbo (file size within 4 GB limit) detail data sets (DDX) was first released in MPE/iX 5.0. With this release, this feature is available for non-jumbo master data sets (MDX or DDXM) as well. The feature allows dynamic expansion of a data set during DBPUT when the data set has approximated its current capacity and DBPUT would fail unless the data set is expanded. As in DDX, the capacity parameters which are maximum capacity, initial capacity, and increment (optional), used for dynamic expansion, must be set prior to the actual expansion. For new databases, these parameters can be specified in the CAPACITY statement of the schema definition to be processed by DBSCHEMA. For existing databases, third-party tools which support MDX need to be employed.

The capacity parameters are:

  • maximum capacity

    is a required parameter and is a maximum number of entries the data set can contain. It must be less than or equal to 231-1 (2,147,483,647). The maximum capacity is adjusted by TurboIMAGE/XL to represent a multiple of the blocking factor.

  • initial capacity

    is a required parameter and is the initial, primary, or hashing capacity for the data set. It is the number of entries for which space will be allocated and initialized when the data set is created. More importantly, the initial capacity, and not the current capacity (initial capacity with expansions included), will be used in the hashing algorithm to calculate the primary address of the new entry being added. If initial capacity is very low, there can be frequent expansions which could result into both long synonym chains which degrade the performance of some TurboIMAGE intrinsics and disk fragmentation. Therefore, this number should be derived after giving consideration to the expected volume of current data, anticipated growth, and synonym chain lengths. It should be such that a minimum number of expansions are necessitated. The initial capacity must be between 1 and 231 -1 inclusive but must be less than or equal to the maximum capacity. If it is not specified, or if it is either zero or equal to the maximum capacity, dynamic capacity expansion is not enabled for the data set, and maximum capacity is used for the data set file creation and primary address calculation. The initial capacity is adjusted to represent a multiple of the blocking factor.

  • increment

    is an optional parameter and is either the number of entries or the percentage of the initial capacity by which the data set needs to be expanded each time. If a percentage is used, the percent sign (%) must follow the incremental amount. The increment is adjusted (reduced) for the last expansion so that it does not exceed the maximum capacity. This increment parameter can only be used if a valid initial capacity parameter is also specified. This number must be 1 to 100 inclusive for percent, or 1 to 231 -1 (2,147,483,647) inclusive for number of entries. If it is very low, there can be frequent expansions leading to severe disk fragmentation and performance degradation. If it is very high, DBPUT that triggers the expansion may take long time to complete which could impact other database users.

    If the increment is not specified for the data set, or is zero, but the initial capacity is greater than zero and not equal to the maximum capacity, the increment for each expansion defaults to ten percent (10%) of the initial capacity for the data set. If the initial capacity is equal to the maximum capacity, or the initial capacity is zero, it indicates that the data set cannot be expanded and increment is ignored.

The enhanced syntax for the CAPACITY statement of DBSCHEMA is same for both DDX and MDX, and is as follows:

{CAPACITY: | C:} maximum capacity [(blocking factor)] 
[,initial capacity [,increment]];

Dynamic Expansion and Placement of a New Entry

The instant when the expansion is triggered and how record address is assigned to the new entry in a master data set varies greatly from detail data set. In a detail data set, expansion takes place during DBPUT when the free entry count for the set is zero. In case of a master data set, expansion is triggered during DBPUT when there is no free (unoccupied) entry in the close proximity (within an internally-maintained number of blocks) of the calculated primary address of the new entry and the set is expandable. This means that an expansion takes place even when the free entry count is greater than zero.

Following the first expansion, the master data set can be perceived as having two areas, original area and expanded area, managed differently. The original area is managed in the same way as in releases prior to MDX, that is, the primary address for the new entry is calculated using the hashing algorithm and the secondary address is assigned according to the availability of the free entry, but with modifications in searching for a free entry. The use of the expanded area is controlled using the pointer to a delete chain head and the last entry used in the file (high-water mark) as in detail data sets. Subsequent expansions belong to the expanded area. The original area can have primary entries and secondary entries, while the expanded area can only have the secondary entries. Note that the primary capacity (also hashing or initial capacity) used to calculate the primary address does not change. In essence, the dynamic expansion results in allocating additional space for secondary entries which implicitly makes room for additional primary entries in the original area. The primary address of a new entry is calculated using the value of the entry's key item and primary capacity in the hashing algorithm. The new entry can reside either at its primary address in the original area, or in the close vicinity of the primary address in the original area, or in the expanded area.

To elaborate further, when a DBPUT for a manual master, or implied DBPUT to an automatic master, is processed, the address where the new entry resides is based on the following:

  1. If the primary address in the original area is not occupied, the new entry resides there. The new entry also becomes a synonym chain head with a count of one.

  2. If the primary address is already occupied by a primary entry which hashed to the same address, TurboIMAGE/XL scans a few blocks (predetermined based on internal values, also known as quick search) in the close proximity of the primary address to find a free entry (empty entry). If found, the new entry resides at this secondary address in the original area. Otherwise, search for a free entry is directed towards the expansion area. At this point, if the set has not been expanded at all and can be expanded, expansion will take place and the new entry will reside at the first entry address in the new expanded area.

    If prior expansion has already taken place, the pointer to the delete chain head and the last entry used in the file for the expansion area are interrogated to determine the secondary address in the expansion area for the new entry. When there is room, the new entry is assigned a secondary address in the expanded area, and the new entry becomes the last entry in the synonym chain. If the expanded area is full and can be expanded, it is further expanded to accommodate the new entry.

    When there is no room in the expanded area and cannot be expanded further, however, there is room in the original area based on the free entry count, the original area is scanned once again (long search) to find a secondary address for the new entry. If a free entry is found, the new entry resides there, and it becomes the last entry in the synonym chain. Otherwise, the set is full and DBPUT will fail.

  3. If the primary address is occupied by a secondary entry, the secondary entry is relocated to another secondary address in either the original area or the expansion area. A free entry is searched as described in item 2 above. The new entry (primary) becomes a synonym chain head with a count of one. TurboIMAGE/XL performs synonym chain maintenance for the secondary entry which relocates.

Following the expansion, TurboIMAGE/XL updates various fields related to the expansion such as current capacity, including the expansion, in the root file. Also, the data set user label is updated for the last entry used in the file (high-water mark), free entry count, and pointer to the put-delete chain head.

Intrinsics and utilities

The following intrinsics and utilities are enhanced to support MDX:

  • DBINFO modes 205 and 208 (new for MDX) give detailed information pertaining to dynamic expansion. The buffer layout for mode 205 remains the same as that of DDX except that it is relevant to MDX. The buffer layout for new DBINFO mode 208 is in the following table.

    Buffer

    must be at least a 64-byte record and returns the following (each element is a 32-bit word):

    Element

    Contents

    1

    Primary (hashing) capacity for masters, 0 for details

    2

    Current capacity, including expansions

    3

    Maximum capacity

    4

    Expansion threshold:

    -1 ... 100 percentage

    -1 this value means expansion is not triggered by percentage, or it is a non-expandable set.

    5

    Delete chain free head (0 for non-expanded masters)

    6

    High-water mark (0 for non-expanded masters)

    7

    Expansion threshold:

    -1 ... 2 billion blocks

    -1 this value means expansion not triggered by traversing 3 blocks without success, or it is a non-expandable set.

    8...16

    Reserved; 0 is returned

    DBINFO mode 208 returns information about internals which will be meaningful to only a few customers.

  • DBUTIL SHOW database ALL command shows the presence of MDX. The SHOW database CAPACITY command gives detailed information pertaining to capacity parameters and identifies sets enabled for dynamic expansion.

    For more information, refer to the sixth edition of the TurboIMAGE/XL Database Management System Reference Manual.

NOTE: Select master data sets which need dynamic expansion based on anticipated growth and specify the capacity parameters (in particular the initial capacity) very carefully. Specifying low initial (primary/hashing) capacity and increment leading to frequent expansions may result into long synonym chains, which degrade the performance of some TurboIMAGE intrinsics, and disk fragmentation. Select initial capacity such that expansions will be minimal.

80 GB Data Sets

TurboIMAGE/XL version C.07.14 includes an enhancement which will allow jumbo data sets to be up to 80 GB in size, twice as big as the old limit. There are no new externals/options added for this enhancement. For new databases, DBSCHEMA will allow data sets to be up to 80 GB in size. As for jumbo data sets, the control option '$CONTROL JUMBO' is required prior to specifying a data set greater than the default of 4 GB. For existing databases, use third-party tools which support this feature. If you use third-party indexing software, you may need the version of the software which supports this feature.

When creating a jumbo data set of this magnitude using DBUTIL, you will experience some delay.

Performance Enhancement for Databases with Third-party Indices (TPI)

TurboIMAGE/XL intrinsics DBGET and DBFIND are enhanced for improved performance in the following circumstances when the database is enabled for TPI:

  • DBFIND and DBGET when the set does not have TPI and the trace facility, if applicable, is turned off.

  • Serial DBGET (modes 2 and 3) for a set with TPI when the mode need not be promoted to other mode (possibly a chained mode) by the third-party software.

  • Chained DBGET (modes 5 and 6) for a DBFIND of an IMAGE search item or a B-Tree item for a set with TPI.

In order to attain the performance gain, you must obtain the version of the third-party software which supports this enhancement. In the absence of either one of the needed software products (TurboIMAGE/XL or third-party product), DBFIND and DBGET will continue to work as they do in the absence of this enhancement. That is, TurboIMAGE/XL and the third-party products are backward compatible for this enhancement.

DBSCHEMA and P Type with Odd Sub-Item Length

DBSCHEMA is enhanced to generate an error when the sub-item length of the datatype P is odd, even if the product of sub-item count and sub-item length is divisible by 4. For example, DBSCHEMA will flag the data items 4P1 or 8P3 as invalid. Although syntactically correct, none of the major languages can use them. This change will not affect existing databases. That is, if you currently have databases with P type defined using odd sub-item length and sub-item count such that their product is divisible by 4, you may continue to use it without any problem when creating a new database. The default for DBSCHEMA is to generate an error in this situation. If you want to create a new database with P data type having odd sub-item length, you will need to use the new CONTROL option, $CONTROL ODDPALLOWED.

B-Tree Indices

You can create a B-Tree index on the master data set's key item and perform B-Tree index searches using the key item as well as all of its corresponding detail data set search items. The B-Tree index searches are done using DBFIND with a master or detail data set and its key or search item respectively. The qualified entries can be retrieved using DBGET mode 5 or 6.

Key Features of B-Tree Indices

Following are key features of B-Tree indices:

  1. B-Tree index can be created only on the key item of the master data set.

  2. B-Tree searches using the search items of all of its corresponding detail paths can be done.

  3. You may create B-Tree indices for zero, one, or more master data sets.

  4. DBSCHEMA has a new option, INDEXED, for the SET specification.

    New syntax

    NAME:setname,{M[ANUAL] | A[UTOMATIC]}[/INDEXED]
    [(read class list)/(write class list)][,device class];
  5. DBUTIL has new commands and options.

    • New ADDINDEX, DROPINDEX, and REBUILDINDEX commands (to be used for one, more than one, or all masters).

      Syntax

      {ADDI[NDEX] | DROPI[NDEX] | REBUILDI[NDEX]} 
      database name[/maintword] FOR {ALL | setnamelist | setnumlist}

      Parameters

      setnamelist

      is the list setname[,...]

      setnumlist

      is the list setnum[,...]

      ALL

      means all master data sets for the database.

    • The SET command has a new BTREEMODE1 option to set DBFIND mode 1 access ON or OFF for a B-Tree wildcard search for X and U types. The default is OFF. The ON setting allows you to use B-Tree indices for generic search without making application changes. Also, it allows you to define your own database-wide wildcard character.

      New Syntax

      SET database name[/maintword]
      BTREEMODE1={ON | OFF}[,[WILDCARD=]c]

      where c is any printable ASCII character, and the default character is @.

    • The SHOW command has a new INDEX, INDEXES, or INDICES option.

      New Syntax

      SHOW database name[/maintword]
      {INDEX | INDEXES| INDICES}
    • CREATE, ERASE, PURGE, SECURE, RELEASE, and SHOW commands include B-Tree index files in their operation.

    • The MOVE command does not allow moving the index file.

  6. DBCONTROL has these modes pertaining to B-Tree indices:

    13

    is for B-Tree index file control. That is, to ADD, DROP, REBUILD, ATTACH, or DETACH a B-Tree index file. This mode requires PRIVILEGED mode, and hence, must be used carefully as improper use may damage your system.

    14

    is used to obtain and control database-wide B-Tree information. This mode requires PRIVILEGED mode, and hence, must be used carefully as improper use may damage your system.

    15

    sets BTREEMODE1 ON, and optionally allows the wildcard character to be set for the current DBOPEN.

    16

    sets BTREEMODE1 OFF for the current DBOPEN.

  7. DBINFO has these modes pertaining to B-Tree indices:

    209

    informs whether or not a B-Tree index exists for a master.

    113

    gives BTREEMODE1 setting and the wildcard character for the database as well as current DBOPEN.

  8. DBFIND has these features pertaining to B-Tree indices:

    • Can be used for details as well as masters to specify B-Tree index searches.

    • Introduces a new fixed-format structured argument.

    • DBFIND modes with added functionality pertaining to B-Tree indices:

    1

    can continue to work as it does in releases prior to the release of B-Tree index feature (C.07.00), despite the presence of a B-Tree index, or it can be used for a B-Tree search if BTREEMODE1 is ON. Uses the classic mode 1 argument format.

    4

    used for B-Tree index searches on numeric as well as ASCII types and, for details, it returns accurate chain (super-chain, that is, multiple qualified chains) counts. Requires a new structured argument.

    10

    allows you to simulate DBFIND mode 1 as if there were no B-Tree index. This is the same as TPI mode 10. Requires the classic mode 1 argument format.

    21

    is the same as B-Tree index search using DBFIND mode 1, except it is a faster version and does not return accurate chain counts. Requires the classic mode 1 argument format.

    24

    is the same as B-Tree index search using DBFIND mode 4, except it is a faster version and does not return accurate chain counts. Requires a new structured argument.

    Allows wildcard search, as well as range search (<, <=, >, >=,"PK" for partial key, or [] for between).

  9. DBGET modes 5 and 6 can be used for B-Tree index retrieval for masters or details. Super-chains are traversed for detail data sets.

  10. KSAM/iX files are used for B-Tree index files. These are KSAM related key points:

    • There is one KSAM/iX privileged file with a filecode of -412 for each B-Tree index file. The size limit for this B-Tree index file is 4 GB. A jumbo master (larger than 4 GB) can have a B-Tree index file provided the B-Tree index file remains within its 4 GB limit.

    • KSAM/iX B-Tree index file is named using the POSIX file format with the "idx" extension (lowercase). For example:

      /ACTSALES/GRPSALES/ORDERS03.idx
    • The KSAM file has the Native Language Support language specified to match the language of the database, if the key is an ASCII type.

  11. Third-party index can coexist with B-Tree index, that is, on the same item of the data set.

Quick Start for Using B-Tree Indices

If you are interested in generic trailing-@ searches only and want to get started quickly without making any application changes, you may use the following steps.

  1. Identify the masters with ASCII key item that can benefit from B-Tree indices.

  2. Create B-Tree indices using either of these methods:

    1. Use the INDEXED option of DBSCHEMA for new databases.

    2. Use the ADDINDEX command of DBUTIL for existing databases.

  3. Set the BTREEMODE1 option ON using DBUTIL as follows:

    :Run DBUTIL.PUB.SYS

    >SET database name [/maintword] BTREEMODE1=ON

If your database is new, you will need to add data. You are now ready to perform B-Tree index searches. You can include the wildcard character in your DBFIND argument and observe the results.

Scalability

Prior to this enhancement, the modification intrinsics, DBPUT, DBDELETE, and DBUPDATE (Critical Item Update feature ON) were serialized for the database. That is, only one such intrinsic could execute at a time for the database. In order to scale with the high-end machines, TurboIMAGE/XL is enhanced to increase the concurrency of these modification intrinsics.

The increased concurrency is based strictly on the database design. The database is internally grouped into independent SUB-DATABASES based on the physical relationships of master and detail data sets. Subsequently, the modification intrinsics can execute concurrently for these independent subdatabases. The throughput is dependent on the number of subdatabases, the more the better. The worst case is a database with only one subdatabase, one detail linked to 16 masters. The best case is when there are numerous stand-alone masters or details.

To use this enhancement, your database must be activated to use the Dependency Semaphore. To achieve this, the ENABLE and DISABLE commands of DBUTIL introduce a new option, DSEM. The default for DSEM is DISABLED.

New syntax

EN[ABLE] database name[/maintword] FOR DSEM
DI[SABLE] database name[/maintword] FOR DSEM

After enabling your database for DSEM, if you feel that your database design cannot attain expected concurrency, you may DISABLE the feature as there is some overhead when the database is enabled for DSEM.

Dynamic Detail Dataset Expansion (DDX) Fix

(SR# 5003-367607)

The DDX feature of TurboIMAGE/XL has a known problem which may cause you to lose some of your new data entries added following the dynamic detail dataset expansion. This defect has been in the feature since its introduction, but has surfaced recently and has been reported by a few customers. The problem has been fixed both for MPE/iX 5.5 and MPE/iX 6.0. The patch ID for MPE/iX 6.0 is TIXKX62 (or superseded patch id) and the TurboIMAGE/XL version is C.07.10. This patch is contained in this release.

Problem Description

The problem is that, following a dynamic expansion, the addition of the new data entries (DBPUTs), which exceed the INCREMENT in number, are written to the data set beyond the physical end-of-file (MPE EOF). When the database is closed and reopened, those new entries exceeding the INCREMENT are inaccessible. If a program attempts to read that data or add more data entries in that area, it gets an error -212, Database is Corrupt. The following diagram illustrates the problem.

|          |
| |
| |
| |
|----------|-----> Old MPE EOF as well as IMAGE EOF (e.g., 1)
| |
|INCREMENT | New MPE EOF (e.g., 51) after expansion by
|----------|-----> INCREMENT equivalent to 50 MPE records.
| |-----> New entries placed from this point on are lost.
| |
|----------|-----> New IMAGE EOF (e.g., 101) as calculated by the
adjustment to CAPACITY of set, following the
expansion.

The real problem is that, for certain expansions, the new CAPACITY is inadvertently adjusted by adding the INCREMENT more than once instead of adjusting only once. This results in incorrect calculation of IMAGE EOF and subsequently allows new data entries to be placed in the area which really does not belong to the data set file. Therefore, when the data set is closed, the new entries added beyond the MPE EOF are not retained as part of the data set file by the MPE file system and are subsequently lost.

The circumstances in which such an erroneous adjustment could take place are as follows:

  • While an actual DDX is being performed by DBPUT for one process, a second process (user) accessing the same data set for the first time causes execution of IMAGE's open data set module. In a narrow timing window, the result will be incorrect extraneous adjustment of the CAPACITY by adding the INCREMENT! Specifically, the CAPACITY has been incremented twice, while the MPE EOF has been correctly incremented—only once.

How to tell if you already have this problem. If you use DDX, check each detail data set enabled for DDX. Remember, the problem is associated only with the detail data sets which have undergone dynamic expansion.

You can check for this condition as follows:

  1. Use the FORM SETS command of QUERY, which gives the Current Capacity (CC) and Blocking Factor (BF) of each data set.

    :query
    HP32216D.03.11 QUERY/3000 TUE, NOV 4, 1997, 3:20 PM
    COPYRIGHT HEWLETT-PACKARD CO. 1976

    >b=dbusa PASSWORD = >>
    MODE = >>1
    >form sets

    DATA BASE: DBUSA TUE, NOV 4, 1997, 3:20 PM

    DATA BASE LANGUAGE ATTRIBUTE: NATIVE-3000

    ITEM CURRENT ENTRY ENTRY BLOCKING
    SETS: TYPE COUNT CAPACITY COUNT LENGTH FACTOR

    PEPU01 D 3 1010 11 12 10
  2. Calculate the IMAGE EOF of a DDX data set using the following formula:

    (CC + (BF-1))/BF

    For example:

    IMAGE EOF = (1010 + (10-1))/10 = 101
  3. Verify this calculated EOF with the MPE EOF given by the command :LISTF dbnamenn,2 where dbnamenn is the file name of that DDX data set.

    :listf dbusa01,2

    ACCOUNT= TESTACCT GROUP= DDX

    FILENAME CODE -----------LOGICAL RECORD----------- ----SPACE----
    SIZE TYP EOF LIMIT R/B SECTORS #X MX

    DBUSA01 PRIV 256W FB 51 200 1 112 2 4
  4. If the two EOFs do not match, there is a problem.

    In the example, MPE EOF of 51 and IMAGE EOF of 101 do not match—the problem exists.

    The SHOW DBUSA CAPACITY command of DBUTIL gives capacity parms:

                       No. of  %Max -----------Capacity------------- Dyn
    Data Set Name Type Entries Cap Maximum Current Initial Increment Exp:

    PEPU01 D 11 1 2000 1010 10 500 YES

    Based on the above formula for calculating MPE records, the initial capacity was 1 MPE record ( (10+9)/10), and the increment was 50 MPE records ( (500+9)/10). The correct physical EOF should be 51 (1+50). However, IMAGE EOF as shown by QUERY is 101 (1+50+50). This establishes that the IMAGE EOF was adjusted twice.

If you use one of the IMAGE/SQL structure maintenance tools (such as Adager, DBCPLUS, or DBGENERAL), it may have the capability to locate instances of this problem, and if you discover that one of your data sets is so afflicted, it may be possible to correct the problem using the same tool. (See the documentation for your tool.)

How to avoid experiencing this problem on your IMAGE database. The simplest answer is to install and use the TurboIMAGE/XL patch mentioned above. This is the option that HP recommends.

However, if you are unable to acquire and install the patch immediately, consider the following alternative:

  • Until you install the patch, avoid opening a data set from one process while another is expanding it!

Here are some ways you might accomplish this; each way is independent of the others:

  1. Preallocate and pre-expand DDX data sets which are nearly-full by adding, in exclusive mode, many new dummy entries. Add more than your actual processing will add. Then delete them before your real processing begins.

  2. Open all DDX-enabled data sets needed from each process which accesses them before allowing any process to add data to any of these sets.

  3. Access the database exclusively, if possible, until the expansion has completed.

  4. Disable DDX on any nearly-full data set, using an HP or third-party tool.

Important Information

  1. The default for Critical Item Update option was changed from DISALLOWED to ALLOWED starting with Express 3 for 5.5.

  2. A jumbo data set cannot be enabled for dynamic expansion.

  3. PURGE and ERASE commands of DBUTIL are enhanced to prompt the user in session mode only (not batch) for confirmation (starting with version C.07.07).

  4. If you want the TPI performance enhancement, you also need to get the third-party indexing software which supports this enhancement.

IMAGE/SQL Enhancements

Information regarding enhancements to IMAGE/SQL for SQL access is described in this section:

  • Predicate level lock when updating masters

  • Support for B-Tree indices

  • Support for third-party composite indices

  • New ODBC driver, ODBCLink/SE

Predicate Locks when Updating Manual Masters

IMAGE/SQL version B.G2.07 is enhanced to apply predicate level locks (row level locks), instead of a set level lock as in prior versions, when updating selected entries in the manual master data set.

When IMAGE/SQL is used as the SQL interface to TurboIMAGE/XL database, the responsibility of enforcing appropriate locks rests with IMAGE/SQL. These locks should conform to the locking schemes present in TurboIMAGE/XL. Accordingly, locks are set by IMAGE/SQL depending on the DBOPEN modes and isolation level requirements. At present, for a master dataset, for all modify intrinsics, that is, insert, delete and updates, and for DBOPEN modes 1 to 4, IMAGE/SQL puts a set level lock (or a pseudo set level lock covering all the rows in the set). But for update function in DBOPEN mode 1, setting a set level lock (or pseudo set lock) is not mandatory, a row level lock would be sufficient. Therefore, IMAGE/SQL will now lock at the predicate level if a 'where' clause is specified, otherwise a set lock will be given. This feature is actually transparent to the user.

Benefits

When multiple users are operating on the same data set, it is difficult to update different entries with set level lock in place. But when a predicate level lock is in effect, the unnecessary wait time is avoided, thus allowing multiple updates of different entries on the same data set.

For an example, User A has an update statement:

UPDATE Music.Albums set RecordingCo='ABC Music Ltd.' where Medium='ca';

The kind of lock that is placed can be seen by invoking DBUTIL as shown:

:DBUTIL

HP30391C.07.04 TurboIMAGE/XL: DBUTIL (C) COPYRIGHT HEWLETT-PACKARD COMPANY 1987

>>show Music locks
For database MUSIC
PIN/ PROGRAM
LOCKED ENTITY / ( - waiting process ) PATH NAME JOBNUM

ALBUMS: MEDIUM = ca . . . . . . . . . . . . . . . 41/1 ISQL #S18

Now, User B wants to update row(s) in the same data set via an update statement:

UPDATE Music.Albums set RecordingCo='California Music' where 
Medium='cd';

The kind of lock that is applied by User B (JOBNUM #S21) is shown in the following example:

:dbutil

HP30391C.07.04 TurboIMAGE/XL: DBUTIL (C) COPYRIGHT HEWLETT-PACKARD
COMPANY 1987

>> show Music locks
For database MUSIC
PIN/ PROGRAM
LOCKED ENTITY / ( - waiting process ) PATH NAME JOBNUM

ALBUMS: MEDIUM = cd . . . . . . . . . . . . . 56/1 ISQL #S21
ALBUMS: MEDIUM = ca . . . . . . . . . . . . . 41/1 ISQL #S18

In this example, User A updates 2 entries and User B updates 5 entries simultaneously.

Impact on current IMAGE/SQL applications

With this enhancement, the locking scheme in IMAGE/SQL is exactly as required by TurboIMAGE/XL (as described in TurboIMAGE/XL Database Management System Reference Manual, Aug 1997). All applications conforming to this will not have any problems, and may actually see improvements in performance, when updating manual masters.

Support for B-Tree Indices

The B-Tree indices can be created using DBUTIL for existing databases and DBSCHEMA for new databases. More details about creating B-Trees indices is given under the heading, "TurboIMAGE/XL Enhancements," earlier in this article.

In order to realize the benefit of the B-Tree indices for SQL access, you must first DETACH the database, if already attached, and ATTACH the database for the DBEnvironment. IMAGE/SQL enters definitions for the B-Tree indices in the system catalog of the DBEnvironment. The index on the key item of the master, except for P and Z types, is entered as 'unique' index. Other definitions, by default, are non-unique.

Although the B-Tree index on the related search item of the detail set is not explicitly created using DBUTIL or DBSCHEMA, its definition is entered in the SQL catalog. For example, if a B-Tree index is created on a key item with paths to 16 detail data sets, a definition for a B-Tree index for all 16 data sets will be entered as well. That is, this will result into 17 (1+16) definitions, one for each data set.

If your key item or its related search item is split using the SPLIT command of IMAGESQL, the definition for a B-Tree index on the split item will not be entered. For an example, if a key item is split but the related search item is not, the definition for the key item of the master data set will not be entered, but the one for the search item will be.

The B-Tree indices can be viewed in the views, SYSTEM.INDEX and CATALOG.INDEX, of the system catalog of the DBEnvironment.

Multiple index definitions on the same column can coexist and the SQL optimizer derives the access plan based on the statistics present in the system catalog. In other words, the key or search item of the set can have a maximum of three index definitions. One will be a hash index (only "=" operator permitted) automatically done by IMAGESQL at ATTACH time, another can be a B-Tree index, and the third can be a third-party index. It is recommended that both B-Tree index and third-party index be not created on the same item as it will unnecessary impact the performance (Optimizer calculates cost for each index).

The Optimizer derives an access plan and decides which index to use and the proper order of operations.

The version of third-party software that supports the new B-Tree index modes for DBFIND, DBCONTROL, and DBINFO, is required from both third parties.

Third-Party Composite Indices

IMAGES/QL is enhanced to enter definitions for third-party composite indices in the system catalog of the DBEnvironment at ATTACH time. These composite indices can be on mixed data types, but must be on FULL items. Information about all third-party indices, including composite, is obtained from the third-party product, which is subsequently used during ATTACH. Both SUPERDEX and OMNIDEX do not provide information on the composite indices on substrings (partial item) of items to IMAGE/SQL.

These indices can be viewed in SYSTEM.TPINDEX along with other third-party indices.

At run-time, IMAGE/SQL may employ DBFIND mode 1 with "@;" appended to the argument, or mode 11 with start and stop values, as deemed appropriate.

Note that if you have multiple indices for the table, the SQL optimizer has the control on the type of access, and the specific index to be used.

For SQL access, the only step necessary to use the above enhancements pertaining to relational access, is to perform DETACH, if attached, and ATTACH.

Important Information

  1. If you have third-party indexing (TPI) enabled for the database and want to create B-Tree indices, obtain the correct version of the third-party software which recognizes this coexistence. Otherwise, you will get run-time errors returned by third-party software for new modes of DBFIND, DBINFO, and other utility commands.

  2. The Optimizer derives an index scan based on the current statistics for the data set. Hence, it may select an index on the column not used in the SQL statement.

ODBCLink/SE

In this release, IMAGE/SQL is bundled with a new 16-bit and 32-bit ODBC driver, ODBCLink/SE, which is a replacement for the ODBC driver HP PC API. ODBCLink/SE is an implementation of Microsoft's Open Database Connectivity (ODBC) interface that enables Microsoft Windows based applications and tools to access TurboIMAGE/XL data on the HP3000 in a client/server environment. In such an environment, the application developers and end-users can take advantage of the PC's graphical user interface (GUI) and processing power, while relying on the security, integrity, and database management capabilities of IMAGE/SQL. The client can run under Microsoft Windows 3.1 or 3.11, Windows95, or Windows NT V3.51 or V4.0. Connection via Winsock is available in 16-bit and the new 32-bit version. The driver can be used in two ways: either by direct calls from a Windows program or through an ODBC-compliant application such as Microsoft Access and Visual Basic.

A data migration tool is provided to migrate data sources created for the current HP PC API to ODBCLink/SE. Once the data sources have been identified, the translation is performed automatically.

The ODBCLink/SE server runs on MPE/iX 5.0 or later releases. ODBCLink/SE is ODBC Level 2 compliant with a few exceptions. For more information, refer to the article, "Introducing ODBCLink/SE," in this Communicator 3000. The ODBCLink/SE Reference Manual is bundled with IMAGE/SQL.

Feedback to webmaster