Skip to content

Instantly share code, notes, and snippets.

@piyushgarg-dev
Last active September 5, 2024 04:43
Show Gist options
  • Save piyushgarg-dev/cad5f052676deb89e12112302ac836b3 to your computer and use it in GitHub Desktop.
Save piyushgarg-dev/cad5f052676deb89e12112302ac836b3 to your computer and use it in GitHub Desktop.

Revisions

  1. Piyush Garg revised this gist Feb 15, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion CLICKHOUSE_DB_CREATE.sql
    Original file line number Diff line number Diff line change
    @@ -6,4 +6,4 @@ CREATE TABLE log_events (
    metadata Nullable(String)
    )
    ENGINE=MergeTree PARTITION BY toYYYYMM(timestamp)
    ORDER BY (timestamp, event_id);
    ORDER BY (timestamp);
  2. Piyush Garg created this gist Feb 15, 2024.
    9 changes: 9 additions & 0 deletions CLICKHOUSE_DB_CREATE.sql
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    CREATE TABLE log_events (
    event_id UUID,
    timestamp DateTime MATERIALIZED now(),
    deployment_id Nullable(String),
    log String,
    metadata Nullable(String)
    )
    ENGINE=MergeTree PARTITION BY toYYYYMM(timestamp)
    ORDER BY (timestamp, event_id);