SQL/MX 3.1 Query Guide (H06.23+, J06.12+)
SQL/MX Operators
HP NonStop SQL/MX Release 3.1 Query Guide—663851-001
7-61
SAMPLE Operator
SAMPLE Operator
Data Mining Group
The SAMPLE operator occurs as a result of a sample clause in a query.
The SAMPLE operator has one child node. The description field for this operator
contains:
For more information about data mining, see the SQL/MX Data Mining Guide.
The following is an example of the SAMPLE operator:
prepare TestQuery34 from
select [first 180] * from t064t5
sample periodic 1 rows every 100 rows
for read uncommitted access;
DESCRIPTION
fragment_id ............ 2
parent_frag ............ 0
fragment_type .......... dp2
sample_type ............ PERIODIC
sampled_columns ........ NotCovered(DETCAT.DETSCH.T064T5.A),
NotCovered(DETCAT.DETSCH.T064T5.B)
balance_expression ..... ((0 block (0 assign (cast(0 AS
NUMERIC(11) SIGNED) + cast(1 AS
NUMERIC(11) SIGNED)))) block
Token Followed by ... Data Type
fragment_id A sequential number assigned to the fragment.
0 is always the master executor and 1 is
reserved for the EXPLAIN plan. Numbers 2 to
n will be ESP or DAM fragments.
integer
parent_frag The fragment_id for the parent of the current
fragment. The value is (none) for the master
executor.
integer
fragment_type Master, ESP, or DP2. text
sampled_columns List of column references representing the
outputs of the sample operator. Indicates that
the column has been sampled.
expr(text)
balance_expression Expression representing the sampling
expression. A simple random selection, but
could be more complex if the sample clause
contains a balance clause.
expr(text)
sample_type Indicates the type of sampling being
performed. Possible values are RANDOM,
PERIODIC, FIRST, and CLUSTER.
text
required_order Specified order keys for a sample operation. expr(text)
TP663851.fm Page 61 Monday, October 17, 2011 11:48 AM










