Back to Influxdb

Information Schema

content/shared/sql-reference/information-schema.md

latest5.8 KB
Original Source

The underlying query engine for the InfluxDB SQL implementation, DataFusion, provides commands that return metadata related to your data schema. To access this information, use the SHOW TABLES, SHOW COLUMNS, and SHOW ALL commands or query views in the ISO SQL information_schema schema.

In the context of InfluxDB, a measurement is represented as a table. Time, tags, and fields are each represented by columns in a table.

SHOW TABLES

Returns information about tables (measurements) in an InfluxDB bucket.

sql
SHOW TABLES

You can also query the information_schema.tables view:

sql
SELECT * FROM information_schema.tables

Example SHOW TABLES output

Measurements are those that use the iox table schema.

table_catalogtable_schematable_nametable_type
publicioxhomeBASE TABLE
publicsystemqueriesBASE TABLE
publicinformation_schematablesVIEW
publicinformation_schemaviewsVIEW
publicinformation_schemacolumnsVIEW
publicinformation_schemadf_settingsVIEW

SHOW COLUMNS

Returns information about the schema of a table (measurement) in an InfluxDB bucket.

sql
SHOW COLUMNS FROM example_table

You can also query the information_schema.columns view:

sql
SELECT
  table_catalog,
  table_schema,
  table_name,
  column_name,
  data_type,
  is_nullable
FROM information_schema.columns
WHERE table_name = 'example_table'

Example SHOW COLUMNS output

table_catalogtable_schematable_namecolumn_namedata_typeis_nullable
publicioxhomecoInt64YES
publicioxhomehumFloat64YES
publicioxhomeroomDictionary(Int32, Utf8)YES
publicioxhometempFloat64YES
publicioxhometimeTimestamp(Nanosecond, None)NO

SHOW ALL

Returns the configuration options of the current session.

sql
SHOW ALL

You can also query the information_schema.df_settings view:

sql
SELECT * FROM information_schema.df_settings

{{< expand-wrapper >}} {{% expand "View SHOW ALL example output" %}}

namesetting
datafusion.catalog.create_default_catalog_and_schematrue
datafusion.catalog.default_catalogpublic
datafusion.catalog.default_schemaiox
datafusion.catalog.format
datafusion.catalog.has_headerfalse
datafusion.catalog.information_schematrue
datafusion.catalog.location
datafusion.execution.batch_size8192
datafusion.execution.coalesce_batchestrue
datafusion.execution.collect_statisticsfalse
datafusion.execution.parquet.enable_page_indexfalse
datafusion.execution.parquet.metadata_size_hint
datafusion.execution.parquet.pruningtrue
datafusion.execution.parquet.pushdown_filterstrue
datafusion.execution.parquet.reorder_filterstrue
datafusion.execution.parquet.skip_metadatatrue
datafusion.execution.target_partitions4
datafusion.execution.time_zone+00:00
datafusion.explain.logical_plan_onlyfalse
datafusion.explain.physical_plan_onlyfalse
datafusion.optimizer.enable_round_robin_repartitiontrue
datafusion.optimizer.filter_null_join_keysfalse
datafusion.optimizer.hash_join_single_partition_threshold1048576
datafusion.optimizer.max_passes3
datafusion.optimizer.prefer_hash_jointrue
datafusion.optimizer.repartition_aggregationstrue
datafusion.optimizer.repartition_file_min_size10485760
datafusion.optimizer.repartition_file_scanstrue
datafusion.optimizer.repartition_joinstrue
datafusion.optimizer.repartition_sortsfalse
datafusion.optimizer.repartition_windowstrue
datafusion.optimizer.skip_failed_rulestrue
datafusion.optimizer.top_down_join_key_reorderingtrue
datafusion.sql_parser.enable_ident_normalizationtrue
datafusion.sql_parser.parse_float_as_decimalfalse

{{% /expand %}} {{< /expand-wrapper >}}