Database
Enable BigQuery Partitioning
Enable partitioning to lower your merge latency and reduce the amount of bytes scanned.
Steps to turn on partitioning
For this example, consider this table in Postgres.
CREATE TABLE events (
event_id SERIAL PRIMARY KEY,
event_name VARCHAR(255) NOT NULL,
description TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-
First pause your Artie deployment
-
Recreate the table in BigQuery and make sure to use the right partitioning strategy.
-- Recreate the partitioned table
CREATE TABLE artie.events_copy PARTITION BY DATE(created_at) AS SELECT * FROM artie.events;
-- Drop the old table
DROP TABLE artie.events;
-- Rename new to old
ALTER TABLE artie.events_copy RENAME TO events;
- Edit your deployment and update the table settings for
events
- Click
Save
andDeploy
Was this page helpful?