Materialize introduced a simpler internal type system called 'representation types' for its SQL optimizer. Instead of tracking fine-grained Postgres/SQL type distinctions (e.g., VARCHAR vs TEXT vs CHAR), the optimizer now uses coarser representation types that reflect actual runtime differences. This eliminates no-op casts like varchar_to_text, which previously blocked arrangement sharing and common-subexpression elimination. The result is less redundant work, more shared arrangements, and meaningful memory reductions — one customer saw a 25% drop in memory usage. The approach is extensible to other type synonyms and numeric representations.
Table of contents
A string by any other nameCasts: correct bookkeeping comes at a costRepresentation types: distinctions mean differencesLess busywork, more sharingSort: