From the course: Data Science on Google Cloud Platform: Designing Data Warehouses

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Speed up queries

Speed up queries

- [Narrator] Overall query performance is an important consideration for any database application architecture. With GCP, the focus also is on monthly charges for executing queries. Let's review some best practices in this regard. The first I tend to focus on in query performance is joins and the need for them. Ideally, there should be no joins used in regularly executed queries. Denormalize frequently joined tables to minimize time taken for query execution. Avoid self-joins. Redesign tables so that you don't need joins. Avoid Cartesian joins or cross joins. They create a very high number of resulting records which in turn can impact costs. Minimize the number of rows returned in queries through filtering. Next, let's explore partitioning. Always look to partition data whenever possible, especially in transaction data. Use partition columns in all queries against a partition table. This limits the number of records analyzed by the query which in turn reduces costs. Clean out and…

Contents