Get the latest tech news

Mishaps in Redshift Temporary Tables


The database management system (DBMS) I’ll reference today is Redshift (AWS Cloud Datawarehouse offering) which is based on Postgres. I’ll dive into some of the anti-patterns around Temporary Tables I’ve seen abused during my work experience, why they don’t make sense, and how to fix them. Lets get it out of the way… Temporary Tables are not “better” than Common Table Expressions (CTEs) and CTEs are not “better” than temporary tables.

The database management system (DBMS) I’ll reference today is Redshift(AWS Cloud Datawarehouse offering) which is based on Postgres. Issue 1: Create a temp table just to SELECT everything out of it Uselessly writing the entire result set to disk just to read it all back out. Using Temp Tables to chunk up pieces of a query can be very handy in development, as they are persisted for the duration of the session, things like tests, logical checks, and quick aggregations can be run against them

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Mishaps

Mishaps