The SAS SPD Server provides
a virtual table structure called a clustered data table. A cluster
contains a number of slots, each of which contains a SAS SPD Server
table. The clustered data table uses a layer of metadata to manage
the slots.
This virtual table structure
provides the SAS SPD Server with the architecture to offer flexible
storage to allow a user to organize tables based on values contained
in numeric columns, including SAS date, time, or datetime values.
This new type of organization is called a dynamic cluster table. Dynamic
cluster tables enable parallel loading and selective removal of data
from very large tables, making management of large warehouses easier.
These unique capabilities provide organizational features and performance
benefits that traditional SAS SPD Server tables cannot provide.
Dynamic
cluster tables can load and process data in parallel. Dynamic cluster
tables provide the flexibility to add new data or to remove historical
data from the table by accessing only the slots affected by the change,
without having to access the other slots, thus reducing the time needed
for the job to complete. In addition, a complete refresh of a dynamic
cluster table requires a fraction of the disk space that would otherwise
be needed, and can be divided into parallel jobs to complete more
quickly. All of these benefits can be realized using simple SPDO procedure
commands to create and alter a cluster.
The two most basic commands are CLUSTER CREATE and
CLUSTER UNDO. Two additional commands are ADD and LIST. You execute
each of these commands within PROC SPDO.
The CLUSTER CREATE command
requires three options:
-
the name of the cluster table to create
(cluster-table-name)
-
a list of SAS Scalable Performance
Data Server tables to include in the cluster (using the
MEM= option)
-
the maximum number of slots (member tables) that can be used in the cluster table (using the
MAXSLOT= option)
The following example
shows the syntax for PROC SPDO with a CLUSTER CREATE command:
PROC SPDO LIBRARY=domain-name;
SET ACLUSER user-name;
CLUSTER CREATE cluster-table-name
MEM = SPD-Server-table1
MEM = SPD-Server-table2
MEM = SPD-Server-table3
MEM = SPD-Server-table4
MEM = SPD-Server-table5
MEM = SPD-Server-table6
MEM = SPD-Server-table7
MEM = SPD-Server-table8
MEM = SPD-Server-table9
MEM = SPD-Server-table10
MEM = SPD-Server-table11
MEM = SPD-Server-table12
MAXSLOT=24;
QUIT;
Here is
the syntax for the UNDO command:
PROC SPDO
LIBRARY=domain-name;
SET ACLUSER user-name;
CLUSTER UNDO sales_hist;
QUIT;
This example shows the syntax
for the ADD command:
PROC SPDO
LIBRARY=domain-name;
SET ACLUSER user-name;
CLUSTER ADD sales_hist
MEM = 2005sales_table1
MEM = 2005sales_table2
MEM = 2005sales_table3
MEM = 2005sales_table4
MEM = 2005sales_table5
MEM = 2005sales_table6;
QUIT;
Finally, here is the syntax for the LIST command:
PROC SPDO
LIBRARY=domain-name;
SET ACLUSER user-name;
CLUSTER LIST sales_hist;
QUIT;
These operations run
quickly. These features reduce the downtime of the table for maintenance
and improve the availability of the warehouse.