table copyTable

Performance: Archiving Massive Sensor Data with Compression and Indexing

Scénario de test & Cas d'usage

Business Context

A manufacturing plant gathers massive vibration data from sensors. To optimize memory usage and query speed for historical analysis, the engineering team needs to archive raw data into a global, compressed table with an index on the 'Sensor_ID'. The data must be distributed across worker nodes for parallel processing efficiency.
About the Set : table

Loading, saving, and managing in-memory tables.

Discover all actions of table
Data Preparation

Simulation of a high-volume sensor dataset (100,000 rows) with random vibration readings.

Copied!
1 
2DATA casuser.raw_sensors;
3call streaminit(999);
4DO k = 1 to 100000;
5Sensor_ID = floor(rand('Uniform') * 50);
6Timestamp = datetime();
7Vibration = rand('Normal');
8OUTPUT;
9END;
10 
11RUN;
12 

Étapes de réalisation

1
Copy raw data to a global archive table with compression enabled, indexing on Sensor_ID, and row redistribution.
Copied!
1 
2PROC CAS;
3TABLE.copyTable / TABLE={name='raw_sensors', caslib='casuser'}, casout={name='sensor_archive_global', caslib='casuser', compress=true, indexVars={'Sensor_ID'}, promote=true, replace=true}, distributeRows=true;
4 
5RUN;
6 
2
Verify table details to confirm compression ratio and index existence.
Copied!
1 
2PROC CAS;
3TABLE.tableDetails / name='sensor_archive_global' caslib='casuser';
4 
5RUN;
6 

Expected Result


The 'sensor_archive_global' table is created with a visible compression ratio in the details. The table is promoted (Global scope), rows are balanced across nodes, and the 'Sensor_ID' column is indexed for fast lookups.