Why an enum backed by strings is cheaper than a lookup table

Relational databases designed in the 2000s often included separate lookup tables for every possible status: user_statuses, invoice_statuses, ticket_priorities, requiring foreign keys and joins on every query.

enum OrderStatus: string
{
    case Pending = 'pending';
    case Paid = 'paid';
    case Refunded = 'refunded';
    case Cancelled = 'cancelled';

    public function isFinal(): bool
    {
        return match ($this) {
            self::Refunded, self::Cancelled => true,
            default => false,
        };
    }
}

Storing varchar statuses directly in the entity table and backing them with native PHP enums eliminated fourteen lookup tables, fourteen joins in query plans, and moved transition validation logic into unit-tested domain code.