snowplow / dbt-snowplow-mobile

A fully incremental model, that transforms raw mobile event data generated by the Snowplow mobile trackers into a series of derived tables of varying levels of aggregation.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add unique indexes to derived tables

emielver opened this issue · comments

Describe the feature

We use the unique_key parameter in the config of many derived tables (see here), but this seems to have no actual effect outside of dbt's snapshot functionality (see here). We should use indexes to actually add a unique key index to Postgres to improve performance (see here).

So in short, we should remove the unique_key parameter from the tables, and introduce indexes with the unique key index in our derived tables.

unique_key is required for the upsert on a merge method, but we should add the other stuff