To record discussion with Stefan about long history variable names.
We have several requests to remove the 32-byte limit on history variable names.
Presently, history variable names are formed from two 32-byte strings: history event name and
history tag name:
* history event name is usually same as the equipment name (also a 32-byte string)
* history tag name is composed from /eq/xxx/variables/yyy name (also a 32-byte string) or from
names in /eq/xxx/variables/names and "names zzz", which can have arbitrary length (and tag name
would have to be truncated).
This worked well for "per-equipment" history, history events corresponded to equipment/variables
and all data from equipment/variables were written together in one go. (this very inefficient if
values of only one variable is updated).
Then at some point we implemented "per-variable" history:
* history event name is a equipment name (32-byte string) plus /eq/xxx/variables/vvv variable name
(also 32-byte string). (obviously truncation is quite possible)
* history tag name is unchanged (also can be truncated)
With "per-variable" history, history events correspond to individual variables (ODB entries) in
/eq/xxx/variables. If value of one variable is updated, only that variable is written to ODB. This
is much more efficient. (If variable is an array, the whole array is written, is variable is a
subdirectory, the whole subdirectory is written).
We considered even finer granularity, writing to history file only the one value that changed, but
decided against slicing the data too fine. (for arrays, MIDAS frontends usually update all values
of an array, as in "array of 10 temperatures" or "array of 4000 high voltages").
Many years later, we have the SQL history and the FILE history which do not have the 32-byte limit
on history event names and history tag names (no limit in the MIDAS C++ code. MySQL and PgSQL have
limits on table name and column name lengths, 64 bytes and 31 bytes respectively, best I can
tell).
But the API still uses the MIDAS "struct TAG" with the 32-byte tag name length limit.
It is pretty easy to change the API to use a new "struct TAG_CXX" with std::string unlimited-
length tag names, but the old MIDAS history will be unable to deal with long names. Hence
the discussion about removing the old MIDAS history and keeping only the FILE and SQL history
(plus the mhdump and mh2sql tools to convert old history files to the new formats).
(some code in mhttpd may need to be corrected for long history names. javascript code should be
okey, history plot code may need adjustment to display pathologically long names. use small font,
truncate, etc).
K.O. |