cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Data Tags vs Field

a-dub
3-Newcomer

Data Tags vs Field

Philosophical question for folks.

 

Why would you use data tagging (like in a stream) versus just adding a field to the datashape (effectively adding a new "column").

 

Is there additional functionality behind data tagging?

It doesn't seem faster to query using tags (vs just using "time"). 

Are there pros/cons to using one or the other?

 

I just don't really understand the point behind the data tags.

ACCEPTED SOLUTION

Accepted Solutions
Constantine
17-Peridot
(To:a-dub)

Hello @a-dub,

 

ThingWorx allocates a dedicated column for tags in the underlying SQL tables (you can see it for Streams, Things, etc.) This column is indexed and therefore the queries should be faster, compared to filtering by a "normal" field, which happens in memory once all data has been fetched.

 

Tags act similar to sets, e.g. you can add them without worrying about duplicates, and the platform also ensures that it works correctly for queries (you don't need to worry about your LIKE filter treating "testdata" together with "data", if you see what I mean)

 

/ Constantine

View solution in original post

2 REPLIES 2
Constantine
17-Peridot
(To:a-dub)

Hello @a-dub,

 

ThingWorx allocates a dedicated column for tags in the underlying SQL tables (you can see it for Streams, Things, etc.) This column is indexed and therefore the queries should be faster, compared to filtering by a "normal" field, which happens in memory once all data has been fetched.

 

Tags act similar to sets, e.g. you can add them without worrying about duplicates, and the platform also ensures that it works correctly for queries (you don't need to worry about your LIKE filter treating "testdata" together with "data", if you see what I mean)

 

/ Constantine

slangley
23-Emerald II
(To:a-dub)

Hi @a-dub.

 

If the previous response answered your question, please mark it as the Accepted Solution for the benefit of others with the same question.

 

Regards.

 

--Sharon

Announcements


Top Tags