title: Grafana 8.1.1 - Postgresql Exception :- long series must be sorted ascending by time to be converted
body: <p>I am trying to fetch metrics from postgresql (timeseries) database in Grafana (Ver 8)  using below query .</p>
  <p>Just wondering its throwing below exception :-</p>
  <p><strong>failed to convert long to wide series when converting from dataframe: long series must be sorted ascending by time to be converted</strong></p>
  <pre><code>SELECT time, cpu_count,CASE WHEN step = 0 THEN 'Today' ELSE (-interval)::text END AS metric
  FROM
  -- sub-query to generate the intervals
  ( SELECT step, (step||'day')::interval AS interval FROM generate_series(0,3) g(step) order by interval asc) g_offsets 
  JOIN LATERAL (
  SELECT
  -- adding set interval to time values
    time_bucket('15m',time + interval )::timestamptz AS time, avg(limit_cpu) AS cpu_count FROM cpu_model 
  
  WHERE
    time BETWEEN $__timeFrom()::timestamptz - interval AND $__timeTo()::timestamptz - interval 
  GROUP BY 1
  ORDER BY 1,2 ASC
  ) l ON true
  </code></pre>
  <p>Would appreciate it if some one can help me to find the error or provide solution .</p>