System Tables
System tables are Metaform's built-in "catalog" for understanding the engine itself and the data it can see. They expose metadata (schemas, tables, columns, and files), configuration (system/session options, as well as boot parameters), ensemble state (nodes and connections), available SQL functions, and operational telemetry (query profiles, threads, and memory).
System Visibility
Table: sys.nodes
- Purpose: Shows every Node that is currently available.
Columns
| Column | Description |
|---|---|
hostname | The network host name of the Node. |
user_port | Port used for client connections (e.g., JDBC). |
control_port | Port used for inter-Node control messages and coordination. |
data_port | Port used for transferring data blocks between Nodes. |
http_port | Port for the Metaform Console and REST API access. |
current | Indicates whether this Node is the current leader in the cluster. |
version | The running Metaform software version on this Node. |
state | The operational state of the Node (e.g., ONLINE, OFFLINE, QUIESCENT). |
Example: Verify all Nodes are alive
SELECT hostname, `current` FROM sys.nodes;
💡 Troubleshooting Tip: If you expect three nodes and only see two, you’ve got a ensemble health issue. This table is often the first stop for troubleshooting.
Query Monitoring
Table: sys.profiles
Columns
| Column | Description |
|---|---|
queryId | Unique ID of the query |
startTime | Query start timestamp |
endTime | Query end timestamp |
totalTime | Wall-clock duration (endTime - startTime) |
Example: Inspect the most recent queries
SELECT `queryId`, `startTime`, `endTime`, `totalTime`
FROM sys.profiles
ORDER BY `startTime` DESC
LIMIT 5;
3. Functions and Built-ins
Metaform comes with over 3,000 functions covering a broad set of SQL functions. Discovering them is straightforward.
Table: sys.functions
- Columns:
name,signature,returnType.
Example: Search for count functions
SELECT name, signature, returnType
FROM sys.functions
WHERE name LIKE '%count%';
This is especially handy when you’re unsure of the exact spelling or return type.
4. Versioning
Table: sys.version
Every Metaform deployment reflects a specific version.
SELECT version
FROM sys.version;
Use this when reporting bugs or ensuring compatibility across clusters.
Putting It Together
System tables aren’t just reference material — they are diagnostic tools. A typical debugging workflow might look like this:
- Check
sys.nodesto ensure all nodes are online. - Dive into
sys.profilesfor completed queries to see where time was spent. - Use
sys.versionwhen reporting issues upstream.
By mastering these tables, you can move from guessing about Metaform's behavior to explaining and controlling it.