It is usually best to rebuild persistent derived tables (PDTs) on a consistent schedule, using either a datagroup
or a sql_trigger_value
. However, to ensure that the table data is fresh, you might sometimes want to manually rebuild a derived table when you want to query it.
The Solution
You can rebuild a PDT from a Look or an Explore with fields from a PDT view selected by clicking the Rebuild Derived Tables & Run option from the gear icon in an Explore or a Look:
The Rebuild Derived Tables & Run option will appear when the following criteria are met:
- The user has the
develop
permission. - The query uses a PDT that has already been built and the query has finished running.
This approach will rebuild a derived table directly referenced in the query, as well as queue any children of the persistent derived table for the regenerator to rebuild.
Note: For Looker-hosted instances, manually rebuilding derived tables will only work if the table takes less than one hour to rebuild (if it takes longer to rebuild the table, the browser session will time out). See the Query Timeouts and Queueing Help Center article for more information about timeouts that may affect Looker processes.
Manually Rebuilding Tables — the Results
The user who clicks Rebuild Derived Tables & Run will need to wait for the PDT rebuild to finish before seeing the query results. Queries run by other users during this time will use the existing table. However, all user queries will use the new version of the table once it has completed rebuilding. Other users may also be impacted by the database strain that the rebuild may cause.
If a user clicks Rebuild Derived Tables & Run while in development mode, the production mode PDT will be affected as noted above if the SQL is identical. If the PDT in the user's development mode is different, then the production version of the PDT will not be affected.