Analytics
How _analytics
data is stored and can be queried
2 minute read
This function is an optimized version of get_asset_id
that is defined as immutable.
It is the fastest of the three functions and should be used for all queries, except when you plan to manually modify values inside the asset
table.
Example:
SELECT * FROM tag WHERE get_asset_id_immutable(
'<enterprise>',
'<site>',
'<area>',
'<line>',
'<workcell>',
'<origin_id>'
) LIMIT 1;
This function is an optimized version of get_asset_id
that is defined as stable.
It is a good choice over get_asset_id
for all queries.
Example:
SELECT * FROM tag WHERE get_asset_id_stable(
'<enterprise>',
'<site>',
'<area>',
'<line>',
'<workcell>',
'<origin_id>'
) LIMIT 1;
This function returns the id of the given asset. It takes a variable number of arguments, where only the first (enterprise) is mandatory. This function is only kept for compatibility reasons and should not be used in new queries, see get_asset_id_stable or get_asset_id_immutable instead.
Example:
SELECT * FROM tag WHERE get_asset_id(
'<enterprise>',
'<site>',
'<area>',
'<line>',
'<workcell>',
'<origin_id>'
) LIMIT 1;
This function is an optimized version of get_asset_ids
that is defined as stable.
It is a good choice over get_asset_ids
for all queries.
Example:
SELECT * FROM tag WHERE get_asset_ids_stable(
'<enterprise>',
'<site>',
'<area>',
'<line>',
'<workcell>',
'<origin_id>'
) LIMIT 1;
There is no immutable version of get_asset_ids
, as the returned values will probably change over time.
This function returns the ids of the given assets. It takes a variable number of arguments, where only the first (enterprise) is mandatory. It is only kept for compatibility reasons and should not be used in new queries, see get_asset_ids_stable instead.
Example:
SELECT * FROM tag WHERE get_asset_ids(
'<enterprise>',
'<site>',
'<area>',
'<line>',
'<workcell>',
'<origin_id>'
) LIMIT 1;
How _analytics
data is stored and can be queried
How _historian
data is stored and can be queried