Choosing Looker derived tables: LookML, SQL, and PDT operating criteria
A Looker derived table is a LookML view whose query result is treated like a database table. Consider a native derived table (NDT) when you want to reuse existing Explore fields and relationships; use a SQL-based derived table when direct SQL control is needed. Choose temporary calculation or persistent derived table (PDT) based on whether recomputing each request is acceptable or the result should be stored and reused.
A Looker derived table is a LookML view whose query result is treated like a database table. Consider a native derived table (NDT) when you want to reuse existing Explore fields and relationships; use a SQL-based derived table when direct SQL control is needed. Choose temporary calculation or persistent derived table (PDT) based on whether recomputing each request is acceptable or the result should be stored and reused.
This guide follows official Google Cloud Looker documentation read on 2026-11-19. Support and performance depend on database dialect, connection permissions, query design, and refresh cadence; verify them in the target deployment.
When a derived table helps
A derived table exposes a computed result as columns in a new view, such as each customer’s first order date and order count. Do not wrap every simple SELECT in a derived table: that can duplicate SQL and reduce LookML’s modular reuse and exploration flexibility. First ask whether ordinary LookML fields or existing views can express the logic.
Choose an implementation
| Form | Definition | Strength | Check |
|---|---|---|---|
| NDT | explore_source and LookML fields inside a view’s derived_table | Reuses model fields and Explore semantics | Base Explore, output columns, referenced fields, filter passing |
| SQL-based | Database SELECT in derived_table sql | Direct control of database SQL | SQL cannot directly refer to LookML dimension/measure names; assign stable column aliases |
Looker can generate a native table definition from an Explore using Get LookML. SQL Runner can help build a SQL-based definition. Some dialect-specific DDL cases use create_process or sql_create; these remain SQL-based and may have different incremental-PDT constraints.
Temporary versus persistent
A temporary derived table is not written as a separate table in the database. If a valid cached result is unavailable, the derived query runs when requested. Repeated expensive work can strain the database, so consider persistence when queries are slow and frequently reused.
A PDT is written to a database scratch schema and rebuilt according to a persistence strategy. Looker-managed choices include datagroup_trigger, sql_trigger_value, interval_trigger, and persist_for. If supported, a database-managed materialized view is another option. Persistence does not mean source changes appear immediately; agree on acceptable freshness and rebuild delay.
PDTs require dialect support, a scratch schema writable by the Looker database user, and Enable PDTs on the connection. With multiple Looker instances, use separate scratch schemas to avoid management conflicts. Read-only connections may not support PDTs.
Design and validate safely
Define the output grain: one row per customer, order, or another entity. Grain affects joins and later aggregation.
Search for reusable LookML fields or views. Record why SQL is necessary and who will maintain it.
For an NDT, confirm that the base Explore fields create the intended output columns. For SQL, give every returned column an explicit alias and reference it exactly in the view dimensions.
Validate LookML in development, inspect generated SQL, and compare a small sample with known source cases. Syntax validation alone does not establish business correctness or acceptable performance.
Benchmark the temporary query before choosing a PDT. Set persistence triggers to the data arrival pattern, and confirm dialect support and scratch-schema writes with an administrator.
Review and deploy through the normal process. Monitor PDT build state, latency, and freshness.
Troubleshooting
**A field is missing:** check derived output columns, NDT Explore/field references, SQL aliases, and view inclusion.
**PDT does not build:** check dialect support, Enable PDTs, scratch schema write permission, DDL limitations, trigger, and generated SQL.
**Data refresh is late:** inspect persistence strategy, trigger evaluation, datagroup, and source arrival time.
**Row count is unexpected:** recheck grain, duplicate keys, filters, and aggregation. If runtime filters must reach an NDT, verify the documented scope of bind_all_filters.
**Queries are slow:** investigate repeated temporary computation, data size, and dialect-specific indexing or partitioning with the database owner; do not generalize one dialect’s tuning to all systems.
Sources
[Derived tables in Looker](https://docs.cloud.google.com/looker/docs/derived-tables)
[SQL concepts for derived tables](https://docs.cloud.google.com/looker/docs/sql-experts-derived-tables)
[derived_table parameter](https://docs.cloud.google.com/looker/docs/reference/param-view-derived-table)
[Creating native derived tables](https://docs.cloud.google.com/looker/docs/creating-ndts)