Redshift negatives of varchar(max)

Viewed 991

So I've got sql server columns marked as nchar(1) for money symbols, and porting to redshift blows up because € is a 3 byte unicode character so needs char(3) in redshift (there technically is no nchar). So I want to switch my etl solution to create all varchar columns as varchar(max). In Redshift, does using varchar(max) for everything instead of varchar/varchar(100)/etc have any downsides?

1 Answers

Yes, it does have downsides.

Strongly recommend that you not use VARCHAR(MAX) as the default column size. This requires more memory to be allocated during all phases of the query and will reduce them amount of work that can be done in memory without spilling to disk.

You can use VARCHAR sizes that are somewhat loose, e.g. 64 > 128 > 256 > 512, without incurring much of a performance penalty but only use VARCHAR(MAX) when you need it.

Related