Looker’s persistent derived tables (PDTs) functions enable you to perform complex analysis within Looker. Looker displays several admin features that can help track and troubleshoot PDT behavior on the Persistent Derived Tables page, which admins and users with the appropriate permissions can access from the Database section of Looker’s Admin panel. (See the Derived tables in Looker documentation page for information on troubleshooting PDTs.)
The Persistent Derived Tables page shows only the connections that have PDTs enabled and only the PDTs that meet the following criteria:
- The PDT is defined in a view file that is in production, unless you are in Development Mode, in which case you can use the Development tab to see the development version of persisted tables.
- The PDT is part of a model that is correctly configured.
- The PDT is part of a model for which you have data access.
Information on this page is based on an internal PDT event log, described in the PDT Event Log model section on this page.
Customizing the table
By default, the Persistent Derived Tables page displays a maximum of 25 PDTs on the page and loads PDTs for all connections for which you have data access on the Looker instance. There are several ways you can change the data that is displayed in the table:
- Click the arrow next to All Connections to view the PDTs from a specific connection only. The selector shows only connections that have PDTs enabled and to which you have data access.
- Type keywords in the search box to narrow the PDT list to PDTs whose names include the keyword. The table will show the PDTs with the matching search term in bold. Click the X in the search bar to clear your search query terms.
- Click the Filters icon to define a filter for the table.
- Click the close/open icon to display or hide the At a Glance section.
- Click on the name of a column to sort the table by that column. Click the column name a second time to reverse the sort order.
- Click on the Select columns to display icon to hide or display columns in the table.
- Click the arrows at the bottom of the page to navigate to the next or previous page (if the table is longer than a single page).
- Use the display selector to choose the number of results that are displayed on a single page.
You can use the Filters icon next to the search bar to choose which PDTs are shown on the Persistent Derived Tables page. For example, you can filter by Last Build Status to view only the PDTs that are experiencing a build error, or you can filter by Model to limit the PDTs that are shown to a specific model.
To filter the Persistent Derived Tables page:
- Click the Filters icon.
- Select a filter option from the first filter selector in the filter menu. The following options are available:
- Not Triggered in the Last — Filters the Persistent Derived Tables page by PDTs that have not been triggered in a specified number of hours and minutes.
- Triggered in the Last — Filters the Persistent Derived Tables page by PDTs that have been triggered in a specified number of hours and minutes.
- Model — Filters the Persistent Derived Tables page for PDTs included in a specified model.
- Persistence Rule — Filters the Persistent Derived Tables page by PDT persistence type.
- Last Attempt Status — Filters the Persistent Derived Tables page by a specified PDT status.
- Published as Stable View — A Boolean that filters the Persistent Derived Tables page for PDTs and displays Yes for PDTs that were published as a stable view, and No for PDTs that were not published as a stable view, as determined by their
- Last Build Duration Longer Than — Filters the Persistent Derived Tables page by PDTs whose builds took longer than a specified number of seconds.
- Project — Filters the Persistent Derived Tables page by PDTs from the specified LookML project.
- Choose the value on which you want to filter the Persistent Derived Tables page in the second filter selector. For the Not Triggered in the Last or Triggered in the Last options, enter a number of hours or minutes. For the Last Build Duration Longer Than option, enter a number of seconds.
- Click Add Filter to add more filters, and repeat steps 2 and 3 for each filter you are adding.
- To clear your filter selections and start over at any point, click Clear All.
- To remove any individual additional filters, click Clear above the filter you want to remove.
- To apply the selected filter criteria to the Persistent Derived Tables page, click Apply.
You will see the applied filters at the top of the Persistent Derived Tables page:
Click the X next to an applied filter to remove it from the Persistent Derived Tables page. Click Clear All to clear all filters.
Understanding the PDT page
The following sections describe the information on the Persistent Derived Tables page.
Production and Development tabs
If you are a LookML developer in Development Mode, the Persistent Derived Tables table will have two tabs:
The Production tab is selected by default and shows the production PDTs. These are the PDTs that have been deployed to production on your instance; these PDTs provide the data for your users’ Explore queries. (If you are in Production Mode or if you don’t have
developpermissions, the Persistent Derived Tables page will not display any tabs, and the page will show information for production PDTs only.)
The Development tab shows the development PDTs; these PDTs are created during development and have not yet been pushed to the production environment:
Looker creates a development PDT when a LookML developer in Development Mode makes changes that affect the data in the PDT or the way that the PDT is queried. These changes prompt Looker to create the development PDT, but Looker doesn’t actually build the PDT unless the PDT is queried after the changes are made. The Development tab can help you determine which development PDTs Looker has created and whether they have been built.
TIP: You can also view unbuilt PDTs in your project using the Looker IDE.
See the Derived tables in Looker documentation page for more information on what prompts Looker to create development PDTs and how long development PDTs are persisted on your database.
At a Glance section
The At a Glance section shows a visual summary of the status for the PDTs that are currently displayed in the PDT table. If you have defined filters for the table, or if you have used the arrow next to All Connections at the top of the page to narrow the table to a specific connection, the At a Glance section will narrow the results to match what is shown in the PDT table.
You can show or hide the At a Glance section by clicking the close/open icon at the top of the section.
The following sections describe the table columns on the Persistent Derived Tables page. You click the Select columns to display icon to hide or display some of the table columns. For more information, see the Customizing the table section on this page.
The PDT Name column displays the name of the PDT as defined in the
view parameter of the PDT’s LookML view file.
The PDT Name column displays this additional information under the PDT name, when applicable:
- Old Build indicates that the row is displaying information about an old PDT build. See the PDT Details pop-up in the Options menu for more information about this message.
- Incremental indicates that the PDT is an incremental PDT.
- Materialized View indicates that the PDT is a materialized view on your database.
Last Attempt Status
The Last Attempt Status column displays the status of the last attempt to build each listed PDT:
- regenerating indicates that the PDT can be queried and that there is an updated table currently building. A timestamp indicates when the PDT began building.
- success indicates that a PDT has successfully built.
- building indicates that a PDT is currently building and cannot be queried until the build is completed.
- not built indicates that a PDT is not currently built.
- build error indicates that an error has occurred during a build. You can click Build Error to see the error’s source and navigate to the PDT’s LookML if you have the appropriate permissions to see LookML. See the Options menu section on this page to learn more about troubleshooting PDTs from the Persistent Derived Tables page.
Last Attempted At
The Last Attempted At column indicates the time of the last attempted PDT build.
Last Successful Build
The Last Successful Build column indicates the time of the last successful PDT build.
Last Build Duration
The Last Build Duration column displays the amount of time in seconds that it took for the latest build of that PDT and how long it takes to build the PDT on average in seconds.
The Persistence Rule column displays the type of persistence applied to a PDT, as defined in the PDT’s view file. It also indicates the last time a successfully built PDT was checked (for trigger type PDTs) or when a successfully built PDT is due to expire (for persist type PDTs). There are two types of persistence displayed in the Persistence Rule column:
- Persist for: (time) is displayed for PDTs that are persisted with the
- Trigger: (datagroup name) is displayed for PDTs that are persisted with a
datagroup_triggerparameter. You can click the datagroup name link to view the
sql_triggervalue for the
- Trigger: SQL is displayed for PDTs that are persisted with a
sql_trigger_valueparameter. You can click the link to view the
- Materialized View is displayed for materialized views, which leverage your database’s functionality to persist derived tables on your database.
The Project column indicates the name of the LookML project where the PDT is defined.
If All Connections is selected from the connection select, the Connection column appears and displays the name of the connection on which the PDT is enabled.
The Model column displays the name of the model file in which the PDT’s view file is included.
If a PDT view file is included in multiple model files that share the same connection, multiple models will appear in the Model column. If a PDT view file is included in multiple model files with different connections, the PDT will also appear in other connection PDT lists.
It is important to be explicit when including view files in models, as including all view files may clutter your database schema and cause multiple copies of PDTs to build on your database, or on multiple databases.
The three-dot Options menu is especially useful for troubleshooting unexpected behavior. The options it presents allow you to check when tables were last built, check how long they took to build, compare the latest build time against the average build time, and check whether triggers are working correctly. You can select from:
- Go to LookML — Opens the view file in which the PDT is defined if you have the appropriate permissions to see LookML.
- PDT Activity Dashboard — Opens the PDT Activity dashboard, which is filtered to show activity for the selected PDT over the last four weeks.
- PDT Details — Opens a pop-up containing more information and statistics for a specific PDT. See the PDT details modal section on this page for more information.
See the Troubleshooting PDT regeneration Help Center article for more troubleshooting tips.
PDT details modal
Click the PDT Details option from the PDT’s three-dot Options menu to see the PDT details modal:
The information in the modal depends on the configuration of the PDT. Here is the information you may see:
- Table Name: The hash of the latest successfully built PDT.
- Model: The name of the model file in which the PDT’s view file is included.
- Stable Name: The name of the PDT’s stable database view on your database, if the PDT has been published as a stable view. You can publish a PDT as stable view on your database by adding the
publish_as_db_view: yesstatement to the derived table, or by using the
materialized_view: yesstatement to make the derived table a materialized view.
- Connection: The name of the connection on which the PDT is enabled.
- Old Build: A Boolean that displays Yes if a build is an old PDT build or No if it is not.
- Table Type: For old builds, this field appears and shows the table type. Values include Old Generation Table and Standin.
- Incremental PDT: A Boolean that displays Yes if a PDT is an incremental PDT or No if it is not.
- Status: Gives the Last Attempt Status. For failed builds, provides a SQL error message and a link to the model’s LookML if the user has the appropriate permissions to see LookML.
- Dependencies: Click the Show Dependency Graph button to display a relationship diagram of all derived tables that this PDT depends on. For larger dependency graphs, click the Open dependency graph in new tab link to see the graph outside of the PDT Details modal. Each node in the diagram corresponds to a derived table. The color of each node corresponds to that derived table’s status, as follows:
- A green node represents a PDT that has been sucessfully built.
- A yellow node represents a PDT that is currently building or incrementing.
- A red node represents a PDT that failed to build.
- A gray node represents a PDT that is not yet built.
- A white node represents a temporary derived table, which Looker does not build.
- Last Build:
- Latest Successful Build: The date and time of the most recent successful PDT build.
- Latest Build Duration: How long the most recent PDT build took (in seconds; displays – if the table has not yet been built).
- Average Build Duration: How long it takes to build the PDT on average (in seconds; displays – if the table has not yet been built).
- Build Reason: The reason a PDT was built (inception for an initial build; datagroup triggered if the PDT is persisted with a datagroup; trigger value change if the PDT’s SQL trigger value has changed).
- Increment Key: The
increment_keyparameter for PDTs that use incremental builds.
- Increment Offset: The
increment_offsetparameter for PDTs that use incremental builds.
- Increment Build Added/Removed Rows: The number of rows that were added to or removed from the table when the table was last incremented (displays – if no rows were added or removed when the table’s persistence strategy last triggered an increment).
- Last Attempted SQL: The SQL that was used to query the database to create the last build of the table.
- Persistence Rule:
- Type: The type of persistence that is used by the table. See the Persistence Rule column section on this page for possible values.
- Persist For: For Persist type PDTs, the persistence duration value. Not applicable for Trigger type PDTs.
- Datagroup: For datagroup trigger PDTs, gives the name of the datagroup.
- SQL code block: For datagroup and SQL trigger PDTs, the code block will show the trigger’s SQL statement. For datagroup triggers, this is the SQL for the
sql_triggerparameter of the datagroup. For SQL triggers, this is the SQL for the
- Trigger Value: For Trigger type PDTs, the value that triggered the PDT build (displays – for successfully built PDTs that are persisted with a
datagroup_trigger; to see the most recent trigger value for a datagroup, see the Datagroups page in the Admin panel).
- Last Checked: For Trigger type PDTs, when the trigger value was last checked.
- Expires: When the PDT expires, if applicable (not applicable for datagroup triggers).
PDT Activity dashboard
The PDT Activity dashboard shows information about the PDT, its rebuilds, and its queries:
The PDT Activity dashboard defaults to showing activity information from the previous four weeks. You can change the time period shown using the filter bar at the top of the dashboard. The PDT Activity dashboard includes tiles that show the following information:
- A summary of the PDT that includes the name of the LookML model and view that define the PDT, the name of the database connection that the PDT uses, the total number of the PDT’s successful and failed build attempts, and the percentage of total build attempts that were failures.
- The date and time of the most recent full rebuild of the PDT.
- If the PDT is an incremental PDT, the date and time of the most recent incremental rebuild of the PDT.
- If the PDT is an incremental PDT, the number of incremental rebuilds that have occurred since the most recent full rebuild.
- The average time taken to rebuild the PDT.
- A visualization showing all the create events that have occurred recently, grouped by a summary of the types of actions that caused the events.
- A list of all the PDT rebuilds that have occurred during the dashboard’s time period, including the date each rebuild was completed, the number of seconds taken to complete each rebuild, whether rebuilds were incremental builds, the trigger that caused each rebuild, and the number of PDT builds.
- A list of all failed rebuild attempts, including the date and time the failed rebuild began, the type of error that caused the failure, the error message, and the number of create failures.
- A list of all the PDT rebuild trigger events, including the event ID number, the date of the event, the type of event, and the data included with the trigger event.
- A list of all the PDT rebuild events, including the event ID number, the date of the event, the type of event, and the data included with the rebuild event.
- The number of queries that directly queried a field, grouped by the source of the query and the average runtime for each query source.
- The total number of queries run on the PDT.
- A list of all the PDT fields queried, including the LookML view and model in which the field is defined, the field name, the name of the Explore run that included the field, and the number of times the field was included in a query.
PDT Event Log model
Looker includes a pre-built model named
system_activity that allows easy exploration of the PDT event log, which is a table in a database connection’s temp schema that tracks the trigger and build activity of PDTs. You can access the model with the Recent Build Events and Recent Trigger Events links in the Options three-dot menu of the Persistent Derived Tables page, or from the Connections page in the Looker Admin panel. To access the PDT event log Explore from the Connections page, select the Show PDT Event Log option from the gear menu drop-down to the far right of each connection:
You can explore the model as with any other Looker Explore. When accessed from the Connections page, the PDT Event Log Explore is filtered for the entire connection. When accessed from the Persistent Derived Tables page, the PDT Event Log Explore is filtered for a specific PDT.
This is a brief guide to the available fields:
|Action||Describes the action that occurred; this may include regeneration, drop, creation, and reaping activity.|
See the Understanding PDT log actions documentation page for more information about viewing and understanding PDT log actions and their corresponding action data.
|Action Data||Provides more specific detail about an action, including the trigger being used, the value of a trigger, the expiration time for a persistent table, the cause of a rebuild, the text of an error message, and so on.|
See the Understanding PDT log actions documentation page for more information about viewing and understanding PDT log actions and their corresponding action data.
|Connection||The name of the connection that the derived table exists on.|
|Hash||Each derived table contains a hash of the SQL that was written to create it.|
|ID||The unique ID of the Looker instance that generated the PDT. In many cases, there will be only one Looker instance pointing at a database, so you will see only a single ID. However, if you have a staging instance, or something of that nature, you may see multiple IDs.|
|Model Name||The name of the model through which the table was generated.|
|Occur Date||The date and time the event occurred.|
|Occur Utc Display Date||The date and time the event occurred in UTC.|
|Sequence||A step number in the PDT build.|
|Short Hash||A truncated version of the hash of the SQL that was written to create the derived table.|
|Table Name||The full name of the PDT, including the table-type prefix, a hash, and the view name.|
|Tid||The transaction ID.|
|View Name||The view name for the derived table.|