Subject Re: [firebird-support] What are the trade-offs of CHAR vs. VARCHAR?
Author Ann Harrison
> On Nov 12, 2019, at 10:44 PM, Richard Damon richard@... [firebird-support] <firebird-support@yahoogroups.com> wrote:
>
>> On 11/12/19 12:38 PM, cte677@... [firebird-support] wrote:
>>
>>
>> What are the trade-offs of CHAR vs. VARCHAR? I know that VARCHAR
>> consumes less space. Anything thing else (are VARCHAR searches slower)?
>>
> In some implementations of SQL (I don't know if firebird is one of
> 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.

In Firebird all records are compressed on disk.
>
> 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
>
>
>
> ------------------------------------
> Posted by: Richard Damon <Richard@...>
> ------------------------------------
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://www.firebirdsql.org and click the Documentation item
> on the main (top) menu. Try FAQ and other links from the left-side menu there.
>
> Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> ------------------------------------
>
> Yahoo Groups Links
>
>
>