pub enum StorageFormat {
Row,
Columnar,
}Expand description
Storage format for tables
Tables can be stored in row-oriented (default) or columnar format. Columnar storage is optimized for analytical queries (OLAP) with SIMD-accelerated scans and aggregations.
§Usage
-- Create a columnar table for analytics
CREATE TABLE lineitem (...) STORAGE COLUMNAR;
-- Explicitly create a row-oriented table
CREATE TABLE orders (...) STORAGE ROW;§Performance Trade-offs
| Format | INSERT | Point Query | Scan | Aggregation |
|---|---|---|---|---|
| Row | O(1) | O(1) index | O(n) | O(n) |
| Columnar | O(n)* | O(n) | O(n) SIMD | O(n) SIMD |
*Columnar INSERT triggers full rebuild - use for bulk-load scenarios only.
Variants§
Row
Traditional row-oriented storage (default)
Optimized for OLTP workloads: fast inserts, point lookups. Use for tables with frequent writes or transactional access patterns.
Columnar
Native columnar storage for analytical tables
Optimized for OLAP workloads: fast scans, aggregations. Eliminates row-to-columnar conversion overhead for analytical queries.
Warning: Each write operation (INSERT/UPDATE/DELETE) triggers a full rebuild of the columnar representation. Only use for tables that are bulk-loaded and rarely modified.
Trait Implementations§
Source§impl Clone for StorageFormat
impl Clone for StorageFormat
Source§fn clone(&self) -> StorageFormat
fn clone(&self) -> StorageFormat
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more