|previous : next|
Available in versions: Dev (3.19)
This documentation is for the unreleased development version of jOOQ. Click on the above version links to get this documentation for a supported version of jOOQ.
Applies to ✅ Open Source Edition ✅ Express Edition ✅ Professional Edition ✅ Enterprise Edition
VIEW can be marked as
MATERIALIZED, which means that its data as defined by
SELECT * FROM view is stored on disk for faster retrieval, and synchronised with underlying tables either immediately when those tables are changed (similar to an index), or upon request (similar to a cache that is allowed to be stale).
// Create a new view create.createMaterializedView("authors", "author_id", "first_name", "last_name") .as(select(AUTHOR.ID, AUTHOR.FIRST_NAME, AUTHOR.LAST_NAME) .from(AUTHOR)) .execute();
This example using jOOQ:
Translates to the following dialect specific expressions:
-- BIGQUERY, COCKROACHDB, ORACLE, POSTGRES, REDSHIFT, SNOWFLAKE, SYBASE, TERADATA, YUGABYTEDB CREATE MATERIALIZED VIEW a(id) AS SELECT AUTHOR.ID FROM AUTHOR -- ACCESS, ASE, AURORA_MYSQL, AURORA_POSTGRES, DB2, DERBY, DUCKDB, EXASOL, FIREBIRD, H2, HANA, HSQLDB, INFORMIX, MARIADB, -- MEMSQL, MYSQL, SQLDATAWAREHOUSE, SQLITE, SQLSERVER, TRINO, VERTICA /* UNSUPPORTED */