Scalable Database Server, HiRDB Version 8 UAP Development Guide

[Contents][Index][Back][Next]

5.2 Restrictions on functions provided by plug-ins

Functions provided by plug-ins are called plug-in distribution functions.

Organization of this section
(1) Restrictions on passing values between plug-in distribution functions
(2) Restrictions on executing plug-in distribution functions
(3) Notes on storing passing inter-function values to a list

(1) Restrictions on passing values between plug-in distribution functions

(a) Types of plug-in distribution functions

Table 5-1 lists the types of plug-in distribution functions.

Table 5-1 Types of plug-in distribution functions

Function type Plug-in process
Process that generates inter-function values to be passed and sends them to other plug-in distribution functions Process that receives inter-function values sent from other plug-in distribution functions
Function that does not have inter-function values Not supported Not supported
Function that sends inter-function values1 Not supported Supported
Function that receives passed inter-function values2 Supported Not supported
Function that sends and receives inter-function values Supported Supported

1 An example of this function type that the HiRDB Text Search Plug-in provides is the score function.

2 An example of this function type that the HiRDB Text Search Plug-in provides is the contains_with_score function.

The HiRDB system allows values to be passed between plug-in distribution functions. Because HiRDB automatically passes inter-function values between plug-in distribution functions, the inter-function value does not have to be specified as an argument of the plug-in distribution function.

Note
Where the plug-in distribution function can be specified in an SQL differs depending on the function type. For details about the plug-in distribution function types, see the plug-in manuals.

The following explanations use these terms:

(b) Correspondences between send and receive functions for passing inter-function values

The following are rules for the correspondences between send and receive functions for passing inter-function values.

Table 5-2 shows the HiRDB operations for combinations between receive and send functions for passing inter-function values.

Table 5-2 Correspondences between receive and send functions for passing inter-function values

Receive function for passing inter-function values Send function for passing inter-function values HiRDB operation
Not specified Not specified Can be executed
Specified
Specified Not specified Cannot be executed*
Specified (one) Can be executed
Specified (two or more) Cannot be executed

* When passing inter-function values are to be obtained from a list, the send and receive functions for passing inter-function values can be specified across multiple queries.
(c) Restrictions on plug-in distribution functions

(2) Restrictions on executing plug-in distribution functions

(a) Execution methods for plug-in distribution functions

You can execute plug-in distribution functions in two ways:

Some plug-in distribution functions can be executed only if an index-type plug-in is used (index-type plug-in-dependent function).

When HiRDB executes an index-type plug-in-dependent function, an error occurs if HiRDB determines that the index-type plug-in cannot be used. Table 5-3 shows the combinations that trigger an error. To find out whether a plug-in distribution function requires an index-type plug-in, see the plug-in manuals.

Table 5-3 Combinations that trigger an error when a plug-in distribution function is executed

Method that uses index-type plug-in to execute function Method that executes function without using index-type plug-in Retrieval method selected by HiRDB
Retrieval with index-type plug-in Retrieval without index-type plug-in
Provided Provided E E
Provided* Not provided* E [Figure]
Not provided Provided NA E

E: Can be executed

[Figure]: Error occurs when executed

NA: Not applicable

* Index-type plug-in-dependent functions fall into this category. Examples for the HiRDB Text Search Plug-in are contains and contains_with_score.
(b) Restrictions on execution methods for index-type plug-in-dependent functions

The following restrictions apply when index-type plug-in-dependent functions are used:

  1. Only a base table column specification can be specified in the first argument. Also, the column cannot be an external-referencing column.
  2. Arguments that include the following value expressions cannot be specified in any argument except the first:
    • Column specifications, except external-referencing columns
    • Component specifications for columns
  3. Index-type plug-in-dependent functions can be specified in WHERE clauses and ON search conditions.
  4. If an index-type plug-in-dependent function is specified in the WHERE clause of a query specification that specifies an outer join, a column that becomes the inner table of the outer join cannot be specified in the first argument. An example is shown as follows:

    [Figure]

  5. If a index-type plug-in dependent function is specified in the ON search condition of a joined table that specifies an outer join, the following columns cannot be specified in the first argument:
    • Columns of the outer table
    • Columns of the outer-joined inner table included in the inner table, if the inner table is a joined table containing an outer join
  6. If the FROM clause contains specifications for two or more tables, a table column that is different from the column specified in the first argument of an index-type plug-in-dependent function cannot be specified in the search condition of the OR operand. However, when the WHERE clause or the ON search condition contains the NOT logical operator, a different table column can be specified, if the previous condition is not satisfied after the NOT logical operator is eliminated by De Morgan's theorem.* An example is shown as follows:
    Example:
    SELECT T1.C1,T2.C2 FROM T1,T2
      WHERE T1.C1=10 AND ((CONTAINS(T2.ADT,'ABC') IS TRUE)
                       OR CONTAINS(T2.ADT,'DEF') IS TRUE))
    The UNION representation of this SQL is as follows:
    (SELECT T1.C1,T2.C2 FROM T1,T2
      WHERE T1.C1=10 AND (CONTAINS(T1.ADT,'ABC') IS TRUE)
    UNION ALL
      SELECT T1.C1,T2.C2 FROM T1,T2
          WHERE T1.C1=10 AND (CONTAINS(T2.ADT,'DEF') IS TRUE))
    EXCEPT ALL
      SELECT T1.C1,T2.C2 FROM T1,T2
          WHERE T1.C1=10 AND (CONTAINS(T2.ADT,'DEF') IS TRUE)
                AND (CONTAINS(T1.ADT,'ABC') IS TRUE)
    * Assume that the following SQL statements have been specified:
    SELECT T1.C1,T2.C2 FROM T1,T2
      WHERE NOT(CONTAINS(T1.ADT, ...)IS NOT TRUE AND T1.C1=10)
      AND T1.C1=T2.C1
    If the NOT logical operator is eliminated according to De Morgan's theorem, the result is as follows:
    SELECT T1.C1,T2.C2 FROM T1,T2
      WHERE NOT(CONTAINS(T1.ADT, ...)IS TRUE OR T1.C1<>10)
      AND T1.C1=T2.C1
  7. Index-type plug-in dependent functions cannot be specified in CASE expressions and CAST specifications.
  8. Predicates that include IS FALSE, IS UNKNOWN, or negation (NOT) cannot be specified for index-type plug-in-dependent functions.

Examples related to these restrictions are as follows.

Example 1
If the WHERE clause specifies a send function for passing inter-function values and that function is dependent on an index-type plug-in, the first argument cannot contain one query specification that specifies that send function, together with an index-type plug-in-dependent function that has a column from the same table.
SELECT C1,C2, score(SENTENCES) FROM T1
   WHERE contains(SENTENCES,...)IS TRUE
      AND contains_with_score(SENTENCES, ...) IS TRUE

Example 2
This example outer-joins tables T1 and T2 and retrieves data by specifying an index-type plug-in-dependent function in the WHERE clause.
SELECT T1.C1,T2.C2 FROM T1 LEFT OUTER JOIN T2
   ON T1.C1=T2.C1 WHERE contains(T1.C3, ...)IS TRUE

(3) Notes on storing passing inter-function values to a list

(a) Storing passing inter-function values to a list

When target records are narrowed hierarchically (a narrowed search is performed), the results of the receive function for passing inter-function values can be obtained quickly by storing the passing inter-function values to a list.

To store passing inter-function values to a list, use the ASSIGN LIST statement to specify a send function for passing inter-function values in the search conditions for creating a list from a base table. The send function for passing inter-function values must be able to store the passing inter-function values to a list. (However, only one send function for passing inter-function values that can store such values to a list can be specified in the ASSIGN LIST statement.)

For information about whether the functions provided by a plug-in can store passing inter-function values to a list, refer to the manual for that plug-in.

You can also use the ASSIGN LIST statement to store passing inter-function values from a list that stores such values to a new list.

(b) Getting passing inter-function values from a list

To get passing inter-function values stored to a list without specifying a send function for passing inter-function values, specify a receive function for passing inter-function values that can get such values from a list (receive function for passing inter-function values for lists) in the selection expression of the cursor specification for search via a list.

For information about whether the functions provided by a plug-in can get passing inter-function values from a list, refer to the manual for that plug-in.

If a receive function for passing inter-function values that can get such values from a list is specified in the selection expression of the cursor specification for search via a list, HiRDB gets those values without evaluating the type of send function for passing inter-function values that stored those values to the list. Therefore, be sure to specify a receive function for passing inter-function values that corresponds to the send function for passing inter-function values specified when the list was created.

(c) Methods of executing set operations between lists

If a set operation between lists is to be performed, the set operation execution method changes depending on the send function for passing inter-function values that was specified in the search conditions for list creation.

Table 5-4 shows the passing inter-function values in the set operation results for the following:

list-name-1 {AND | OR | AND NOT | ANDNOT} list-name-2

Table 5-4 Passing inter-function values in set operation results

Send function for passing inter-function values when list-name-1 is created1 Send function for passing inter-function values when list-name-2 is created1
When passing inter-function values can be stored to a list Other cases
Passing inter-function values for narrowing used is specified No set operation method is specified
When passing inter-function values can be stored to a list. Passing inter-function values for narrowing used is specified. N N Passing inter-function values of list-name-12
No set operation method is specified. N N N
Other cases N N None

Legend:
N: Cannot be executed.

1 For information about send functions for storing inter-function variables that allow a set operation method to be specified, refer to the manual of the individual plug-in.

2 The set operation result becomes the null value if the OR operation results do not include passing inter-function values.