Nonstop Database, HiRDB Version 9 System Definition

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

Appendix C.2 Formulas for determining size of SQL object buffer (pd_sql_object_cache_size)

For information on the variables used in the formulas, see (3) following.

Organization of this subsection
(1) Formula for determining the size of the SQL object in an SQL statement
(2) Formula for determining the size of the routine control object of a routine
(3) Variables used in the formulas

(1) Formula for determining the size of the SQL object in an SQL statement

The following formula is used to determine the size of the SQL object in an SQL statement:

Formula

Size of the SQL object in an SQL statement =
[Figure]{
1,600 + 46 [Figure] RCN + 394 [Figure] Si + 24 [Figure] Pi + 2,058 [Figure] Ti + 76 [Figure] Ti [Figure] [Figure] Di + 80 [Figure] Ci + 40 [Figure] Ii + 586 [Figure] Wi
+ 24 [Figure] Ki + Li + 8 [Figure] TCi + 656 [Figure] Di + 116 [Figure] Ti [Figure] QX + 28 [Figure] QX + 200 [Figure] Ai + 48 [Figure] nFF
+ 100 [Figure] nFP + 148 [Figure] nFC + 712 [Figure] nPFF + 32 [Figure] (nAT + nPAT) + 20 [Figure] nCAT
+ 28 [Figure] (nAF + nCAF) + 20 [Figure] (nAA + nPAA + nCAA) + 1,057 [Figure] nSPA + 120 [Figure] nSPP
+ 287 [Figure] nSFF + 8 [Figure] nSFP + 813 [Figure] nJFC + 20 [Figure] nJFP
Add the result of this formula when using a trigger:
+ 1,057 [Figure] nTR + 120 [Figure] (nTSN + nTSO) + 20 [Figure] (nTCN + nTCO)
Add the result of this formula when using a referential constraint:
+ 760 + 376 [Figure] RCC + 1,880 [Figure] RCT
Add the result of this formula when using a set operation:
+ 64 [Figure] Ui
Add the result of this formula when using matrix partitioning:
+ 16 [Figure] Tmi + 16 [Figure] Tmi [Figure] Di
Add the result of this formula when specifying a row value constructor:
+ 384 [Figure] Wri + 32 [Figure] QXs
Add the result of this formula when using a check constraint:
+ 72 [Figure] CDi + 88
Add the result of this formula when obtaining SQL runtime interim results:
+ 24 [Figure] PIX + 192 [Figure] Ti + 68 [Figure] QX + 96
Add the result of this formula when specifying the LIMIT clause:
+ 160
Add the result of this formula when defining a falsification prevented table:
+ 200
Add the result of this formula when using the SET SESSION AUTHORIZATION statement:
+ 32
Add the result of this formula when obtaining transfer values from a list:
+ 32 [Figure] ALP
Add the result of this formula when using the XML type:
+ 36 [Figure] Ti + 4,240 [Figure] XQX + 8 [Figure] XQX [Figure] nURI
Add the result of this formula when using a character set:
+ 80 [Figure] TCCi + 88 [Figure] sRi
Add the result of this formula when using a sequence generator:
+ 168 [Figure] nSQ
Add the result of this formula when using the data compression facility:
+ 8 [Figure] Ci + 32 [Figure] nUOC + 28
Add the result of this formula when using temporary tables:
+ 200 [Figure] nTT
This is a computation formula for column name description area size. Add the result of this formula when using dynamic SQL:
+ 32 [Figure] Si + 16
This is a computation formula for type name description area size. Add the result of this formula when using dynamic SQL:
+ [Figure](42 [Figure] SiT) + {52 + 152 [Figure] (SiTA + SiSA + SiNA) [Figure] (SiT + SiS + SiN)}[Figure]
} [Figure] 1,024[Figure]

Notes
  • If you use stored procedures or stored functions, also include the SQL statements described in the procedures or functions in the computation.
  • If you use triggers, also include the SQL statements described in the triggers in the computation.
  • If you use stored procedures, stored functions, or triggers, compute the size of the routine control object separately for the stored procedures, stored functions, or triggers, and add the result to the size of the SQL object buffer. The formula for computing the size of a routine control object is shown in (2) following.

(2) Formula for determining the size of the routine control object of a routine

(a) When the user defines a trigger

When the user defines a stored procedure, a stored function, or a trigger, the following formula is used to determine the size of the routine control object of a routine:

Formula

Size of the routine control object of a routine (in kilobytes) =
[Figure]{
600 + 28 [Figure] sRi + 32 [Figure] (sRUi + sDi) + 56 [Figure] sSXi + sCUi + sSi + sPi + sLA + sKi + sL + 80 [Figure] sWi + 24 [Figure] sCM + 32 [Figure] sCCR + 2 [Figure] sDCR + 60 [Figure] sCHD + 72 [Figure] sDHD + 64 [Figure] sHCN + 8 [Figure] sCHD [Figure] sHCN + 48 [Figure] nRFF + 100 [Figure] nRFP + 148 [Figure] nRFC + 200 [Figure] nPRFF + 8 [Figure] nPRFP + 196 [Figure] nPA + 64 [Figure] nPP + 36 [Figure] nPPI + 20 [Figure] nPPO + 200 [Figure] nPPA + 8 [Figure] nPPP + 20 [Figure] nAR + 48 [Figure] nARA + 16 [Figure] nRPAT + 20 [Figure] nCAT + 28 [Figure] (nRPAF + nRCAF) + 20 [Figure] (nRPAA + nRCAA) + 287 [Figure] nRSFF + 8 [Figure] nRSFP + 813 [Figure] nPJA + 20 [Figure] nPJP + 813 [Figure] nRJFC + 20 [Figure] nRJFP
Add the result of this formula when using a trigger:
+ 28 [Figure] (nTSN [Figure] 2 + nTSO)
} [Figure] 1,024[Figure]
(b) When HiRDB automatically creates a trigger

When HiRDB creates a trigger for constraint control when CASCADE is specified for the referential action during table definition, the following formula is used to determine the size of the routine control object of a routine:

Formula

Size of the routine control object of a routine (in kilobytes) =
[Figure]{
608 [Figure] RCC + (5,120 + 100 [Figure] RDi + 256 [Figure] RIi) [Figure] RCP [Figure] RCT
} [Figure] 1,024[Figure]

(3) Variables used in the formulas

Variable name Explanation
RCN Total number of tables and indexes used by the SQL object
Si Number of retrieval items inside the SQL statement (number of columns if the columns specified by the SQL statement are index columns)
Pi Number of embedded variables or parameters inside the SQL statement
Ti Number of table names inside the SQL statement
Ci Number of column names inside the SQL statement
Also add the number of columns for which the following definition was specified during table definition (these columns might not be in the SQL statement):
  • Columns for which DEFAULT is specified in the column definition
  • Columns for which WITH DEFAULT is specified for a NOT NULL constraint specification
TCi Number of table columns inside the SQL statement
Wi Number of boolean operators inside the SQL statement#
Ki Number of constants inside the SQL statement#
Li Total size of the constants inside the SQL statement# (in bytes)
Ii Number of indexes used during SQL statement execution (number of indexes specified as retrieval conditions in the table specified by the SQL statement)
Di Total number of storage conditions defined in the table inside the SQL statement (times 2 for a matrix-partitioned table)
QX Number of query specifications
Ai Total number of scalar operations in the SQL statement
SiT Number of abstract data types in the selection expression inside the SQL statement
SiS Number of supertypes for the abstract data types in the selection expression inside the SQL statement
SiN Total number of supertypes for the abstract data type, which is a subtype of the selection expression inside the SQL statement
SiTA Number of attributes for the abstract data types in the selection expression inside the SQL statement
SiSA Number of attributes of the supertypes for the abstract data types in the selection expression inside the SQL statement
SiNA Total number of components specified for the abstract data type, which is a subtype of the selection expression inside the SQL statement
nSPA Number of times the procedure statements inside the SQL statement are invoked
nSPP Total number of arguments for the procedure statements inside the SQL statement
nFF Number of times the functions inside the SQL statement are invoked#
nFP Total number of function arguments inside the SQL statement#
nFC Total number of function definition candidates for the functions inside the SQL statement (number of function invocations nFF + number of function definitions that use as arguments the subtypes to the function invocations whose arguments are abstract data types)
nPFF Number of times the plug-in functions used by SQL objects are invoked (1 for the number of plug-in function invocations inside the SQL statement + SELECT; 6 for INSERT, UPDATE, or DELETE)
nSFF Number of times the system definition scalar functions inside the SQL statement are invoked#
nSFP Total number of arguments for the system definition scalar functions inside the SQL statement#
nJFC Number of times external Java functions are invoked inside the SQL statement
nJFP Total number of arguments of external Java functions inside the SQL statement
nAT Number of abstract data types used by component specification inside the SQL statement (excluding the abstract data types that are manifested by supertypes and abstract data type attributes)
nAA Number of abstract data types used by component specification inside the SQL statement (including the abstract data types that are manifested by supertypes and abstract data type attributes)
nAF Total number of attributes used by component specification inside the SQL statement
nPAT Number of abstract data types used by the arguments of the plug-in functions used by the SQL object (excluding the abstract data types that are manifested by supertypes and abstract data type attributes)
nPAA Number of abstract data types used by the arguments of the plug-in functions used by the SQL object (including supertypes and subtypes)
nCAT Number of times the constructor functions inside the SQL statement are invoked
nCAA Number of abstract data types of the constructor functions inside the SQL statement (including supertypes)
nCAF Total number of attributes of the abstract data types of the constructor functions inside the SQL statement
nTR Number of triggers that are activated by SQL statement execution
nTSN Total number of columns modified by the new values correlation name inside the trigger SQL statement of each trigger activated by SQL statement execution
nTSO Total number of columns modified by the old correlation name inside the trigger SQL statement of each trigger activated by SQL statement execution
nTCN Total number of columns modified by the new values correlation name inside the trigger action condition of each trigger activated by SQL statement execution
nTCO Total number of columns modified by the old correlation name inside the trigger action condition of each trigger activated by SQL statement execution
RCC Total number of member columns of the foreign key and the primary key of the table that references the update-target table inside the SQL statement
RCT Total number of tables that reference the update-target table and the number of tables that the update-target table references inside the SQL statement
RCP Total number of cascades specified for referencing actions during referencing table definition
RIi Total number of indexes defined for referenced tables that are specified for referencing during referencing table definition
RDi Total number of partitioning storage conditions defined for referenced tables that are specified for referencing during referencing table definition (to be multiplied by 2 for a matrix partitioning table)
Ui Number of set operations + 1
Tmi Number of tables with matrix partitioning
Wri Number of conditions using a row value constructor with two or more row value constructor elements specified
QXs Number of table subqueries with multiple selection expressions specified
CDi Number of check constraint conditions
PIX Number of indexes used as multiple indexes
ALP Number of receive functions for passing inter-function values from a list
XQX Number of XQuery specifications
nURI Number of XML name space URIs specified
TCCi Number of columns with character set specification
nSQ Number of sequence generators
nUOC Number of UOCs used for data compression
nTT Number of temporary tables
sRi Number of SQL parameters inside procedures and functions (multiply the number of SQL parameters with the INOUT specification by 2).
sRUi Total number of SQL parameters inside procedures and functions (or the total number of columns modified by an old or new values correlation name inside the trigger SQL statement inside trigger definition)
sDi Number of SQL variables (declare) inside procedures, functions, and trigger SQL statements
sSXi Total number of SQLCODE and SQLCOUNT variables inside procedures, functions, and trigger SQL statements
sCUi Total number of CURRENT_TIME and CURRENT_DATE constants inside procedures, functions, and trigger SQL statements
sSi Number of data manipulation SQL statements inside procedures and trigger SQL statements (SQL statements excluding cursor declaration: OPEN, FETCH, CLOSE, UPDATE, DELETE, and INSERT statements, for example)
sPi Number of routine control SQL statements inside procedures, functions, and trigger SQL statements (BEGIN, SET, IF, ELSE IF, and WHILE, for example)
sLA Number of labels inside procedures, functions, and trigger SQL statements
sKi Number of constants inside procedures, functions, and trigger SQL statements (excluding the constants of data manipulation SQL statements described inside procedures and trigger SQL statements)
sL Combined total size of the constants inside procedures, functions, and trigger SQL statements (excluding the constants of data manipulation SQL statements described inside procedures and trigger SQL statements)
sWi Number of condition predicates inside procedures, functions, and trigger SQL statements
sCM Number of compound statements inside procedures, functions, and trigger SQL statements
sCCR Number of compound statements that describe cursor declarations for procedures and trigger SQL statements
sDCR Number of cursor declarations for procedures and trigger SQL statements
sCHD Number of compound statements that describe handler declarations for procedures, functions, and trigger SQL statements
sDHD Number of handler declarations for procedures, functions, and trigger SQL statements
sHCN Number of condition values described inside handler declarations for procedures, functions, and trigger SQL statements
nRFF Number of function invocations inside the routine
nRFP Total number of function arguments inside the routine
nRFC Total number of function definition candidates for the functions inside the routine (number of function invocations nFF + number of function definitions that use as arguments the subtypes to the function invocations whose arguments are abstract data types)
nPRFF Number of times the plug-in functions used by SQL objects of the routine are invoked
nPRFP Total number of plug-in parameters of the plug-in functions used by the SQL objects of the routine
nPA Number of procedure invocations inside the routine
nPP Total number of parameters for the procedures inside the routine
nPPI Total number of input parameters for the procedures inside the routine (including input/output parameters)
nPPO Total number of output parameters for the procedures inside the routine (including input/output parameters)
nPPA Number of times the plug-in procedure used by the SQL objects of the routine is invoked
nPPP Total number of plug-in parameters of the plug-in procedure used by the SQL objects of the routine
nRSFF Number of times the system definition scalar functions inside the routine are invoked
nRSFP Total number of arguments for the system definition scalar functions inside the routine
nPJA Number of times external Java procedures are invoked inside the routine
nPJP Total number of arguments for external Java procedures inside the routine
nRJFC Number of times external Java functions are invoked inside the routine
nRJFP Total number of arguments for external Java functions inside the routine
nAR Number of abstract data types used by component specification inside the routine (excluding the abstract data types that are manifested by supertypes and abstract data type attributes)
nARA Total number of attributes used in component specification inside the routine
nRPAT Number of abstract data types used by the parameters of the plug-in routines used by the SQL objects of the routine (excluding the abstract data types of supertypes and abstract data type attributes)
nRPAA Number of abstract data types used by the parameters of the plug-in routines used by the SQL objects of the routine (including supertypes)
nRPAF Total number of attributes of the abstract data types used by the parameters of the plug-in routines used by the SQL objects of the routine
nRCAT Number of times the constructor functions inside the routine are invoked
nRCAA Number of abstract data types of the constructor functions inside the routine (including supertypes)
nRCAF Total number of attributes of the abstract data types of the constructor functions inside the routine

#: When triggers are used, the trigger action conditions for the individual triggers that are activated by SQL statement execution must also be counted.