What is the System Catalog?
The system catalog is a collection of schemas that expose metadata about your Materialize instance. It contains information about all database objects including sources, tables, views, materialized views, indexes, sinks, clusters, and more. The system catalog is automatically available in all databases and provides multiple interfaces for querying metadata:mz_catalog- Materialize’s native catalog format (recommended)information_schema- SQL standard interface for compatibilitypg_catalog- PostgreSQL-compatible interfacemz_internal- Internal metadata (unstable, may change)mz_introspection- Replica introspection and performance data
Why Use the System Catalog?
The system catalog is essential for:- Discovery: Find existing objects and understand your database structure
- Monitoring: Track resource usage, data freshness, and ingestion progress
- Debugging: Investigate query performance and dataflow dependencies
- Automation: Build tools that programmatically inspect and manage your database
- Auditing: Review object ownership, privileges, and change history
Querying the System Catalog
All system catalog schemas are implicitly available. You can query them directly without any special setup:Which Schema Should I Use?
Usemz_catalog whenever possible. It provides the most accurate and complete representation of Materialize concepts.
mz_catalog: Best for Materialize-native applications. Contains all metadata in Materialize’s native format.information_schema: Use for SQL standard compatibility. Incomplete but useful for tools expecting standard SQL schemas.pg_catalog: Use for PostgreSQL tool compatibility. Maps Materialize concepts to PostgreSQL equivalents where possible.mz_internal: Advanced use only. Unstable and may change without notice.mz_introspection: Performance monitoring and dataflow introspection.
Common Catalog Queries
Inspect Database Structure
Monitor Data Freshness
Track Resource Usage
Inspect Dependencies
Audit and Security
Important Considerations
Column Projection Required
When creating views that reference system catalog tables, you must explicitly list columns.SELECT * and NATURAL JOIN are not supported:
Performance Considerations
Most catalog views are lightweight, but some (likemz_storage_usage) scan large amounts of data:
- Use
mz_recent_storage_usageinstead ofmz_storage_usagewhen you only need current data - Add filters (
WHEREclauses) to limit result sets - Be cautious when joining multiple large catalog tables
Next Steps
mz_catalog Reference
Detailed reference for all mz_catalog tables and views
information_schema Reference
SQL standard system catalog interface