YottaDB: Trade-offs Between Pieced Strings and Numbered Subscripts for Record Storage

36 views
Skip to first unread message

Kurt Le Breton

unread,
Nov 29, 2025, 10:04:16 PMNov 29
to Everything MUMPS
I would like to understand the practical trade-offs in YottaDB between storing a record as a single delimited value versus storing the same record using numbered subscripts.

Example A - Single node with delimited pieces:
^REC(id) = field1_$C(0)_field2_$C(0)_field3

Example B - Numbered subscripts:
^REC(id,1) = field1
^REC(id,2) = field2
^REC(id,3) = field3

Question:

From an internal and performance standpoint, how do these two approaches differ with respect to:

* Partial-field update costs (modifying only one field)
* Storage density
* Scanning efficiency

I am looking for insight into when one representation is preferable over the other, and why.

Thanks.

K.S. Bhaskar

unread,
Nov 30, 2025, 6:07:55 PMNov 30
to Everything MUMPS
As a rule of thumb, assume that a global variable access is computationally an order of magnitude more expensive than a local variable access. So, if the data are related, and several fields are likely to be accessed more or less together (e.g., a person's name, demographics, address, etc.), it makes sense for them to be pieces of a single node. If on the other hand accesses are likely to be random and not correlated with one another, then having multiple, smaller nodes might be preferable. You should create a simulation of your intended application's access patterns and measure performance to decide.

Do consider using AIM (https://docs.yottadb.com/Plugins/ydbaim.htmlfor cross references. It will save you coding.

Regards
- Bhaskar
Reply all
Reply to author
Forward
0 new messages