Skip to content

insights: preserve pre-calculated time series during one time settings migration

Created by: coury-clark

During the one time OOB migration from settings -> database storage for code insights, we will change the format of the insight seriesId to a random string, instead of a hashed value from the query text. When this occurs, we will break the semantic link between the insight definition (insight_series) and the time series (series_points). We should try to preserve these pre-calculated time series at this time.

  1. Most likely it will be easy enough to just replace the series_id on the series_points table
update series_points set series_id = 'new' where series_id = 'old';
  1. We could also consider deprecating the series_id column on the series_points table, in favor if an integer reference to the insight. This is a bit more involved and has some questions such as should this reference be a constrained FK or an unconstrained key (ie. leave dangling time series?). However, since we are moving away from the hash of the query string, this may make more sense anyway - otherwise a dangling time series would never again be referencable.