Kewei Shang
Kewei Shang

Reputation: 983

Query BigQuery table partitioned by Partitioning Field

We can create a table partitioned by Partitioning Field. Doc Reference here.

I created a table visitors that contains 2 fields:

When I query the table:

SELECT * FROM mydataset.visitors WHERE part >= "2018-03-14 09:00:00" AND part < "2018-03-15 18:00:00"

Questions:

Thanks

Upvotes: 0

Views: 610

Answers (1)

Graham Polley
Graham Polley

Reputation: 14781

The whole point of partitioned tables, is that BigQuery only has to scan the partitions referenced in your where clause. You can easily see this by removing the where clause and you'll see the amount of data to be processed increase (in the UI). To answer your question, yes, it's smart enough ;-)

Upvotes: 2

Related Questions