<@U02NBF4P82K> I'm getting conflicting advice on w...
# questions-and-troubleshooting
m
@Allen Li I'm getting conflicting advice on whether to use
STRING
or
VARCHAR(N)
regarding query performance and memory usage. • You previously mentioned that I can always use
STRING
because "the length will be automatically determined by the actual data size."StarRocks AI (Rocky), however, just told me the exact opposite: It claims that during queries (joins/shuffles), StarRocks pre-allocates memory based on the schema's max length, meaning
STRING
(treated as 65k+ bytes) causes massive memory overhead/OOMs compared to a strict
VARCHAR(N)
. It also said
STRING
hurts Primary Key index performance. My questions: 1. Does the execution engine pre-allocate RAM based on the schema's declared length or the actual data size? 2. Is there a real memory/performance penalty for using
STRING
instead of
VARCHAR(N)
? Thanks!