Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsA variable-length field stores a value according to its actual length, up to a limit set by the database or data type. A VARCHAR column is a familiar example: it can hold strings of different lengths rather than reserving the same declared width for every value. The exact limit and physical storage method depend on the database, so “variable length” does not mean unlimited or universally stored the same way.
What does variable length mean?
In a database, a field (often called a column) is variable-length when the stored value can occupy different amounts of space depending on its content. A system still needs to know where the value ends. It may keep length metadata or use another representation, and it may also impose a maximum.
Conceptually, a stored value might look like this:
[length information][actual value]
This is only a simplified illustration. It does not describe one universal database layout: the amount and location of metadata, and even whether long values are stored with the row, vary by product and storage format.
How is a variable-length field different from a fixed-length field?
| Feature | Variable-length field | Fixed-length field |
|---|---|---|
| Width | Can hold values of different actual lengths, within the type’s limit. | Has a declared width; short values may be padded or stored according to fixed-width rules. |
| Storage | Typically needs length information or equivalent metadata; actual storage behavior depends on the engine. | May reserve or represent a fixed width, though implementation details differ. |
| Common SQL example | VARCHAR for variable-length character data. |
CHAR for fixed-width character data. |
The contrast is useful, but it is not a promise about the exact number of bytes each type consumes. Character encoding, declared limits, metadata, row format, and engine-specific rules all affect storage. Check the documentation for the database and type you use.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →#1 Best Overall
Does a variable-length field save space or improve speed?
It can save space when values vary substantially in length, because shorter values need not occupy the full fixed width. IBM Informix’s documentation for its varying-length character types describes this potential benefit and notes that more compact tables can make queries faster. That is a possible outcome, not a guarantee for every database or workload.
Variable-length data also has costs and trade-offs. The database must represent its length, and long values may be handled differently from short ones. Row formats and access patterns can affect storage and performance. It is therefore inaccurate to assume that a variable-length column is always smaller or faster than a fixed-length one.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.How do database implementations differ?
IBM Informix 12.10
For the documented CHARACTER VARYING, VARCHAR, and related types, Informix stores the actual contents with a one-byte length field. Its documentation gives an m limit of 254 bytes for indexed columns and 255 bytes for non-indexed columns in this type family. These limits apply to the documented Informix version and types, not to VARCHAR in general. IBM Informix: Character Varying Data
MySQL 9.7 InnoDB
In InnoDB’s COMPACT row format, variable-length columns use one- or two-byte length information depending on factors such as the column’s maximum and actual lengths and whether data is stored externally. In the DYNAMIC row format, long VARCHAR, VARBINARY, BLOB, and TEXT values can be stored fully off-page in applicable cases. Whether a value is stored off-page depends on page size and total row size; this is a storage-format detail, not part of the general definition. MySQL 9.7: InnoDB Row Formats
Recommended Free Tools
MySQL 9.6 server implementation
MySQL’s server developer reference describes a variable-length string field as having one or two length bytes, relevant character bytes, and possible unused padding up to the column’s full length. Its documented copy routine copies the length bytes and relevant content bytes. This describes an internal implementation, not a rule shared by all databases. MySQL 9.6 server developer reference: field_conv.cc
PostgreSQL 16 and 17
PostgreSQL 16’s C-function documentation describes variable-length types passed through its C interface as beginning with an opaque four-byte length field and directs developers to set it with SET_VARSIZE. That describes an internal C representation, not a general promise about the disk layout of a SQL VARCHAR column. PostgreSQL 16: C-Language Functions
PostgreSQL 17’s documentation for user-defined types describes the standard internal layout and macros for variable-length types. It says that types with values of varying size are usually desirable to make TOAST-able. PostgreSQL 17: User-Defined Types
Oracle Database 19c
Oracle’s Pro*C/C++ documentation describes a VARCHAR host-variable structure with a two-byte length field before its string field. A host variable is part of the application interface; its in-memory structure must not be mistaken for the universal on-disk layout of an Oracle column. Oracle separately documents SQL VARCHAR2 as variable-length character data, with limits and semantics that depend on context. Oracle Database 19c: Datatypes and Host Variables
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Quick Recap
What to keep in mind when choosing a field type
- Look at the declared limit. A variable-length type has a maximum, and a limit expressed in bytes is not necessarily the same as a character count.
- Separate SQL behavior from internal representations. Documentation for a C extension or host variable may explain an application interface, not how a SQL column is stored on disk.
- Check your engine’s storage rules. Character set, row format, page size, and long-value handling can affect actual storage.
- Choose for the data and workload. Variable length can be useful when values differ in size, but it does not guarantee better performance or lower storage use.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




