better worst-case mem usage for subtables