Subject | Re: What are the trade-offs of CHAR vs. VARCHAR? |
---|---|
Author | |
Post date | 2019-11-13T16:37:44Z |
Your statement, which may be true, does not sit well with a previous statement that states that a VARCHAR field of 1000 characters is stored in the table with 1000 characters.
Your statement is suggesting a null length (until the field is updated) with two bytes for an actual length, which is how VARCHAR fields work in all other databases to my knowledge. Otherwise, to follow the previous statement, a Firebird table could have a VARCHAR field for 1000 characters, be stored as such with the initial storage-info bytes holding the actual length, which would be 1000. When the field is updated to lets say 20 characters of data, the field would still have an actual size of 1000 characters but the storage-info would be 20.
How does this make any sense?
Steve Naidamast
Sr. Software Engineer