Subject | How much space does a NULL take? |
---|---|
Author | aiylam_s |
Post date | 2005-11-30T21:53:19Z |
Hi,
I have 2 Firebird databases, each with 10,000 records.
The first has 2 VARCHAR columns:
- ID VARCHAR(40) indexed not-null
- LOCATION VARCHAR(250) indexed not-null
The second has 4 VARCHAR columns:
- ID VARCHAR(40) indexed not-null
- LOCATION VARCHAR(250) indexed not-null
- LOCATION_PART1 VARCHAR(32000)
- LOCATION_PART2 VARCHAR(32000)
I have populated both databases with identical data (10,000 rows)
in the first 2 columns. The second database has NULLs in both
LOCATION_PART1 and LOCATION_PART2in every row.
The size of the first database on disk is 1941504 bytes (~1.9 MB).
The size of the second on disk is 14700544 bytes (~14.7MB). Do 20,000
NULLS really take up 12759040 bytes (~12.7MB)? That corresponds to
about 638 bytes per NULL!
Can anybody shed some light on this?
Regards and thanks,
A.V.
I have 2 Firebird databases, each with 10,000 records.
The first has 2 VARCHAR columns:
- ID VARCHAR(40) indexed not-null
- LOCATION VARCHAR(250) indexed not-null
The second has 4 VARCHAR columns:
- ID VARCHAR(40) indexed not-null
- LOCATION VARCHAR(250) indexed not-null
- LOCATION_PART1 VARCHAR(32000)
- LOCATION_PART2 VARCHAR(32000)
I have populated both databases with identical data (10,000 rows)
in the first 2 columns. The second database has NULLs in both
LOCATION_PART1 and LOCATION_PART2in every row.
The size of the first database on disk is 1941504 bytes (~1.9 MB).
The size of the second on disk is 14700544 bytes (~14.7MB). Do 20,000
NULLS really take up 12759040 bytes (~12.7MB)? That corresponds to
about 638 bytes per NULL!
Can anybody shed some light on this?
Regards and thanks,
A.V.