Querying an Athena table partitioned by year, month, day

Question:

I have an Athena table partitioned by year, month, day with the following definition

I need to query it between dates. The options, as I see it, for example are:

Result: Run time: 4.89 seconds, Data scanned: 20.72MB

Result: Run time: 8.64 seconds, Data scanned: 20.72MB

So, I guess Athena is smart enough to use the partitioning feature even when casting the concatenated partitioned columns, so why does it take approx. twice the time? What exactly is going on in the backstage?

Many thanks.

Answer:

Athena will use a filterPredicate in that case, you can use EXPLAIN ANALYSE statement to check this:


Leave a Reply