Skip to main content

Question on space utilization - VARCHAR

  • January 23, 2017
  • 1 reply
  • 3 views

nvk9

If I have a column defined as VARCHAR(2000) and I insert a string

'WonderHowMuchSpaceThisTakes!!!' which has only 30 bytes, will Vertica consume the utilized 30 bytes or the all the allocated 2000?

1 reply

Sharon_Cutter
Forum|alt.badge.img
  • Participating Frequently
  • January 24, 2017

Vertica stores the 30 characters efficiently on disk in the projection, but you will pay a performance penalty at run-time if varchar columns are "over-declared".  The execution engine will use the full 2000 characters during query execution and will use extra storage for temp space operations.

 

  --Sharon