Subject | Re: [firebird-support] What are the trade-offs of CHAR vs. VARCHAR? |
---|---|
Author | Richard Damon |
Post date | 2019-11-13T03:44:34Z |
On 11/12/19 12:38 PM, cte677@... [firebird-support] wrote:
them), a row without any variable length items (like VARCHAR) and thus
of fixed length could be stored in a somewhat optimized way making its
access somewhat faster because all the records were the same size.
VARCHAR also doesn't always take less space, as very short CHAR fields
can be smaller than the overhead of a VARCHAR, and if the CHAR field is
storing a value that is always the same length (like maybe a hash code)
the overhead of VARCHAR is just wasted.
--
Richard Damon
>In some implementations of SQL (I don't know if firebird is one of
>
> What are the trade-offs of CHAR vs. VARCHAR? I know that VARCHAR
> consumes less space. Anything thing else (are VARCHAR searches slower)?
>
them), a row without any variable length items (like VARCHAR) and thus
of fixed length could be stored in a somewhat optimized way making its
access somewhat faster because all the records were the same size.
VARCHAR also doesn't always take less space, as very short CHAR fields
can be smaller than the overhead of a VARCHAR, and if the CHAR field is
storing a value that is always the same length (like maybe a hash code)
the overhead of VARCHAR is just wasted.
--
Richard Damon