pub enum StorageFormat {
Row,
Columnar,
}Expand description
Storage format for tables
Tables can be stored in row-oriented (default) or columnar format. Re-exported from vibesql_ast for convenience. 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 moreSource§impl Debug for StorageFormat
impl Debug for StorageFormat
Source§impl Default for StorageFormat
impl Default for StorageFormat
Source§fn default() -> StorageFormat
fn default() -> StorageFormat
Source§impl Display for StorageFormat
impl Display for StorageFormat
Source§impl PartialEq for StorageFormat
impl PartialEq for StorageFormat
impl Copy for StorageFormat
impl Eq for StorageFormat
impl StructuralPartialEq for StorageFormat
Auto Trait Implementations§
impl Freeze for StorageFormat
impl RefUnwindSafe for StorageFormat
impl Send for StorageFormat
impl Sync for StorageFormat
impl Unpin for StorageFormat
impl UnwindSafe for StorageFormat
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.