On 2019-11-12 23:06, Clyde Eisenbeis cte...@gmail.com [firebird-support] wrote: > As I understand, the FbConnection.CreateDatabase max pageSize for > VARCHAR is 8191. Does the page size change to less than 8191 if the > VARCHAR is less? > > What is the max pageSize for CHAR?
Page size is about the size of database pages, Firebird supports page sizes of 4096, 8192, 16384, and - Firebird 4 - 32768 (earlier versions also supported 1024 and 2048). Page size is unrelated to datatypes sizes, except for things you want to index (because the page size does restrict the key size of an index. In any case, CHAR is limited to 32767 characters with a single byte character set and 8191 characters with UTF8. VARCHAR is limited to 32765 characters (single byte) or 8191 characters with UTF8. The only good reason to choose CHAR is for fixed width data, in all other cases you should use VARCHAR. Storage-wise it doesn't really matter in Firebird (although VARCHAR actually requires two bytes more than CHAR in storage format), but VARCHAR is smailler in transmission in the wire protocol. However, CHAR is padded with spaces, while VARCHAR is not. For most uses of string data, VARCHAR is simply better. Mark