Skip to content

Metadata schema_tables_by_schema

Metadata benchmark · all Metadata queries

Representative SQL

Rendered for DataFusion with default parameters.

SELECT
table_schema,
COUNT(*) AS table_count,
SUM(CASE WHEN table_type = 'BASE TABLE' THEN 1 ELSE 0 END) AS base_tables,
SUM(CASE WHEN table_type = 'VIEW' THEN 1 ELSE 0 END) AS views
FROM information_schema.tables
WHERE
NOT table_schema IN ('information_schema', 'pg_catalog')
GROUP BY
table_schema
ORDER BY
table_count DESC NULLS LAST

Representative DataFrame

No DataFrame implementation is registered for this query.

Get the exact query for your run

The blocks above are representative. To get the precise statement a specific platform runs at a specific scale, substitute your own values:

from benchbox import MetadataPrimitives
bench = MetadataPrimitives(scale_factor=1.0) # your scale factor
queries = bench.get_queries(dialect="datafusion") # your platform's dialect; drop dialect= for native SQL
print(queries['schema_tables_by_schema'])

Source

Query text: benchbox/core/metadata_primitives/queries.py