View the original community article here
Last Tested: Nov 4, 2020
The regenerator's purpose is to manage the building of PDTs on the scratch schema. Its major tasks are to check datagroup triggers, build new PDTs that have been pushed to production and rebuild existing production PDTs whose trigger values have changed.
Number of Regenerator Threads:
Every connection has one regenerator thread. Since the regenerator is only a single thread, it can only perform one operation at a time. This means that it can only check a single trigger or build/rebuild a single PDT at a time (unless parallel PDTs are enabled on that connection, then multiple PDTs can be built at a time).
There is a maximum of 25 regenerator threads per instance. However, there is still only one thread per connection. This means that 25 PDTs could theoretically build simultaneously only if there were 25 different databases connected to the Looker instance. If there are more than 25 connections with PDTs enabled on an instance, multiple connections will share the same regenerator thread.
The regenerator runs on the schedule set in the `PDT And Datagroup Maintenance Schedule` section of the connection settings. The schedule is set using a cron expression. A cron expression is a string comprising five or six fields separated by white space that represents a set of times. The default value is every 5 minutes. More on cron expressions here.
Note: The `PDT And Datagroup Maintenance Schedule` setting will accept a cron string for a timeframe that is more frequent than every 5 minutes, however the regenerator will only run at most every 5 minutes.
1. Checking Datagroup Triggers
The regenerator first checks all datagroup triggers. Meaning it runs the sql of the
sql_trigger on the database. If the trigger value has changed from the value that is stored, it updates the value and marks the datagroup as ‘triggered’. After all datagroup triggers have been checked, the regenerator then moves on to building/rebuilding PDTs.
2. Building PDTs
For PDTs persisted with
sql_trigger_value, the regenerator first runs the trigger sql on the database. If the results of the trigger sql have changed since the previous run, the regenerator then rebuilds the PDT. If a PDT is persisted with a
datagroup, the regenerator first checks to see if that datagroup has been marked triggered. If the datagroup has been marked triggered the regenerator then rebuilds the PDT.
The order in which the regenerator builds/rebuilds PDT is random except that it rebuilds dependencies first.
See The PDT Build Process for information on the build process.