Documentation

STRINGSET data type

STRINGSET is a FeatureBase datatype used with TIMEQUANTUM and TTL (Time To Live) constraints.

DDL Syntax

STRINGSET [TIMEQUANTUM {value} [TTL '{value}']]

Arguments

Argument Description  
STRINGSET Data type used to set multiple STRING values for a single column.  
TIMEQUANTUM Create a view on IDSET and STRINGSET columns that allow range queries down to the specified time, measured as a sequential combination of Y,M,D,H. e.g. YMD. TIMEQUANTUM associates a time with each value in the column.  
TTL Used to reduce the growth of a data footprint by deleting older views after the stated amount<int> and unit h (hour), m (minute) or s (second) of time. Defaults to 0s  

Additional information

The STRINGSET data type:

  • has a keyed set internal datatype
  • one standard view by default unless a timeQuantum is set.
  • is used when:
    • grouping by
    • searching for discrete values

TIMEQUANTUM

TIMEQUANTUM creates a view of your data based on the specified time. This allows for lower latency queries at the cost of increased storage. For example, set TIMEQUANTUM to:

  • MD for queries that include a range of months
  • D for queries that include a small number of days

NOTE: Queries run on mismatched time granularities are slower but will function correctly. For example: Querying days on a IDSET or STRINGSET column with TIMEQUANTUM set to YM.

You can omit but not skip time granularity.

  • YM is valid
  • YH is invalid

TIMEQUANTUM is used when:

  • times need to be associated with column data for query purposes
  • database space is not at a premium

TTL (Time To Live)

NOTE: FeatureBase recommends using a TTL of 1h or more to improve results.

  • TTL enables the deletion of time views where a time range exceeds the stated Time To Live.
  • The default TTL of 0s indicates TIMEQUANTUM views will not be deleted.
  • TTL runs:
    • when FeatureBase starts and every hour to make view deletion consistent
    • are not guaranteed to run at a specific time
  • error: unknown unit is generated if an incorrect value is used (e.g., TTL is set to 60second)

  • TTL should not be used if you require complete and consistent historical data.

TTL order of events

This example demonstrates the deletion dates of three column views where TTL is set to 30d

View date ttl date of deletion Explanation
2022 January 30, 2023 Date assumed to be end of 2022
2022-09 October 30, 2022 Date assumed to be end of September
2022-09-02 October 2, 2022 Deletion after 30 days as intended
Something missing or incorrect?
Help improve this article or join us on Discord!

© 2022 Molecula Corp. (DBA FeatureBase). All rights reserved.