Cost-Based Optimizer in Apache Spark 2.2
databricks.com
databricks.com
There's a fair amount of overlap, but where the databricks article explains the techniques with charts and high level explanations, I go over the code instead.
It basically shows that most cost-based optimizers are pretty bad at cardinality estimation, which compounds when queries use more joins.
Not that this isn't a great development in itself...
Very neat stuff from the databricks team!