Create sessions partition table for existing project databases
Implementation Plan
-
List all the databases from activeApps table.
-
Create the partitioned table in each db (using IF NOT EXISTS).
-
Write to both partitioned and non-partitioned sessions table. Use a materialized view from
snowplow_events
-
Backfill data from old non partitioned table to new partitioned table. Strategy for copying is to take smaller chunks (~10k) rows batches and insert into the partitioned table.
Edited by Surabhi Suman