# $\_\_interval variable is always 60.000s in TimescaleDB query

**URL:** <https://community.grafana.com/t/interval-variable-is-always-60-000s-in-timescaledb-query/161603>\
**Category:** Grafana\
**Tags:** timescaledb, query-help\
**Created:** [February 9, 2026, 10:25am UTC](https://community.grafana.com/t/interval-variable-is-always-60-000s-in-timescaledb-query/161603 "2026-02-09T10:25:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![nicolargo](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/nicolargo/32/4254_2.png) [@nicolargo](https://community.grafana.com/u/nicolargo)\
**Post date:** [February 9, 2026, 10:25am UTC](https://community.grafana.com/t/interval-variable-is-always-60-000s-in-timescaledb-query/161603/1 "2026-02-09T10:25:26Z")

</div>

Hi all,

i want to create a simple time series dashboard chart from a TimescaleDB database. For that, i use the $\_\_interval variable:

```sql
SELECT
  $__timeGroupAlias(ref_timestamp, $__interval),  
  AVG(value)
FROM database
WHERE $__timeFilter(ref_timestamp) AND tag = 'EXAMPLE'
GROUP BY time

```

In the query inspector, i see:

```sql
SELECT
  time_bucket('60.000s',ref_timestamp) AS "time",  
  AVG(value)
FROM database
WHERE ref_timestamp BETWEEN '2026-02-08T10:22:15.122Z' AND '2026-02-09T10:22:15.122Z' AND tag = 'EXAMPLE'
GROUP BY time

```

**Regardless of the time period** (30 minutes, 1 hour, 1 day…), the $\_\_interval is **always** translated to ‘60.000s’.

What i am do wrong ?

Thanks !

PS: i use Grafana v12.3.1

---

<div class="post-metadata">

**Author:** ![jangaraj](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/jangaraj/32/39197_2.png) [@jangaraj](https://community.grafana.com/u/jangaraj)\
**Post date:** [February 9, 2026, 12:24pm UTC](https://community.grafana.com/t/interval-variable-is-always-60-000s-in-timescaledb-query/161603/2 "2026-02-09T12:24:10Z")

</div>

What are your query options?:

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/3/b/3b62b17c9599e3d6ac1fb6200f8af8e0c988e6a4.png)

Or just create custom interval variable, where you can customize ‘auto’ option for your needs + still have option to select period explicitly, e.g.:

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/5/b/5be1165ee4d31842bab275ceeef3ad3bbfc3a8d7.png)

---

<div class="post-metadata">

**Author:** ![nicolargo](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/nicolargo/32/4254_2.png) [@nicolargo](https://community.grafana.com/u/nicolargo)\
**Post date:** [February 9, 2026, 1:02pm UTC](https://community.grafana.com/t/interval-variable-is-always-60-000s-in-timescaledb-query/161603/3 "2026-02-09T13:02:02Z")

</div>

Hi @jangaraj

Thanks for your help.

My query option are the default one:

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/d/2/d281e4d4b1ba7dd9aeee0ff801e0673d575eeb2f.png)

I try to change the Min interval field to 5s but it does not change Interval (alway computed to 1m). ☹

In the meanwhile i also configure a custom interval variable but only value \> 1m are available in the menu:

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/9/f/9fc6a412dcc760b8d0affe670576d7b869959bbb.png)

Is there any global configuration variable at Grafana level that can limit the minimum sampling period ?

---

<div class="post-metadata">

**Author:** ![jangaraj](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/jangaraj/32/39197_2.png) [@jangaraj](https://community.grafana.com/u/jangaraj)\
**Post date:** [February 9, 2026, 1:04pm UTC](https://community.grafana.com/t/interval-variable-is-always-60-000s-in-timescaledb-query/161603/4 "2026-02-09T13:04:45Z")

</div>

Did you configure that on the datasource level?

> **[Min time interval - Configure the PostgreSQL data source | Grafana documentation](https://grafana.com/docs/grafana/latest/datasources/postgres/configure/#min-time-interval)**
>
> This document provides instructions for configuring the PostgreSQL data source and explains available configuration options. For general information on managing data sources refer to Data source management. | This document provides instructions for...

---

<div class="post-metadata">

**Author:** ![nicolargo](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/nicolargo/32/4254_2.png) [@nicolargo](https://community.grafana.com/u/nicolargo)\
**Post date:** [February 9, 2026, 1:10pm UTC](https://community.grafana.com/t/interval-variable-is-always-60-000s-in-timescaledb-query/161603/5 "2026-02-09T13:10:53Z")

</div>

Nope, did not set anything:

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/9/1/9174920df7f249a843995388484bf86e03e71c4b.png)

Changing the default setting to 5s (my use case):

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/0/a/0aebd80a9d8f499c5bac60005d747607fa0f131f.png)

Do not change anything:

- custom interval variable only display value \>= 1m
- interval variable never return value \<1m

---

<div class="post-metadata">

**Author:** ![nicolargo](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/nicolargo/32/4254_2.png) [@nicolargo](https://community.grafana.com/u/nicolargo)\
**Post date:** [February 9, 2026, 6:07pm UTC](https://community.grafana.com/t/interval-variable-is-always-60-000s-in-timescaledb-query/161603/6 "2026-02-09T18:07:27Z")

</div>

After some test (recreating data source / dashboard), the last solution works.

[![](https://us1.discourse-cdn.com/grafana/original/3X/0/a/0aebd80a9d8f499c5bac60005d747607fa0f131f.png) ](https://us1.discourse-cdn.com/grafana/original/3X/0/a/0aebd80a9d8f499c5bac60005d747607fa0f131f.png)

Request are now done with a sampling of 5 seconds when needed.

Thanks @jangaraj !
