Cost-Based Optimizer (CBO) vs Rule-Based.

Updated May 5, 2026

Short answer

Rule-based uses fixed patterns (like predicate pushdown); CBO uses data statistics to pick the cheapest plan.

Deep explanation

CBO uses ANALYZE TABLE results to decide the order of multi-table joins and whether to use broadcast joins based on actual row counts/cardinality.

Unlock with a Pro subscription to view this section.

View pricing

Real-world example

No real-world example available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Common mistakes

No common mistakes listed yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Follow-up questions

No follow-up questions available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

More Apache Spark interview questions

View all →