NotSoRandomOne
Registered User.
- Local time
- Today, 15:33
- Joined
- Sep 15, 2009
- Messages
- 51
Doing some Access work again, and wanted to make sure I understand how memory is used in text records, in order to design a DB as efficiently as possible.
If I am wrong in the following, please correct me. If I'm not wrong, let me know and I'll continue on my journey. Thanks!
In Access, each record is something like a liked list, or an arbitrarily-wide tree in C++ or another language. The values for things like numbers and currency may actually be held in the root node of the record - that isn't important. But for text values the node would hold a pointer to the actual text string (like a std::string in c++). If the string is not used, querying it would return 'True' for an IsNull test, and no memory would be used.
If the string is used, on the other hand, only enough memory would be allocated to actually hold the string. So even if the text size is specified at '255' in the table definition, a value of "Hello World" would only take up 11 bytes or so (~22 if Unicode), + any overhead for the string itself.
I am led to this conclusion by John Vinson's post in this thread: https://answers.microsoft.com/en-us...s/73515d8b-af69-4058-b882-279038ee1b99?page=1.
Thanks for any feedback!
PS - using Access 2010
If I am wrong in the following, please correct me. If I'm not wrong, let me know and I'll continue on my journey. Thanks!
In Access, each record is something like a liked list, or an arbitrarily-wide tree in C++ or another language. The values for things like numbers and currency may actually be held in the root node of the record - that isn't important. But for text values the node would hold a pointer to the actual text string (like a std::string in c++). If the string is not used, querying it would return 'True' for an IsNull test, and no memory would be used.
If the string is used, on the other hand, only enough memory would be allocated to actually hold the string. So even if the text size is specified at '255' in the table definition, a value of "Hello World" would only take up 11 bytes or so (~22 if Unicode), + any overhead for the string itself.
I am led to this conclusion by John Vinson's post in this thread: https://answers.microsoft.com/en-us...s/73515d8b-af69-4058-b882-279038ee1b99?page=1.
Thanks for any feedback!
PS - using Access 2010