timescaledb/tsl/test/sql/include/data_fetcher_run.sql
niksa 02f7d7aa48 Fetch data using either cursor or row-by-row
This change introduces two ways of fetching data from data nodes: one
using cursors and another one using row-by-row mode.  The major
benefit of row-by-row mode is that it enables running parallel plans
on data nodes. The default data fetcher uses row-by-row mode. A new
GUC `timescaledb.remote_data_fetcher` has been added to enable
switching between these two implementations (rowbyrow or cursor).
2020-05-27 17:31:09 +02:00

13 lines
342 B
SQL

-- This file and its contents are licensed under the Timescale License.
-- Please see the included NOTICE for copyright information and
-- LICENSE-TIMESCALE for a copy of the license.
ANALYZE disttable;
SELECT count(*) FROM disttable;
SELECT time_bucket('1 hour', time) AS time, device, avg(temp)
FROM disttable
GROUP BY 1,2
ORDER BY 1,2;