Skip to main content
Isofold rewrites your SQL queries to make them cheaper—without changing what they do. We apply a suite of optimizer rules using Apache DataFusion that are tested against real-world analytical workloads (like the Google Ethereum dataset). Each rewrite rule:
  • Preserves semantics
  • Targets measurable inefficiencies
  • Composes cleanly with others

How It Works

  1. The incoming SQL is parsed into a logical plan.
  2. Isofold applies rewrite rules in a deterministic order.
  3. Both original and rewritten queries are dry-run for:
    • Logical plan structure
    • Slot usage / bytes scanned
    • Compatibility with warehouse constraints
  4. If the rewritten query is valid and cheaper, it is executed.
  5. Otherwise, Isofold automatically falls back to the original.

Examples

PushDownFilter

PushDownLimit

ProjectionPrune + OptimizeProjections

SimplifyExpressions

EliminateDuplicatedExpr

EliminateFilter

EliminateGroupByConstant

EliminateJoin

EliminateLimit

EliminateNestedUnion / EliminateOneUnion

EliminateOuterJoin

ExtractEquijoinPredicate

FilterNullJoinKeys

ReplaceDistinctWithAggregate

ScalarSubqueryToJoin

SingleDistinctToGroupBy


Composed Rewrite:

Applied Rules:
  • PushDownFilter
  • SimplifyExpressions
  • EliminateOuterJoin
  • ProjectionPrune
  • EliminateGroupByConstant
  • ReplaceDistinctWithAggregate
  • EliminateLimit

Guarantees

  • Dry-run validated for correctness
  • Cost-estimated before execution
  • Fallback-safe: if a rewrite introduces cost or fails validation, Isofold reverts to the original

Next: Topology Overview