> ## Documentation Index
> Fetch the complete documentation index at: https://clickhouse.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> timeSeriesTimeRanges table function returns the time ranges table used by table `db_name.time_series_table` whose table engine is the TimeSeries engine.

# timeSeriesTimeRanges

`timeSeriesTimeRanges(db_name.time_series_table)` - Returns the [time ranges](/docs/reference/engines/table-engines/integrations/time-series#time-ranges-table) table
used by table `db_name.time_series_table` whose table engine is the [TimeSeries](/docs/reference/engines/table-engines/integrations/time-series) engine:

```sql theme={null}
CREATE TABLE db_name.time_series_table ENGINE=TimeSeries TIME RANGES time_ranges_table
```

The function also works if the *time ranges* table is inner:

```sql theme={null}
CREATE TABLE db_name.time_series_table ENGINE=TimeSeries TIME RANGES INNER UUID '01234567-89ab-cdef-0123-456789abcdef'
```

The following queries are equivalent:

```sql theme={null}
SELECT * FROM timeSeriesTimeRanges(db_name.time_series_table);
SELECT * FROM timeSeriesTimeRanges('db_name.time_series_table');
SELECT * FROM timeSeriesTimeRanges('db_name', 'time_series_table');
```

<Note>
  The *time ranges* table exists if the `store_time_ranges` setting is enabled.
  Tables of [version](/docs/reference/engines/table-engines/integrations/time-series#schema-versioning) 7 or earlier keep the columns `min_time` and `max_time`
  in the [tags](/docs/reference/engines/table-engines/integrations/time-series#tags-table) table.
</Note>
