BlackFriday 2024! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Google Exam Professional Data Engineer Topic 3 Question 91 Discussion

Actual exam question for Google's Professional Data Engineer exam
Question #: 91
Topic #: 3
[All Professional Data Engineer Questions]

Your company's customer_order table in BigOuery stores the order history for 10 million customers, with a table size of 10 PB. You need to create a dashboard for the support team to view the order history. The dashboard has two filters, countryname and username. Both are string data types in the BigQuery table. When a filter is applied, the dashboard fetches the order history from the table and displays the query results. However, the dashboard is slow to show the results when applying the filters to the following query:

How should you redesign the BigQuery table to support faster access?

Show Suggested Answer Hide Answer
Suggested Answer: C

To improve the performance of querying a large BigQuery table with filters on countryname and username, clustering the table by these fields is the most effective approach. Here's why option C is the best choice:

Clustering in BigQuery:

Clustering organizes data based on the values in specified columns. This can significantly improve query performance by reducing the amount of data scanned during query execution.

Clustering by countryname and username means that data is physically sorted and stored together based on these fields, allowing BigQuery to quickly locate and read only the relevant data for queries using these filters.

Filter Efficiency:

With the table clustered by countryname and username, queries that filter on these columns can benefit from efficient data retrieval, reducing the amount of data processed and speeding up query execution.

This directly addresses the performance issue of the dashboard queries that apply filters on these fields.

Steps to Implement:

Redesign the Table:

Create a new table with clustering on countryname and username:

CREATE TABLE project.dataset.new_table

CLUSTER BY countryname, username AS

SELECT * FROM project.dataset.customer_order;

Migrate Data:

Transfer the existing data from the original table to the new clustered table.

Update Queries:

Modify the dashboard queries to reference the new clustered table.


BigQuery Clustering Documentation

Optimizing Query Performance

Contribute your Thoughts:

Major
2 months ago
Partitioning by country and username is the obvious choice here. Anything else would just be a waste of time. 'Obvious' as a feather on a fish, am I right?
upvoted 0 times
Edelmira
16 days ago
C) Cluster the table by country and username fields
upvoted 0 times
...
Goldie
27 days ago
Partitioning by country and username is the best approach for faster access.
upvoted 0 times
...
Tuyet
1 months ago
A) Cluster the table by country field, and partition by username field.
upvoted 0 times
...
...
Johnna
2 months ago
I think partitioning by _PARTITIONTIME would also be a good option to consider for faster access.
upvoted 0 times
...
Beckie
2 months ago
But clustering by country field would reduce the data scanned when filtering by country, making it faster.
upvoted 0 times
...
Kaitlyn
2 months ago
I disagree, I believe partitioning the table by country and username fields would be more efficient.
upvoted 0 times
...
Beckie
2 months ago
I think we should cluster the table by country field and partition by username field.
upvoted 0 times
...
Alex
2 months ago
Clustering the table by country and username sounds like a good idea, but partitioning is probably more efficient. I'd go with option B.
upvoted 0 times
Camellia
2 months ago
Yeah, that way the dashboard can fetch the data faster when applying the filters.
upvoted 0 times
...
Simona
2 months ago
I agree, partitioning the table by country and username fields seems like the best option.
upvoted 0 times
...
...
Ernestine
2 months ago
Partitioning by _PARTITIONTIME might work, but it doesn't address the specific filters we need. Gotta go with option B.
upvoted 0 times
...
Ashanti
3 months ago
Hmm, I think partitioning by both country and username fields is the way to go. That should give us faster lookups on those filters.
upvoted 0 times
Berry
1 months ago
Hmm, I think partitioning by both country and username fields is the way to go. That should give us faster lookups on those filters.
upvoted 0 times
...
Nichelle
2 months ago
B) Partition the table by country and username fields.
upvoted 0 times
...
Christiane
2 months ago
A) Cluster the table by country field, and partition by username field.
upvoted 0 times
...
...

Save Cancel