NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
S-32
SERIALWRITES File Attribute
The SQLCI query and the result:
>> --Print the percents
>> SELECT Y.C, (100.0*COUNT(*))/(COUNT(DISTINCT X.I) *
+> COUNT(DISTINCT X.I))
+> FROM T X, T Y
+> GROUP BY Y.C;
C (EXPR)
-- ---------------------
N1 50.0
N2 16.6
N3 33.3
--- 3 row(s) selected.
The query joins table T with itself; X and Y are correlation names so that a query
can compare one row of the table with every other row. The GROUP BY Y.C clause
produces sets of n*v values for each distinct C value in which the following are true:
n
is the number of rows in the table.
v
is the number of occurrences of a particular C value.
COUNT(DISTINCT X.I) is n for each group. The second term in the select list
represents the following equation:
(n*v)/(n*n) = (v/n)
The SELECT statement displays a distinct value of C together with its percentage
distribution over the table.
SERIALWRITES File Attribute
SERIALWRITES is a Guardian file attribute that specifies whether to write data serially
or in parallel to the two disk devices that make up a mirrored volume. SERIALWRITES
applies to key-sequenced, relative, and entry-sequenced tables and to indexes.
The table default is SERIALWRITES.
{ SERIALWRITES | NO SERIALWRITES }
SERIALWRITES Selects serial mirror writes
NO SERIALWRITES Selects parallel mirror writes