diff --git a/sql/chunk.sql b/sql/chunk.sql index 50ead1380a7..2aef03569a2 100644 --- a/sql/chunk.sql +++ b/sql/chunk.sql @@ -15,32 +15,32 @@ -- -- The function should return the new interval in dimension-specific -- time (ususally microseconds). -CREATE OR REPLACE FUNCTION _timescaledb_internal.calculate_chunk_interval( +CREATE OR REPLACE FUNCTION _timescaledb_functions.calculate_chunk_interval( dimension_id INTEGER, dimension_coord BIGINT, chunk_target_size BIGINT ) RETURNS BIGINT AS '@MODULE_PATHNAME@', 'ts_calculate_chunk_interval' LANGUAGE C; -- Get the status of the chunk -CREATE OR REPLACE FUNCTION _timescaledb_internal.chunk_status(REGCLASS) RETURNS INT +CREATE OR REPLACE FUNCTION _timescaledb_functions.chunk_status(REGCLASS) RETURNS INT AS '@MODULE_PATHNAME@', 'ts_chunk_status' LANGUAGE C; -- Function for explicit chunk exclusion. Supply a record and an array -- of chunk ids as input. -- Intended to be used in WHERE clause. --- An example: SELECT * FROM hypertable WHERE _timescaledb_internal.chunks_in(hypertable, ARRAY[1,2]); +-- An example: SELECT * FROM hypertable WHERE _timescaledb_functions.chunks_in(hypertable, ARRAY[1,2]); -- -- Use it with care as this function directly affects what chunks are being scanned for data. -- This is a marker function and should never be executed (we remove it from the plan) -CREATE OR REPLACE FUNCTION _timescaledb_internal.chunks_in(record RECORD, chunks INTEGER[]) RETURNS BOOL +CREATE OR REPLACE FUNCTION _timescaledb_functions.chunks_in(record RECORD, chunks INTEGER[]) RETURNS BOOL AS '@MODULE_PATHNAME@', 'ts_chunks_in' LANGUAGE C STABLE STRICT PARALLEL SAFE; --given a chunk's relid, return the id. Error out if not a chunk relid. -CREATE OR REPLACE FUNCTION _timescaledb_internal.chunk_id_from_relid(relid OID) RETURNS INTEGER +CREATE OR REPLACE FUNCTION _timescaledb_functions.chunk_id_from_relid(relid OID) RETURNS INTEGER AS '@MODULE_PATHNAME@', 'ts_chunk_id_from_relid' LANGUAGE C STABLE STRICT PARALLEL SAFE; -- Show the definition of a chunk. -CREATE OR REPLACE FUNCTION _timescaledb_internal.show_chunk(chunk REGCLASS) +CREATE OR REPLACE FUNCTION _timescaledb_functions.show_chunk(chunk REGCLASS) RETURNS TABLE(chunk_id INTEGER, hypertable_id INTEGER, schema_name NAME, table_name NAME, relkind "char", slices JSONB) AS '@MODULE_PATHNAME@', 'ts_chunk_show' LANGUAGE C VOLATILE; @@ -50,7 +50,7 @@ AS '@MODULE_PATHNAME@', 'ts_chunk_show' LANGUAGE C VOLATILE; -- chunk. Note that schema_name and table_name need not be the same as -- the existing schema and name for chunk_table. The provided chunk -- table will be renamed and/or moved as necessary. -CREATE OR REPLACE FUNCTION _timescaledb_internal.create_chunk( +CREATE OR REPLACE FUNCTION _timescaledb_functions.create_chunk( hypertable REGCLASS, slices JSONB, schema_name NAME = NULL, @@ -60,43 +60,43 @@ RETURNS TABLE(chunk_id INTEGER, hypertable_id INTEGER, schema_name NAME, table_n AS '@MODULE_PATHNAME@', 'ts_chunk_create' LANGUAGE C VOLATILE; -- change default data node for a chunk -CREATE OR REPLACE FUNCTION _timescaledb_internal.set_chunk_default_data_node(chunk REGCLASS, node_name NAME) RETURNS BOOLEAN +CREATE OR REPLACE FUNCTION _timescaledb_functions.set_chunk_default_data_node(chunk REGCLASS, node_name NAME) RETURNS BOOLEAN AS '@MODULE_PATHNAME@', 'ts_chunk_set_default_data_node' LANGUAGE C VOLATILE; -- Get chunk stats. -CREATE OR REPLACE FUNCTION _timescaledb_internal.get_chunk_relstats(relid REGCLASS) +CREATE OR REPLACE FUNCTION _timescaledb_functions.get_chunk_relstats(relid REGCLASS) RETURNS TABLE(chunk_id INTEGER, hypertable_id INTEGER, num_pages INTEGER, num_tuples REAL, num_allvisible INTEGER) AS '@MODULE_PATHNAME@', 'ts_chunk_get_relstats' LANGUAGE C VOLATILE; -CREATE OR REPLACE FUNCTION _timescaledb_internal.get_chunk_colstats(relid REGCLASS) +CREATE OR REPLACE FUNCTION _timescaledb_functions.get_chunk_colstats(relid REGCLASS) RETURNS TABLE(chunk_id INTEGER, hypertable_id INTEGER, att_num INTEGER, nullfrac REAL, width INTEGER, distinctval REAL, slotkind INTEGER[], slotopstrings CSTRING[], slotcollations OID[], slot1numbers FLOAT4[], slot2numbers FLOAT4[], slot3numbers FLOAT4[], slot4numbers FLOAT4[], slot5numbers FLOAT4[], slotvaluetypetrings CSTRING[], slot1values CSTRING[], slot2values CSTRING[], slot3values CSTRING[], slot4values CSTRING[], slot5values CSTRING[]) AS '@MODULE_PATHNAME@', 'ts_chunk_get_colstats' LANGUAGE C VOLATILE; -CREATE OR REPLACE FUNCTION _timescaledb_internal.create_chunk_table( +CREATE OR REPLACE FUNCTION _timescaledb_functions.create_chunk_table( hypertable REGCLASS, slices JSONB, schema_name NAME, table_name NAME) RETURNS BOOL AS '@MODULE_PATHNAME@', 'ts_chunk_create_empty_table' LANGUAGE C VOLATILE; -CREATE OR REPLACE FUNCTION _timescaledb_internal.freeze_chunk( +CREATE OR REPLACE FUNCTION _timescaledb_functions.freeze_chunk( chunk REGCLASS) RETURNS BOOL AS '@MODULE_PATHNAME@', 'ts_chunk_freeze_chunk' LANGUAGE C VOLATILE; -CREATE OR REPLACE FUNCTION _timescaledb_internal.unfreeze_chunk( +CREATE OR REPLACE FUNCTION _timescaledb_functions.unfreeze_chunk( chunk REGCLASS) RETURNS BOOL AS '@MODULE_PATHNAME@', 'ts_chunk_unfreeze_chunk' LANGUAGE C VOLATILE; --wrapper for ts_chunk_drop --drops the chunk table and its entry in the chunk catalog -CREATE OR REPLACE FUNCTION _timescaledb_internal.drop_chunk( +CREATE OR REPLACE FUNCTION _timescaledb_functions.drop_chunk( chunk REGCLASS) RETURNS BOOL AS '@MODULE_PATHNAME@', 'ts_chunk_drop_single_chunk' LANGUAGE C VOLATILE; -- internal API used by OSM extension to attach a table as a chunk of the hypertable -CREATE OR REPLACE FUNCTION _timescaledb_internal.attach_osm_table_chunk( +CREATE OR REPLACE FUNCTION _timescaledb_functions.attach_osm_table_chunk( hypertable REGCLASS, chunk REGCLASS) RETURNS BOOL AS '@MODULE_PATHNAME@', 'ts_chunk_attach_osm_table_chunk' LANGUAGE C VOLATILE; diff --git a/sql/ddl_api.sql b/sql/ddl_api.sql index 65bf687e5a6..36c565c5ca3 100644 --- a/sql/ddl_api.sql +++ b/sql/ddl_api.sql @@ -36,7 +36,7 @@ CREATE OR REPLACE FUNCTION @extschema@.create_hypertable( partitioning_func REGPROC = NULL, migrate_data BOOLEAN = FALSE, chunk_target_size TEXT = NULL, - chunk_sizing_func REGPROC = '_timescaledb_internal.calculate_chunk_interval'::regproc, + chunk_sizing_func REGPROC = '_timescaledb_functions.calculate_chunk_interval'::regproc, time_partitioning_func REGPROC = NULL, replication_factor INTEGER = NULL, data_nodes NAME[] = NULL, @@ -56,7 +56,7 @@ CREATE OR REPLACE FUNCTION @extschema@.create_distributed_hypertable( partitioning_func REGPROC = NULL, migrate_data BOOLEAN = FALSE, chunk_target_size TEXT = NULL, - chunk_sizing_func REGPROC = '_timescaledb_internal.calculate_chunk_interval'::regproc, + chunk_sizing_func REGPROC = '_timescaledb_functions.calculate_chunk_interval'::regproc, time_partitioning_func REGPROC = NULL, replication_factor INTEGER = NULL, data_nodes NAME[] = NULL @@ -66,7 +66,7 @@ CREATE OR REPLACE FUNCTION @extschema@.create_distributed_hypertable( CREATE OR REPLACE FUNCTION @extschema@.set_adaptive_chunking( hypertable REGCLASS, chunk_target_size TEXT, - INOUT chunk_sizing_func REGPROC = '_timescaledb_internal.calculate_chunk_interval'::regproc, + INOUT chunk_sizing_func REGPROC = '_timescaledb_functions.calculate_chunk_interval'::regproc, OUT chunk_target_size BIGINT ) RETURNS RECORD AS '@MODULE_PATHNAME@', 'ts_chunk_adaptive_set' LANGUAGE C VOLATILE; diff --git a/sql/maintenance_utils.sql b/sql/maintenance_utils.sql index 7fc92129315..6181cd7e1b1 100644 --- a/sql/maintenance_utils.sql +++ b/sql/maintenance_utils.sql @@ -75,7 +75,7 @@ BEGIN -- control so we adjust search_path in procedure body SET LOCAL search_path TO pg_catalog, pg_temp; - status := _timescaledb_internal.chunk_status(chunk); + status := _timescaledb_functions.chunk_status(chunk); -- Chunk names are in the internal catalog, but we only care about -- the chunk name here. diff --git a/sql/updates/latest-dev.sql b/sql/updates/latest-dev.sql index d75733cf82d..e46af9caec7 100644 --- a/sql/updates/latest-dev.sql +++ b/sql/updates/latest-dev.sql @@ -47,9 +47,39 @@ BEGIN THEN ALTER FUNCTION _timescaledb_internal.get_approx_row_count(regclass) SET SCHEMA _timescaledb_functions; END IF; + IF (EXISTS (SELECT FROM pg_proc WHERE proname = 'chunk_status' AND pronamespace='_timescaledb_internal'::regnamespace)) + THEN + ALTER FUNCTION _timescaledb_internal.chunk_status(regclass) SET SCHEMA _timescaledb_functions; + END IF; + IF (EXISTS (SELECT FROM pg_proc WHERE proname = 'create_chunk' AND pronamespace='_timescaledb_internal'::regnamespace)) + THEN + ALTER FUNCTION _timescaledb_internal.create_chunk(regclass, jsonb, name, name, regclass) SET SCHEMA _timescaledb_functions; + END IF; + IF (EXISTS (SELECT FROM pg_proc WHERE proname = 'create_chunk_table' AND pronamespace='_timescaledb_internal'::regnamespace)) + THEN + ALTER FUNCTION _timescaledb_internal.create_chunk_table(regclass, jsonb, name, name) SET SCHEMA _timescaledb_functions; + END IF; + IF (EXISTS (SELECT FROM pg_proc WHERE proname = 'freeze_chunk' AND pronamespace='_timescaledb_internal'::regnamespace)) + THEN + ALTER FUNCTION _timescaledb_internal.freeze_chunk(regclass) SET SCHEMA _timescaledb_functions; + END IF; + IF (EXISTS (SELECT FROM pg_proc WHERE proname = 'unfreeze_chunk' AND pronamespace='_timescaledb_internal'::regnamespace)) + THEN + ALTER FUNCTION _timescaledb_internal.unfreeze_chunk(regclass) SET SCHEMA _timescaledb_functions; + END IF; + IF (EXISTS (SELECT FROM pg_proc WHERE proname = 'drop_chunk' AND pronamespace='_timescaledb_internal'::regnamespace)) + THEN + ALTER FUNCTION _timescaledb_internal.drop_chunk(regclass) SET SCHEMA _timescaledb_functions; + END IF; + IF (EXISTS (SELECT FROM pg_proc WHERE proname = 'attach_osm_table_chunk' AND pronamespace='_timescaledb_internal'::regnamespace)) + THEN + ALTER FUNCTION _timescaledb_internal.attach_osm_table_chunk(regclass, regclass) SET SCHEMA _timescaledb_functions; + END IF; END; $$; +DROP FUNCTION IF EXISTS _timescaledb_internal.get_time_type(integer); + ALTER FUNCTION _timescaledb_internal.insert_blocker() SET SCHEMA _timescaledb_functions; ALTER FUNCTION _timescaledb_internal.continuous_agg_invalidation_trigger() SET SCHEMA _timescaledb_functions; ALTER FUNCTION _timescaledb_internal.get_create_command(name) SET SCHEMA _timescaledb_functions; @@ -89,5 +119,13 @@ ALTER FUNCTION _timescaledb_internal.get_git_commit() SET SCHEMA _timescaledb_fu ALTER FUNCTION _timescaledb_internal.get_os_info() SET SCHEMA _timescaledb_functions; ALTER FUNCTION _timescaledb_internal.tsl_loaded() SET SCHEMA _timescaledb_functions; -DROP FUNCTION IF EXISTS _timescaledb_internal.get_time_type(integer); +ALTER FUNCTION _timescaledb_internal.calculate_chunk_interval(int, bigint, bigint) SET SCHEMA _timescaledb_functions; +ALTER FUNCTION _timescaledb_internal.chunks_in(record, integer[]) SET SCHEMA _timescaledb_functions; +ALTER FUNCTION _timescaledb_internal.chunk_id_from_relid(oid) SET SCHEMA _timescaledb_functions; +ALTER FUNCTION _timescaledb_internal.show_chunk(regclass) SET SCHEMA _timescaledb_functions; +ALTER FUNCTION _timescaledb_internal.set_chunk_default_data_node(regclass, name) SET SCHEMA _timescaledb_functions; +ALTER FUNCTION _timescaledb_internal.get_chunk_relstats(regclass) SET SCHEMA _timescaledb_functions; +ALTER FUNCTION _timescaledb_internal.get_chunk_colstats(regclass) SET SCHEMA _timescaledb_functions; + +UPDATE _timescaledb_catalog.hypertable SET chunk_sizing_func_schema = '_timescaledb_functions' WHERE chunk_sizing_func_schema = '_timescaledb_internal' AND chunk_sizing_func_name = 'calculate_chunk_interval'; diff --git a/sql/updates/reverse-dev.sql b/sql/updates/reverse-dev.sql index 91c53fd9678..03d336c9355 100644 --- a/sql/updates/reverse-dev.sql +++ b/sql/updates/reverse-dev.sql @@ -73,3 +73,20 @@ ALTER FUNCTION _timescaledb_functions.get_git_commit() SET SCHEMA _timescaledb_i ALTER FUNCTION _timescaledb_functions.get_os_info() SET SCHEMA _timescaledb_internal; ALTER FUNCTION _timescaledb_functions.tsl_loaded() SET SCHEMA _timescaledb_internal; +ALTER FUNCTION _timescaledb_functions.calculate_chunk_interval(int, bigint, bigint) SET SCHEMA _timescaledb_internal; +ALTER FUNCTION _timescaledb_functions.chunk_status(regclass) SET SCHEMA _timescaledb_internal; +ALTER FUNCTION _timescaledb_functions.chunks_in(record, integer[]) SET SCHEMA _timescaledb_internal; +ALTER FUNCTION _timescaledb_functions.chunk_id_from_relid(oid) SET SCHEMA _timescaledb_internal; +ALTER FUNCTION _timescaledb_functions.show_chunk(regclass) SET SCHEMA _timescaledb_internal; +ALTER FUNCTION _timescaledb_functions.create_chunk(regclass, jsonb, name, name, regclass) SET SCHEMA _timescaledb_internal; +ALTER FUNCTION _timescaledb_functions.set_chunk_default_data_node(regclass, name) SET SCHEMA _timescaledb_internal; +ALTER FUNCTION _timescaledb_functions.get_chunk_relstats(regclass) SET SCHEMA _timescaledb_internal; +ALTER FUNCTION _timescaledb_functions.get_chunk_colstats(regclass) SET SCHEMA _timescaledb_internal; +ALTER FUNCTION _timescaledb_functions.create_chunk_table(regclass, jsonb, name, name) SET SCHEMA _timescaledb_internal; +ALTER FUNCTION _timescaledb_functions.freeze_chunk(regclass) SET SCHEMA _timescaledb_internal; +ALTER FUNCTION _timescaledb_functions.unfreeze_chunk(regclass) SET SCHEMA _timescaledb_internal; +ALTER FUNCTION _timescaledb_functions.drop_chunk(regclass) SET SCHEMA _timescaledb_internal; +ALTER FUNCTION _timescaledb_functions.attach_osm_table_chunk(regclass, regclass) SET SCHEMA _timescaledb_internal; + +UPDATE _timescaledb_catalog.hypertable SET chunk_sizing_func_schema = '_timescaledb_internal' WHERE chunk_sizing_func_schema = '_timescaledb_functions' AND chunk_sizing_func_name = 'calculate_chunk_interval'; + diff --git a/src/chunk_adaptive.c b/src/chunk_adaptive.c index 5be90ddd5b2..02cfee6a86c 100644 --- a/src/chunk_adaptive.c +++ b/src/chunk_adaptive.c @@ -814,7 +814,7 @@ get_default_chunk_sizing_fn_oid() { Oid chunkfnargtypes[] = { INT4OID, INT8OID, INT8OID }; List *funcname = - list_make2(makeString(INTERNAL_SCHEMA_NAME), makeString(DEFAULT_CHUNK_SIZING_FN_NAME)); + list_make2(makeString(FUNCTIONS_SCHEMA_NAME), makeString(DEFAULT_CHUNK_SIZING_FN_NAME)); int nargs = sizeof(chunkfnargtypes) / sizeof(chunkfnargtypes[0]); Oid chunkfnoid = LookupFuncName(funcname, nargs, chunkfnargtypes, false); return chunkfnoid; diff --git a/src/planner/expand_hypertable.c b/src/planner/expand_hypertable.c index 967be28c52a..5ea1c70960a 100644 --- a/src/planner/expand_hypertable.c +++ b/src/planner/expand_hypertable.c @@ -82,7 +82,7 @@ init_chunk_exclusion_func() { if (!OidIsValid(chunk_exclusion_func)) { - List *l = list_make2(makeString(INTERNAL_SCHEMA_NAME), makeString(CHUNK_EXCL_FUNC_NAME)); + List *l = list_make2(makeString(FUNCTIONS_SCHEMA_NAME), makeString(CHUNK_EXCL_FUNC_NAME)); chunk_exclusion_func = LookupFuncName(l, lengthof(ts_chunks_arg_types), ts_chunks_arg_types, false); } diff --git a/test/expected/alter.out b/test/expected/alter.out index f0cc457e424..3c711c6ae2d 100644 --- a/test/expected/alter.out +++ b/test/expected/alter.out @@ -677,7 +677,7 @@ INSERT INTO my_table (date, quantity) VALUES ('2018-08-10T23:00:00+00:00', 20); SELECT * from _timescaledb_catalog.hypertable; id | schema_name | table_name | associated_schema_name | associated_table_prefix | num_dimensions | chunk_sizing_func_schema | chunk_sizing_func_name | chunk_target_size | compression_state | compressed_hypertable_id | replication_factor ----+-------------+------------+------------------------+-------------------------+----------------+--------------------------+--------------------------+-------------------+-------------------+--------------------------+-------------------- - 12 | public | my_table | new_associated_schema | _hyper_12 | 1 | _timescaledb_internal | calculate_chunk_interval | 0 | 0 | | + 12 | public | my_table | new_associated_schema | _hyper_12 | 1 | _timescaledb_functions | calculate_chunk_interval | 0 | 0 | | (1 row) SELECT * from _timescaledb_catalog.chunk; diff --git a/test/expected/alternate_users.out b/test/expected/alternate_users.out index 7867e39311f..7f76da07bac 100644 --- a/test/expected/alternate_users.out +++ b/test/expected/alternate_users.out @@ -137,10 +137,10 @@ SELECT * FROM create_hypertable('"customSchema"."Hypertable_1"', 'time', NULL, 1 SELECT * FROM _timescaledb_catalog.hypertable; id | schema_name | table_name | associated_schema_name | associated_table_prefix | num_dimensions | chunk_sizing_func_schema | chunk_sizing_func_name | chunk_target_size | compression_state | compressed_hypertable_id | replication_factor ----+--------------+---------------+------------------------+-------------------------+----------------+--------------------------+--------------------------+-------------------+-------------------+--------------------------+-------------------- - 1 | public | one_Partition | one_Partition | _hyper_1 | 1 | _timescaledb_internal | calculate_chunk_interval | 0 | 0 | | - 2 | public | 1dim | _timescaledb_internal | _hyper_2 | 1 | _timescaledb_internal | calculate_chunk_interval | 0 | 0 | | - 3 | public | Hypertable_1 | _timescaledb_internal | _hyper_3 | 2 | _timescaledb_internal | calculate_chunk_interval | 0 | 0 | | - 4 | customSchema | Hypertable_1 | _timescaledb_internal | _hyper_4 | 1 | _timescaledb_internal | calculate_chunk_interval | 0 | 0 | | + 1 | public | one_Partition | one_Partition | _hyper_1 | 1 | _timescaledb_functions | calculate_chunk_interval | 0 | 0 | | + 2 | public | 1dim | _timescaledb_internal | _hyper_2 | 1 | _timescaledb_functions | calculate_chunk_interval | 0 | 0 | | + 3 | public | Hypertable_1 | _timescaledb_internal | _hyper_3 | 2 | _timescaledb_functions | calculate_chunk_interval | 0 | 0 | | + 4 | customSchema | Hypertable_1 | _timescaledb_internal | _hyper_4 | 1 | _timescaledb_functions | calculate_chunk_interval | 0 | 0 | | (4 rows) CREATE INDEX ON PUBLIC."Hypertable_1" (time, "temp_c"); diff --git a/test/expected/chunk_adaptive.out b/test/expected/chunk_adaptive.out index 0814b47fbf3..307f16142ee 100644 --- a/test/expected/chunk_adaptive.out +++ b/test/expected/chunk_adaptive.out @@ -1,11 +1,11 @@ -- This file and its contents are licensed under the Apache License 2.0. -- Please see the included NOTICE for copyright information and -- LICENSE-APACHE for a copy of the license. --- test error handling _timescaledb_internal.calculate_chunk_interval +-- test error handling _timescaledb_functions.calculate_chunk_interval \set ON_ERROR_STOP 0 -SELECT _timescaledb_internal.calculate_chunk_interval(0,0,-0); +SELECT _timescaledb_functions.calculate_chunk_interval(0,0,-0); ERROR: could not find a matching hypertable for dimension 0 -SELECT _timescaledb_internal.calculate_chunk_interval(1,0,-1); +SELECT _timescaledb_functions.calculate_chunk_interval(1,0,-1); ERROR: chunk_target_size must be positive \set ON_ERROR_STOP 1 -- Valid chunk sizing function for testing @@ -83,7 +83,7 @@ SELECT table_name, chunk_sizing_func_schema, chunk_sizing_func_name, chunk_targe FROM _timescaledb_catalog.hypertable; table_name | chunk_sizing_func_schema | chunk_sizing_func_name | chunk_target_size ---------------+--------------------------+--------------------------+------------------- - test_adaptive | _timescaledb_internal | calculate_chunk_interval | 1048576 + test_adaptive | _timescaledb_functions | calculate_chunk_interval | 1048576 (1 row) -- Check that adaptive chunking sets a 1 day default chunk time @@ -97,16 +97,16 @@ SELECT * FROM _timescaledb_catalog.dimension; -- Change the target size SELECT * FROM set_adaptive_chunking('test_adaptive', '2MB'); WARNING: target chunk size for adaptive chunking is less than 10 MB - chunk_sizing_func | chunk_target_size -------------------------------------------------+------------------- - _timescaledb_internal.calculate_chunk_interval | 2097152 + chunk_sizing_func | chunk_target_size +-------------------------------------------------+------------------- + _timescaledb_functions.calculate_chunk_interval | 2097152 (1 row) SELECT table_name, chunk_sizing_func_schema, chunk_sizing_func_name, chunk_target_size FROM _timescaledb_catalog.hypertable; table_name | chunk_sizing_func_schema | chunk_sizing_func_name | chunk_target_size ---------------+--------------------------+--------------------------+------------------- - test_adaptive | _timescaledb_internal | calculate_chunk_interval | 2097152 + test_adaptive | _timescaledb_functions | calculate_chunk_interval | 2097152 (1 row) \set ON_ERROR_STOP 0 @@ -116,79 +116,79 @@ ERROR: invalid chunk sizing function \set ON_ERROR_STOP 1 -- Setting NULL size disables adaptive chunking SELECT * FROM set_adaptive_chunking('test_adaptive', NULL); - chunk_sizing_func | chunk_target_size -------------------------------------------------+------------------- - _timescaledb_internal.calculate_chunk_interval | 0 + chunk_sizing_func | chunk_target_size +-------------------------------------------------+------------------- + _timescaledb_functions.calculate_chunk_interval | 0 (1 row) SELECT table_name, chunk_sizing_func_schema, chunk_sizing_func_name, chunk_target_size FROM _timescaledb_catalog.hypertable; table_name | chunk_sizing_func_schema | chunk_sizing_func_name | chunk_target_size ---------------+--------------------------+--------------------------+------------------- - test_adaptive | _timescaledb_internal | calculate_chunk_interval | 0 + test_adaptive | _timescaledb_functions | calculate_chunk_interval | 0 (1 row) SELECT * FROM set_adaptive_chunking('test_adaptive', '1MB'); WARNING: target chunk size for adaptive chunking is less than 10 MB - chunk_sizing_func | chunk_target_size -------------------------------------------------+------------------- - _timescaledb_internal.calculate_chunk_interval | 1048576 + chunk_sizing_func | chunk_target_size +-------------------------------------------------+------------------- + _timescaledb_functions.calculate_chunk_interval | 1048576 (1 row) -- Setting size to 'off' should also disable SELECT * FROM set_adaptive_chunking('test_adaptive', 'off'); - chunk_sizing_func | chunk_target_size -------------------------------------------------+------------------- - _timescaledb_internal.calculate_chunk_interval | 0 + chunk_sizing_func | chunk_target_size +-------------------------------------------------+------------------- + _timescaledb_functions.calculate_chunk_interval | 0 (1 row) SELECT table_name, chunk_sizing_func_schema, chunk_sizing_func_name, chunk_target_size FROM _timescaledb_catalog.hypertable; table_name | chunk_sizing_func_schema | chunk_sizing_func_name | chunk_target_size ---------------+--------------------------+--------------------------+------------------- - test_adaptive | _timescaledb_internal | calculate_chunk_interval | 0 + test_adaptive | _timescaledb_functions | calculate_chunk_interval | 0 (1 row) -- Setting 0 size should also disable SELECT * FROM set_adaptive_chunking('test_adaptive', '0MB'); - chunk_sizing_func | chunk_target_size -------------------------------------------------+------------------- - _timescaledb_internal.calculate_chunk_interval | 0 + chunk_sizing_func | chunk_target_size +-------------------------------------------------+------------------- + _timescaledb_functions.calculate_chunk_interval | 0 (1 row) SELECT table_name, chunk_sizing_func_schema, chunk_sizing_func_name, chunk_target_size FROM _timescaledb_catalog.hypertable; table_name | chunk_sizing_func_schema | chunk_sizing_func_name | chunk_target_size ---------------+--------------------------+--------------------------+------------------- - test_adaptive | _timescaledb_internal | calculate_chunk_interval | 0 + test_adaptive | _timescaledb_functions | calculate_chunk_interval | 0 (1 row) SELECT * FROM set_adaptive_chunking('test_adaptive', '1MB'); WARNING: target chunk size for adaptive chunking is less than 10 MB - chunk_sizing_func | chunk_target_size -------------------------------------------------+------------------- - _timescaledb_internal.calculate_chunk_interval | 1048576 + chunk_sizing_func | chunk_target_size +-------------------------------------------------+------------------- + _timescaledb_functions.calculate_chunk_interval | 1048576 (1 row) -- No warning about small target size if > 10MB SELECT * FROM set_adaptive_chunking('test_adaptive', '11MB'); - chunk_sizing_func | chunk_target_size -------------------------------------------------+------------------- - _timescaledb_internal.calculate_chunk_interval | 11534336 + chunk_sizing_func | chunk_target_size +-------------------------------------------------+------------------- + _timescaledb_functions.calculate_chunk_interval | 11534336 (1 row) -- Setting size to 'estimate' should also estimate size SELECT * FROM set_adaptive_chunking('test_adaptive', 'estimate'); - chunk_sizing_func | chunk_target_size -------------------------------------------------+------------------- - _timescaledb_internal.calculate_chunk_interval | 1932735283 + chunk_sizing_func | chunk_target_size +-------------------------------------------------+------------------- + _timescaledb_functions.calculate_chunk_interval | 1932735283 (1 row) SELECT table_name, chunk_sizing_func_schema, chunk_sizing_func_name, chunk_target_size FROM _timescaledb_catalog.hypertable; table_name | chunk_sizing_func_schema | chunk_sizing_func_name | chunk_target_size ---------------+--------------------------+--------------------------+------------------- - test_adaptive | _timescaledb_internal | calculate_chunk_interval | 1932735283 + test_adaptive | _timescaledb_functions | calculate_chunk_interval | 1932735283 (1 row) -- Use a lower memory setting to test that the calculated chunk_target_size is reduced @@ -199,16 +199,16 @@ SELECT * FROM test.set_memory_cache_size('512MB'); (1 row) SELECT * FROM set_adaptive_chunking('test_adaptive', 'estimate'); - chunk_sizing_func | chunk_target_size -------------------------------------------------+------------------- - _timescaledb_internal.calculate_chunk_interval | 483183820 + chunk_sizing_func | chunk_target_size +-------------------------------------------------+------------------- + _timescaledb_functions.calculate_chunk_interval | 483183820 (1 row) SELECT table_name, chunk_sizing_func_schema, chunk_sizing_func_name, chunk_target_size FROM _timescaledb_catalog.hypertable; table_name | chunk_sizing_func_schema | chunk_sizing_func_name | chunk_target_size ---------------+--------------------------+--------------------------+------------------- - test_adaptive | _timescaledb_internal | calculate_chunk_interval | 483183820 + test_adaptive | _timescaledb_functions | calculate_chunk_interval | 483183820 (1 row) -- Reset memory settings @@ -221,9 +221,9 @@ SELECT * FROM test.set_memory_cache_size('2GB'); -- Set a reasonable test value SELECT * FROM set_adaptive_chunking('test_adaptive', '1MB'); WARNING: target chunk size for adaptive chunking is less than 10 MB - chunk_sizing_func | chunk_target_size -------------------------------------------------+------------------- - _timescaledb_internal.calculate_chunk_interval | 1048576 + chunk_sizing_func | chunk_target_size +-------------------------------------------------+------------------- + _timescaledb_functions.calculate_chunk_interval | 1048576 (1 row) -- Show the interval length before and after adaptation diff --git a/test/expected/chunk_utils.out b/test/expected/chunk_utils.out index 6162ae35ee6..5530a20e161 100644 --- a/test/expected/chunk_utils.out +++ b/test/expected/chunk_utils.out @@ -1068,7 +1068,7 @@ CREATE TABLE chunk_id_from_relid_test(time bigint, temp float8, device_id int); SELECT hypertable_id FROM create_hypertable('chunk_id_from_relid_test', 'time', chunk_time_interval => 10) \gset NOTICE: adding not-null constraint to column "time" INSERT INTO chunk_id_from_relid_test VALUES (0, 1.1, 0), (0, 1.3, 11), (12, 2.0, 0), (12, 0.1, 11); -SELECT _timescaledb_internal.chunk_id_from_relid(tableoid) FROM chunk_id_from_relid_test; +SELECT _timescaledb_functions.chunk_id_from_relid(tableoid) FROM chunk_id_from_relid_test; chunk_id_from_relid --------------------- 24 @@ -1085,7 +1085,7 @@ SELECT hypertable_id FROM create_hypertable('chunk_id_from_relid_test', number_partitions => 3) \gset NOTICE: adding not-null constraint to column "time" INSERT INTO chunk_id_from_relid_test VALUES (0, 1.1, 2), (0, 1.3, 11), (12, 2.0, 2), (12, 0.1, 11); -SELECT _timescaledb_internal.chunk_id_from_relid(tableoid) FROM chunk_id_from_relid_test; +SELECT _timescaledb_functions.chunk_id_from_relid(tableoid) FROM chunk_id_from_relid_test; chunk_id_from_relid --------------------- 26 @@ -1095,9 +1095,9 @@ SELECT _timescaledb_internal.chunk_id_from_relid(tableoid) FROM chunk_id_from_re (4 rows) \set ON_ERROR_STOP 0 -SELECT _timescaledb_internal.chunk_id_from_relid('pg_type'::regclass); +SELECT _timescaledb_functions.chunk_id_from_relid('pg_type'::regclass); ERROR: chunk not found -SELECT _timescaledb_internal.chunk_id_from_relid('chunk_id_from_relid_test'::regclass); +SELECT _timescaledb_functions.chunk_id_from_relid('chunk_id_from_relid_test'::regclass); ERROR: chunk not found -- test drop/show_chunks on custom partition types CREATE FUNCTION extract_time(a jsonb) @@ -1451,7 +1451,7 @@ FROM timescaledb_information.chunks WHERE hypertable_name = 'hyper1' and hypertable_schema = 'test1' ORDER BY chunk_name LIMIT 1 \gset -SELECT _timescaledb_internal.drop_chunk(:'CHNAME'); +SELECT _timescaledb_functions.drop_chunk(:'CHNAME'); drop_chunk ------------ t diff --git a/test/expected/create_hypertable.out b/test/expected/create_hypertable.out index 07359846e8c..0f4a86a3de7 100644 --- a/test/expected/create_hypertable.out +++ b/test/expected/create_hypertable.out @@ -88,7 +88,7 @@ select add_dimension('test_schema.test_table', 'location', 4); select * from _timescaledb_catalog.hypertable where table_name = 'test_table'; id | schema_name | table_name | associated_schema_name | associated_table_prefix | num_dimensions | chunk_sizing_func_schema | chunk_sizing_func_name | chunk_target_size | compression_state | compressed_hypertable_id | replication_factor ----+-------------+------------+------------------------+-------------------------+----------------+--------------------------+--------------------------+-------------------+-------------------+--------------------------+-------------------- - 2 | test_schema | test_table | chunk_schema | _hyper_2 | 3 | _timescaledb_internal | calculate_chunk_interval | 0 | 0 | | + 2 | test_schema | test_table | chunk_schema | _hyper_2 | 3 | _timescaledb_functions | calculate_chunk_interval | 0 | 0 | | (1 row) select * from _timescaledb_catalog.dimension; @@ -151,7 +151,7 @@ NOTICE: adding not-null constraint to column "id" select * from _timescaledb_catalog.hypertable where table_name = 'test_table'; id | schema_name | table_name | associated_schema_name | associated_table_prefix | num_dimensions | chunk_sizing_func_schema | chunk_sizing_func_name | chunk_target_size | compression_state | compressed_hypertable_id | replication_factor ----+-------------+------------+------------------------+-------------------------+----------------+--------------------------+--------------------------+-------------------+-------------------+--------------------------+-------------------- - 2 | test_schema | test_table | chunk_schema | _hyper_2 | 4 | _timescaledb_internal | calculate_chunk_interval | 0 | 0 | | + 2 | test_schema | test_table | chunk_schema | _hyper_2 | 4 | _timescaledb_functions | calculate_chunk_interval | 0 | 0 | | (1 row) select * from _timescaledb_catalog.dimension; @@ -543,7 +543,7 @@ NOTICE: migrating data to chunks select * from _timescaledb_catalog.hypertable where table_name = 'test_migrate'; id | schema_name | table_name | associated_schema_name | associated_table_prefix | num_dimensions | chunk_sizing_func_schema | chunk_sizing_func_name | chunk_target_size | compression_state | compressed_hypertable_id | replication_factor ----+-------------+--------------+------------------------+-------------------------+----------------+--------------------------+--------------------------+-------------------+-------------------+--------------------------+-------------------- - 10 | test_schema | test_migrate | _timescaledb_internal | _hyper_10 | 1 | _timescaledb_internal | calculate_chunk_interval | 0 | 0 | | + 10 | test_schema | test_migrate | _timescaledb_internal | _hyper_10 | 1 | _timescaledb_functions | calculate_chunk_interval | 0 | 0 | | (1 row) select * from _timescaledb_catalog.chunk; diff --git a/test/expected/ddl-13.out b/test/expected/ddl-13.out index 480a2627af7..a5c61b1e120 100644 --- a/test/expected/ddl-13.out +++ b/test/expected/ddl-13.out @@ -45,8 +45,8 @@ SELECT * FROM create_hypertable('"customSchema"."Hypertable_1"', 'time', NULL, 1 SELECT * FROM _timescaledb_catalog.hypertable; id | schema_name | table_name | associated_schema_name | associated_table_prefix | num_dimensions | chunk_sizing_func_schema | chunk_sizing_func_name | chunk_target_size | compression_state | compressed_hypertable_id | replication_factor ----+--------------+--------------+------------------------+-------------------------+----------------+--------------------------+--------------------------+-------------------+-------------------+--------------------------+-------------------- - 1 | public | Hypertable_1 | _timescaledb_internal | _hyper_1 | 2 | _timescaledb_internal | calculate_chunk_interval | 0 | 0 | | - 2 | customSchema | Hypertable_1 | _timescaledb_internal | _hyper_2 | 1 | _timescaledb_internal | calculate_chunk_interval | 0 | 0 | | + 1 | public | Hypertable_1 | _timescaledb_internal | _hyper_1 | 2 | _timescaledb_functions | calculate_chunk_interval | 0 | 0 | | + 2 | customSchema | Hypertable_1 | _timescaledb_internal | _hyper_2 | 1 | _timescaledb_functions | calculate_chunk_interval | 0 | 0 | | (2 rows) CREATE INDEX ON PUBLIC."Hypertable_1" (time, "temp_c"); diff --git a/test/expected/ddl-14.out b/test/expected/ddl-14.out index 785c68bcec8..0c120ed8a21 100644 --- a/test/expected/ddl-14.out +++ b/test/expected/ddl-14.out @@ -45,8 +45,8 @@ SELECT * FROM create_hypertable('"customSchema"."Hypertable_1"', 'time', NULL, 1 SELECT * FROM _timescaledb_catalog.hypertable; id | schema_name | table_name | associated_schema_name | associated_table_prefix | num_dimensions | chunk_sizing_func_schema | chunk_sizing_func_name | chunk_target_size | compression_state | compressed_hypertable_id | replication_factor ----+--------------+--------------+------------------------+-------------------------+----------------+--------------------------+--------------------------+-------------------+-------------------+--------------------------+-------------------- - 1 | public | Hypertable_1 | _timescaledb_internal | _hyper_1 | 2 | _timescaledb_internal | calculate_chunk_interval | 0 | 0 | | - 2 | customSchema | Hypertable_1 | _timescaledb_internal | _hyper_2 | 1 | _timescaledb_internal | calculate_chunk_interval | 0 | 0 | | + 1 | public | Hypertable_1 | _timescaledb_internal | _hyper_1 | 2 | _timescaledb_functions | calculate_chunk_interval | 0 | 0 | | + 2 | customSchema | Hypertable_1 | _timescaledb_internal | _hyper_2 | 1 | _timescaledb_functions | calculate_chunk_interval | 0 | 0 | | (2 rows) CREATE INDEX ON PUBLIC."Hypertable_1" (time, "temp_c"); diff --git a/test/expected/ddl-15.out b/test/expected/ddl-15.out index 785c68bcec8..0c120ed8a21 100644 --- a/test/expected/ddl-15.out +++ b/test/expected/ddl-15.out @@ -45,8 +45,8 @@ SELECT * FROM create_hypertable('"customSchema"."Hypertable_1"', 'time', NULL, 1 SELECT * FROM _timescaledb_catalog.hypertable; id | schema_name | table_name | associated_schema_name | associated_table_prefix | num_dimensions | chunk_sizing_func_schema | chunk_sizing_func_name | chunk_target_size | compression_state | compressed_hypertable_id | replication_factor ----+--------------+--------------+------------------------+-------------------------+----------------+--------------------------+--------------------------+-------------------+-------------------+--------------------------+-------------------- - 1 | public | Hypertable_1 | _timescaledb_internal | _hyper_1 | 2 | _timescaledb_internal | calculate_chunk_interval | 0 | 0 | | - 2 | customSchema | Hypertable_1 | _timescaledb_internal | _hyper_2 | 1 | _timescaledb_internal | calculate_chunk_interval | 0 | 0 | | + 1 | public | Hypertable_1 | _timescaledb_internal | _hyper_1 | 2 | _timescaledb_functions | calculate_chunk_interval | 0 | 0 | | + 2 | customSchema | Hypertable_1 | _timescaledb_internal | _hyper_2 | 1 | _timescaledb_functions | calculate_chunk_interval | 0 | 0 | | (2 rows) CREATE INDEX ON PUBLIC."Hypertable_1" (time, "temp_c"); diff --git a/test/expected/drop_extension.out b/test/expected/drop_extension.out index 26b6e384781..a6738fedd0d 100644 --- a/test/expected/drop_extension.out +++ b/test/expected/drop_extension.out @@ -13,7 +13,7 @@ NOTICE: adding not-null constraint to column "time" SELECT * FROM _timescaledb_catalog.hypertable; id | schema_name | table_name | associated_schema_name | associated_table_prefix | num_dimensions | chunk_sizing_func_schema | chunk_sizing_func_name | chunk_target_size | compression_state | compressed_hypertable_id | replication_factor ----+-------------+------------+------------------------+-------------------------+----------------+--------------------------+--------------------------+-------------------+-------------------+--------------------------+-------------------- - 1 | public | drop_test | _timescaledb_internal | _hyper_1 | 2 | _timescaledb_internal | calculate_chunk_interval | 0 | 0 | | + 1 | public | drop_test | _timescaledb_internal | _hyper_1 | 2 | _timescaledb_functions | calculate_chunk_interval | 0 | 0 | | (1 row) INSERT INTO drop_test VALUES('Mon Mar 20 09:17:00.936242 2017', 23.4, 'dev1'); @@ -59,7 +59,7 @@ WARNING: column type "timestamp without time zone" used for "time" does not fol SELECT * FROM _timescaledb_catalog.hypertable; id | schema_name | table_name | associated_schema_name | associated_table_prefix | num_dimensions | chunk_sizing_func_schema | chunk_sizing_func_name | chunk_target_size | compression_state | compressed_hypertable_id | replication_factor ----+-------------+------------+------------------------+-------------------------+----------------+--------------------------+--------------------------+-------------------+-------------------+--------------------------+-------------------- - 1 | public | drop_test | _timescaledb_internal | _hyper_1 | 2 | _timescaledb_internal | calculate_chunk_interval | 0 | 0 | | + 1 | public | drop_test | _timescaledb_internal | _hyper_1 | 2 | _timescaledb_functions | calculate_chunk_interval | 0 | 0 | | (1 row) INSERT INTO drop_test VALUES('Mon Mar 20 09:18:19.100462 2017', 22.1, 'dev1'); diff --git a/test/expected/drop_hypertable.out b/test/expected/drop_hypertable.out index 89692f18e17..4833780b975 100644 --- a/test/expected/drop_hypertable.out +++ b/test/expected/drop_hypertable.out @@ -78,7 +78,7 @@ NOTICE: table "should_drop" is already a hypertable, skipping SELECT * from _timescaledb_catalog.hypertable; id | schema_name | table_name | associated_schema_name | associated_table_prefix | num_dimensions | chunk_sizing_func_schema | chunk_sizing_func_name | chunk_target_size | compression_state | compressed_hypertable_id | replication_factor ----+-------------+-------------+------------------------+-------------------------+----------------+--------------------------+--------------------------+-------------------+-------------------+--------------------------+-------------------- - 1 | public | should_drop | _timescaledb_internal | _hyper_1 | 1 | _timescaledb_internal | calculate_chunk_interval | 0 | 0 | | + 1 | public | should_drop | _timescaledb_internal | _hyper_1 | 1 | _timescaledb_functions | calculate_chunk_interval | 0 | 0 | | (1 row) SELECT * from _timescaledb_catalog.dimension; @@ -101,7 +101,7 @@ INSERT INTO should_drop VALUES (now(), 1.0); SELECT * from _timescaledb_catalog.hypertable; id | schema_name | table_name | associated_schema_name | associated_table_prefix | num_dimensions | chunk_sizing_func_schema | chunk_sizing_func_name | chunk_target_size | compression_state | compressed_hypertable_id | replication_factor ----+-------------+-------------+------------------------+-------------------------+----------------+--------------------------+--------------------------+-------------------+-------------------+--------------------------+-------------------- - 4 | public | should_drop | _timescaledb_internal | _hyper_4 | 1 | _timescaledb_internal | calculate_chunk_interval | 0 | 0 | | + 4 | public | should_drop | _timescaledb_internal | _hyper_4 | 1 | _timescaledb_functions | calculate_chunk_interval | 0 | 0 | | (1 row) SELECT * from _timescaledb_catalog.dimension; diff --git a/test/expected/drop_owned.out b/test/expected/drop_owned.out index 4dcdf4d0d7e..bfcd4b96e14 100644 --- a/test/expected/drop_owned.out +++ b/test/expected/drop_owned.out @@ -27,8 +27,8 @@ INSERT INTO hypertable_schema.superuser VALUES ('2001-01-01 01:01:01', 23.3, 1); SELECT * FROM _timescaledb_catalog.hypertable ORDER BY id; id | schema_name | table_name | associated_schema_name | associated_table_prefix | num_dimensions | chunk_sizing_func_schema | chunk_sizing_func_name | chunk_target_size | compression_state | compressed_hypertable_id | replication_factor ----+-------------------+-------------------+------------------------+-------------------------+----------------+--------------------------+--------------------------+-------------------+-------------------+--------------------------+-------------------- - 1 | hypertable_schema | default_perm_user | _timescaledb_internal | _hyper_1 | 2 | _timescaledb_internal | calculate_chunk_interval | 0 | 0 | | - 2 | hypertable_schema | superuser | _timescaledb_internal | _hyper_2 | 2 | _timescaledb_internal | calculate_chunk_interval | 0 | 0 | | + 1 | hypertable_schema | default_perm_user | _timescaledb_internal | _hyper_1 | 2 | _timescaledb_functions | calculate_chunk_interval | 0 | 0 | | + 2 | hypertable_schema | superuser | _timescaledb_internal | _hyper_2 | 2 | _timescaledb_functions | calculate_chunk_interval | 0 | 0 | | (2 rows) SELECT * FROM _timescaledb_catalog.chunk; @@ -42,7 +42,7 @@ DROP OWNED BY :ROLE_DEFAULT_PERM_USER; SELECT * FROM _timescaledb_catalog.hypertable ORDER BY id; id | schema_name | table_name | associated_schema_name | associated_table_prefix | num_dimensions | chunk_sizing_func_schema | chunk_sizing_func_name | chunk_target_size | compression_state | compressed_hypertable_id | replication_factor ----+-------------------+------------+------------------------+-------------------------+----------------+--------------------------+--------------------------+-------------------+-------------------+--------------------------+-------------------- - 2 | hypertable_schema | superuser | _timescaledb_internal | _hyper_2 | 2 | _timescaledb_internal | calculate_chunk_interval | 0 | 0 | | + 2 | hypertable_schema | superuser | _timescaledb_internal | _hyper_2 | 2 | _timescaledb_functions | calculate_chunk_interval | 0 | 0 | | (1 row) SELECT * FROM _timescaledb_catalog.chunk; diff --git a/test/expected/drop_rename_hypertable.out b/test/expected/drop_rename_hypertable.out index 069cabd24e2..4a26a2aa4dd 100644 --- a/test/expected/drop_rename_hypertable.out +++ b/test/expected/drop_rename_hypertable.out @@ -148,7 +148,7 @@ SELECT * FROM "newname"; SELECT * FROM _timescaledb_catalog.hypertable; id | schema_name | table_name | associated_schema_name | associated_table_prefix | num_dimensions | chunk_sizing_func_schema | chunk_sizing_func_name | chunk_target_size | compression_state | compressed_hypertable_id | replication_factor ----+-------------+------------+------------------------+-------------------------+----------------+--------------------------+--------------------------+-------------------+-------------------+--------------------------+-------------------- - 1 | public | newname | _timescaledb_internal | _hyper_1 | 2 | _timescaledb_internal | calculate_chunk_interval | 0 | 0 | | + 1 | public | newname | _timescaledb_internal | _hyper_1 | 2 | _timescaledb_functions | calculate_chunk_interval | 0 | 0 | | (1 row) \c :TEST_DBNAME :ROLE_SUPERUSER @@ -175,7 +175,7 @@ SELECT * FROM "newschema"."newname"; SELECT * FROM _timescaledb_catalog.hypertable; id | schema_name | table_name | associated_schema_name | associated_table_prefix | num_dimensions | chunk_sizing_func_schema | chunk_sizing_func_name | chunk_target_size | compression_state | compressed_hypertable_id | replication_factor ----+-------------+------------+------------------------+-------------------------+----------------+--------------------------+--------------------------+-------------------+-------------------+--------------------------+-------------------- - 1 | newschema | newname | _timescaledb_internal | _hyper_1 | 2 | _timescaledb_internal | calculate_chunk_interval | 0 | 0 | | + 1 | newschema | newname | _timescaledb_internal | _hyper_1 | 2 | _timescaledb_functions | calculate_chunk_interval | 0 | 0 | | (1 row) DROP TABLE "newschema"."newname"; diff --git a/test/expected/drop_schema.out b/test/expected/drop_schema.out index 38852092230..046abd4eddb 100644 --- a/test/expected/drop_schema.out +++ b/test/expected/drop_schema.out @@ -32,8 +32,8 @@ INSERT INTO hypertable_schema.test2 VALUES ('2001-01-01 01:01:01', 23.3, 1); SELECT * FROM _timescaledb_catalog.hypertable ORDER BY id; id | schema_name | table_name | associated_schema_name | associated_table_prefix | num_dimensions | chunk_sizing_func_schema | chunk_sizing_func_name | chunk_target_size | compression_state | compressed_hypertable_id | replication_factor ----+-------------------+------------+------------------------+-------------------------+----------------+--------------------------+--------------------------+-------------------+-------------------+--------------------------+-------------------- - 1 | hypertable_schema | test1 | chunk_schema1 | _hyper_1 | 2 | _timescaledb_internal | calculate_chunk_interval | 0 | 0 | | - 2 | hypertable_schema | test2 | chunk_schema2 | _hyper_2 | 2 | _timescaledb_internal | calculate_chunk_interval | 0 | 0 | | + 1 | hypertable_schema | test1 | chunk_schema1 | _hyper_1 | 2 | _timescaledb_functions | calculate_chunk_interval | 0 | 0 | | + 2 | hypertable_schema | test2 | chunk_schema2 | _hyper_2 | 2 | _timescaledb_functions | calculate_chunk_interval | 0 | 0 | | (2 rows) SELECT * FROM _timescaledb_catalog.chunk; @@ -55,8 +55,8 @@ SET ROLE :ROLE_DEFAULT_PERM_USER; SELECT * FROM _timescaledb_catalog.hypertable ORDER BY id; id | schema_name | table_name | associated_schema_name | associated_table_prefix | num_dimensions | chunk_sizing_func_schema | chunk_sizing_func_name | chunk_target_size | compression_state | compressed_hypertable_id | replication_factor ----+-------------------+------------+------------------------+-------------------------+----------------+--------------------------+--------------------------+-------------------+-------------------+--------------------------+-------------------- - 1 | hypertable_schema | test1 | _timescaledb_internal | _hyper_1 | 2 | _timescaledb_internal | calculate_chunk_interval | 0 | 0 | | - 2 | hypertable_schema | test2 | chunk_schema2 | _hyper_2 | 2 | _timescaledb_internal | calculate_chunk_interval | 0 | 0 | | + 1 | hypertable_schema | test1 | _timescaledb_internal | _hyper_1 | 2 | _timescaledb_functions | calculate_chunk_interval | 0 | 0 | | + 2 | hypertable_schema | test2 | chunk_schema2 | _hyper_2 | 2 | _timescaledb_functions | calculate_chunk_interval | 0 | 0 | | (2 rows) SELECT * FROM _timescaledb_catalog.chunk; diff --git a/test/expected/dump_meta.out b/test/expected/dump_meta.out index 214959c7a0a..72c1072eabe 100644 --- a/test/expected/dump_meta.out +++ b/test/expected/dump_meta.out @@ -68,7 +68,7 @@ List of hypertables SELECT * FROM _timescaledb_catalog.hypertable; id | schema_name | table_name | associated_schema_name | associated_table_prefix | num_dimensions | chunk_sizing_func_schema | chunk_sizing_func_name | chunk_target_size | compression_state | compressed_hypertable_id | replication_factor ----+-------------+----------------+------------------------+-------------------------+----------------+--------------------------+--------------------------+-------------------+-------------------+--------------------------+-------------------- - 1 | public | two_Partitions | _timescaledb_internal | _hyper_1 | 2 | _timescaledb_internal | calculate_chunk_interval | 0 | 0 | | + 1 | public | two_Partitions | _timescaledb_internal | _hyper_1 | 2 | _timescaledb_functions | calculate_chunk_interval | 0 | 0 | | (1 row) \echo 'List of chunk indexes' diff --git a/test/expected/plan_expand_hypertable.out b/test/expected/plan_expand_hypertable.out index 9e68acd0c5a..cd939c7bd71 100644 --- a/test/expected/plan_expand_hypertable.out +++ b/test/expected/plan_expand_hypertable.out @@ -2708,7 +2708,7 @@ SET constraint_exclusion = 'off'; (105 rows) -- explicit chunk exclusion -:PREFIX SELECT * FROM hyper WHERE _timescaledb_internal.chunks_in(hyper, ARRAY[1,2]) ORDER BY value; +:PREFIX SELECT * FROM hyper WHERE _timescaledb_functions.chunks_in(hyper, ARRAY[1,2]) ORDER BY value; QUERY PLAN ------------------------------------------ Sort @@ -2718,7 +2718,7 @@ SET constraint_exclusion = 'off'; -> Seq Scan on _hyper_1_2_chunk (5 rows) -:PREFIX SELECT * FROM (SELECT * FROM hyper h WHERE _timescaledb_internal.chunks_in(h, ARRAY[1,2,3])) T ORDER BY value; +:PREFIX SELECT * FROM (SELECT * FROM hyper h WHERE _timescaledb_functions.chunks_in(h, ARRAY[1,2,3])) T ORDER BY value; QUERY PLAN ---------------------------------------------- Sort @@ -2729,7 +2729,7 @@ SET constraint_exclusion = 'off'; -> Seq Scan on _hyper_1_3_chunk h_3 (6 rows) -:PREFIX SELECT * FROM hyper WHERE _timescaledb_internal.chunks_in(hyper, ARRAY[1,2,3]) AND time < 10 ORDER BY value; +:PREFIX SELECT * FROM hyper WHERE _timescaledb_functions.chunks_in(hyper, ARRAY[1,2,3]) AND time < 10 ORDER BY value; QUERY PLAN ------------------------------------------ Sort @@ -2743,7 +2743,7 @@ SET constraint_exclusion = 'off'; Filter: ("time" < 10) (9 rows) -:PREFIX SELECT * FROM hyper_ts WHERE device_id = 'dev1' AND time < to_timestamp(10) AND _timescaledb_internal.chunks_in(hyper_ts, ARRAY[116]) ORDER BY value; +:PREFIX SELECT * FROM hyper_ts WHERE device_id = 'dev1' AND time < to_timestamp(10) AND _timescaledb_functions.chunks_in(hyper_ts, ARRAY[116]) ORDER BY value; QUERY PLAN ---------------------------------------------------------------------------------------------------------------------- Sort @@ -2752,7 +2752,7 @@ SET constraint_exclusion = 'off'; Filter: (("time" < 'Wed Dec 31 16:00:10 1969 PST'::timestamp with time zone) AND (device_id = 'dev1'::text)) (4 rows) -:PREFIX SELECT * FROM hyper_ts h JOIN tag on (h.tag_id = tag.id ) WHERE _timescaledb_internal.chunks_in(h, ARRAY[116]) AND time < to_timestamp(10) AND device_id = 'dev1' ORDER BY value; +:PREFIX SELECT * FROM hyper_ts h JOIN tag on (h.tag_id = tag.id ) WHERE _timescaledb_functions.chunks_in(h, ARRAY[116]) AND time < to_timestamp(10) AND device_id = 'dev1' ORDER BY value; QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------- Sort @@ -2766,7 +2766,7 @@ SET constraint_exclusion = 'off'; Filter: (("time" < 'Wed Dec 31 16:00:10 1969 PST'::timestamp with time zone) AND (device_id = 'dev1'::text)) (9 rows) -:PREFIX SELECT * FROM hyper_w_space h1 JOIN hyper_ts h2 ON h1.device_id=h2.device_id WHERE _timescaledb_internal.chunks_in(h1, ARRAY[104,105]) AND _timescaledb_internal.chunks_in(h2, ARRAY[116,117]) ORDER BY h1.value; +:PREFIX SELECT * FROM hyper_w_space h1 JOIN hyper_ts h2 ON h1.device_id=h2.device_id WHERE _timescaledb_functions.chunks_in(h1, ARRAY[104,105]) AND _timescaledb_functions.chunks_in(h2, ARRAY[116,117]) ORDER BY h1.value; QUERY PLAN ------------------------------------------------------------- Sort @@ -2782,7 +2782,7 @@ SET constraint_exclusion = 'off'; -> Seq Scan on _hyper_2_105_chunk h1_2 (11 rows) -:PREFIX SELECT * FROM hyper_w_space h1 JOIN hyper_ts h2 ON h1.device_id=h2.device_id AND _timescaledb_internal.chunks_in(h2, ARRAY[116,117]) WHERE _timescaledb_internal.chunks_in(h1, ARRAY[104,105]) ORDER BY h1.value; +:PREFIX SELECT * FROM hyper_w_space h1 JOIN hyper_ts h2 ON h1.device_id=h2.device_id AND _timescaledb_functions.chunks_in(h2, ARRAY[116,117]) WHERE _timescaledb_functions.chunks_in(h1, ARRAY[104,105]) ORDER BY h1.value; QUERY PLAN ------------------------------------------------------------- Sort @@ -2798,7 +2798,7 @@ SET constraint_exclusion = 'off'; -> Seq Scan on _hyper_2_105_chunk h1_2 (11 rows) -:PREFIX SELECT * FROM hyper h1, hyper h2 WHERE _timescaledb_internal.chunks_in(h1, ARRAY[1,2]) AND _timescaledb_internal.chunks_in(h2, ARRAY[2,3]); +:PREFIX SELECT * FROM hyper h1, hyper h2 WHERE _timescaledb_functions.chunks_in(h1, ARRAY[1,2]) AND _timescaledb_functions.chunks_in(h2, ARRAY[2,3]); QUERY PLAN ----------------------------------------------------- Nested Loop @@ -2814,14 +2814,14 @@ SET constraint_exclusion = 'off'; SET enable_seqscan=false; -- Should perform index-only scan. Since we pass whole row into the function it might block planner from using index-only scan. -- But since we'll remove the function from the query tree before planner decision it shouldn't affect index-only decision. -:PREFIX SELECT time FROM hyper WHERE time=0 AND _timescaledb_internal.chunks_in(hyper, ARRAY[1]); +:PREFIX SELECT time FROM hyper WHERE time=0 AND _timescaledb_functions.chunks_in(hyper, ARRAY[1]); QUERY PLAN --------------------------------------------------------------------------- Index Only Scan using _hyper_1_1_chunk_hyper_time_idx on _hyper_1_1_chunk Index Cond: ("time" = 0) (2 rows) -:PREFIX SELECT first(value, time) FROM hyper h WHERE _timescaledb_internal.chunks_in(h, ARRAY[1]); +:PREFIX SELECT first(value, time) FROM hyper h WHERE _timescaledb_functions.chunks_in(h, ARRAY[1]); QUERY PLAN ----------------------------------------------------------------------------------------------- Result @@ -2832,32 +2832,32 @@ SET enable_seqscan=false; (5 rows) \set ON_ERROR_STOP 0 -SELECT * FROM hyper WHERE _timescaledb_internal.chunks_in(hyper, ARRAY[1,2]) AND _timescaledb_internal.chunks_in(hyper, ARRAY[2,3]); +SELECT * FROM hyper WHERE _timescaledb_functions.chunks_in(hyper, ARRAY[1,2]) AND _timescaledb_functions.chunks_in(hyper, ARRAY[2,3]); psql:include/plan_expand_hypertable_chunks_in_query.sql:26: ERROR: illegal invocation of chunks_in function -SELECT * FROM hyper WHERE _timescaledb_internal.chunks_in(2, ARRAY[1]); -psql:include/plan_expand_hypertable_chunks_in_query.sql:27: ERROR: function _timescaledb_internal.chunks_in(integer, integer[]) does not exist at character 27 -SELECT * FROM hyper WHERE time < 10 OR _timescaledb_internal.chunks_in(hyper, ARRAY[1,2]); +SELECT * FROM hyper WHERE _timescaledb_functions.chunks_in(2, ARRAY[1]); +psql:include/plan_expand_hypertable_chunks_in_query.sql:27: ERROR: function _timescaledb_functions.chunks_in(integer, integer[]) does not exist at character 27 +SELECT * FROM hyper WHERE time < 10 OR _timescaledb_functions.chunks_in(hyper, ARRAY[1,2]); psql:include/plan_expand_hypertable_chunks_in_query.sql:28: ERROR: illegal invocation of chunks_in function -SELECT _timescaledb_internal.chunks_in(hyper, ARRAY[1,2]) FROM hyper; +SELECT _timescaledb_functions.chunks_in(hyper, ARRAY[1,2]) FROM hyper; psql:include/plan_expand_hypertable_chunks_in_query.sql:29: ERROR: illegal invocation of chunks_in function -- non existing chunk id -SELECT * FROM hyper WHERE _timescaledb_internal.chunks_in(hyper, ARRAY[123456789]); +SELECT * FROM hyper WHERE _timescaledb_functions.chunks_in(hyper, ARRAY[123456789]); psql:include/plan_expand_hypertable_chunks_in_query.sql:31: ERROR: chunk id 123456789 not found -- chunk that belongs to another hypertable -SELECT * FROM hyper WHERE _timescaledb_internal.chunks_in(hyper, ARRAY[104]); +SELECT * FROM hyper WHERE _timescaledb_functions.chunks_in(hyper, ARRAY[104]); psql:include/plan_expand_hypertable_chunks_in_query.sql:33: ERROR: chunk id 104 does not belong to hypertable "hyper" -- passing wrong row ref -SELECT * FROM hyper WHERE _timescaledb_internal.chunks_in(ROW(1,2), ARRAY[104]); +SELECT * FROM hyper WHERE _timescaledb_functions.chunks_in(ROW(1,2), ARRAY[104]); psql:include/plan_expand_hypertable_chunks_in_query.sql:35: ERROR: first parameter for chunks_in function needs to be record -- passing func as chunk id -SELECT * FROM hyper h WHERE _timescaledb_internal.chunks_in(h, array_append(ARRAY[1],current_setting('server_version_num')::int)); +SELECT * FROM hyper h WHERE _timescaledb_functions.chunks_in(h, array_append(ARRAY[1],current_setting('server_version_num')::int)); psql:include/plan_expand_hypertable_chunks_in_query.sql:37: ERROR: second argument to chunk_in should contain only integer consts -- NULL chunk IDs not allowed in chunk array -SELECT * FROM hyper h WHERE _timescaledb_internal.chunks_in(h, ARRAY[NULL::int]); +SELECT * FROM hyper h WHERE _timescaledb_functions.chunks_in(h, ARRAY[NULL::int]); psql:include/plan_expand_hypertable_chunks_in_query.sql:39: ERROR: chunk id can't be NULL \set ON_ERROR_STOP 1 -- chunks_in is STRICT function and for NULL arguments a null result is returned -SELECT * FROM hyper h WHERE _timescaledb_internal.chunks_in(h, NULL); +SELECT * FROM hyper h WHERE _timescaledb_functions.chunks_in(h, NULL); value | time -------+------ (0 rows) diff --git a/test/expected/relocate_extension.out b/test/expected/relocate_extension.out index a8cc017d04d..c7555db5764 100644 --- a/test/expected/relocate_extension.out +++ b/test/expected/relocate_extension.out @@ -40,9 +40,9 @@ NOTICE: adding not-null constraint to column "time" SELECT * FROM _timescaledb_catalog.hypertable; id | schema_name | table_name | associated_schema_name | associated_table_prefix | num_dimensions | chunk_sizing_func_schema | chunk_sizing_func_name | chunk_target_size | compression_state | compressed_hypertable_id | replication_factor ----+-------------+------------+------------------------+-------------------------+----------------+--------------------------+--------------------------+-------------------+-------------------+--------------------------+-------------------- - 1 | public | test_ts | _timescaledb_internal | _hyper_1 | 2 | _timescaledb_internal | calculate_chunk_interval | 0 | 0 | | - 2 | public | test_tz | _timescaledb_internal | _hyper_2 | 2 | _timescaledb_internal | calculate_chunk_interval | 0 | 0 | | - 3 | public | test_dt | _timescaledb_internal | _hyper_3 | 2 | _timescaledb_internal | calculate_chunk_interval | 0 | 0 | | + 1 | public | test_ts | _timescaledb_internal | _hyper_1 | 2 | _timescaledb_functions | calculate_chunk_interval | 0 | 0 | | + 2 | public | test_tz | _timescaledb_internal | _hyper_2 | 2 | _timescaledb_functions | calculate_chunk_interval | 0 | 0 | | + 3 | public | test_dt | _timescaledb_internal | _hyper_3 | 2 | _timescaledb_functions | calculate_chunk_interval | 0 | 0 | | (3 rows) INSERT INTO test_ts VALUES('Mon Mar 20 09:17:00.936242 2017', 23.4, 'dev1'); diff --git a/test/expected/truncate.out b/test/expected/truncate.out index 0e700dc33de..6c44ccd2fb6 100644 --- a/test/expected/truncate.out +++ b/test/expected/truncate.out @@ -37,7 +37,7 @@ INSERT INTO "two_Partitions"("timeCustom", device_id, series_0, series_1) VALUES SELECT * FROM _timescaledb_catalog.hypertable; id | schema_name | table_name | associated_schema_name | associated_table_prefix | num_dimensions | chunk_sizing_func_schema | chunk_sizing_func_name | chunk_target_size | compression_state | compressed_hypertable_id | replication_factor ----+-------------+----------------+------------------------+-------------------------+----------------+--------------------------+--------------------------+-------------------+-------------------+--------------------------+-------------------- - 1 | public | two_Partitions | _timescaledb_internal | _hyper_1 | 2 | _timescaledb_internal | calculate_chunk_interval | 0 | 0 | | + 1 | public | two_Partitions | _timescaledb_internal | _hyper_1 | 2 | _timescaledb_functions | calculate_chunk_interval | 0 | 0 | | (1 row) SELECT * FROM _timescaledb_catalog.chunk; @@ -80,7 +80,7 @@ TRUNCATE "two_Partitions"; SELECT * FROM _timescaledb_catalog.hypertable; id | schema_name | table_name | associated_schema_name | associated_table_prefix | num_dimensions | chunk_sizing_func_schema | chunk_sizing_func_name | chunk_target_size | compression_state | compressed_hypertable_id | replication_factor ----+-------------+----------------+------------------------+-------------------------+----------------+--------------------------+--------------------------+-------------------+-------------------+--------------------------+-------------------- - 1 | public | two_Partitions | _timescaledb_internal | _hyper_1 | 2 | _timescaledb_internal | calculate_chunk_interval | 0 | 0 | | + 1 | public | two_Partitions | _timescaledb_internal | _hyper_1 | 2 | _timescaledb_functions | calculate_chunk_interval | 0 | 0 | | (1 row) SELECT * FROM _timescaledb_catalog.chunk; diff --git a/test/runner_shared.sh b/test/runner_shared.sh index 7e289f62e23..4264a0b5bd3 100755 --- a/test/runner_shared.sh +++ b/test/runner_shared.sh @@ -83,7 +83,7 @@ ${PSQL} -U ${TEST_PGUSER} \ -e 's!^ \{1,\}QUERY PLAN \{1,\}$!QUERY PLAN!' \ -e 's!: actual rows!: actual rows!' \ -e '/^-\{1,\}$/d' \ - -e 's!\(_timescaledb_internal.chunks_in([^,]\{1,\}, ARRAY\[\)[^]]\{1,\}\]!\1..]!' \ + -e 's!\(_timescaledb_functions.chunks_in([^,]\{1,\}, ARRAY\[\)[^]]\{1,\}\]!\1..]!' \ -e 's! Memory: [0-9]\{1,\}kB!!' \ -e 's! Memory Usage: [0-9]\{1,\}kB!!' \ -e 's! Average Peak Memory: [0-9]\{1,\}kB!!' | \ diff --git a/test/sql/chunk_adaptive.sql b/test/sql/chunk_adaptive.sql index 8c9ff209a33..c57bdaa9563 100644 --- a/test/sql/chunk_adaptive.sql +++ b/test/sql/chunk_adaptive.sql @@ -2,10 +2,10 @@ -- Please see the included NOTICE for copyright information and -- LICENSE-APACHE for a copy of the license. --- test error handling _timescaledb_internal.calculate_chunk_interval +-- test error handling _timescaledb_functions.calculate_chunk_interval \set ON_ERROR_STOP 0 -SELECT _timescaledb_internal.calculate_chunk_interval(0,0,-0); -SELECT _timescaledb_internal.calculate_chunk_interval(1,0,-1); +SELECT _timescaledb_functions.calculate_chunk_interval(0,0,-0); +SELECT _timescaledb_functions.calculate_chunk_interval(1,0,-1); \set ON_ERROR_STOP 1 -- Valid chunk sizing function for testing diff --git a/test/sql/chunk_utils.sql b/test/sql/chunk_utils.sql index 465dc55521f..8b60c49042a 100644 --- a/test/sql/chunk_utils.sql +++ b/test/sql/chunk_utils.sql @@ -413,7 +413,7 @@ SELECT hypertable_id FROM create_hypertable('chunk_id_from_relid_test', 'time', INSERT INTO chunk_id_from_relid_test VALUES (0, 1.1, 0), (0, 1.3, 11), (12, 2.0, 0), (12, 0.1, 11); -SELECT _timescaledb_internal.chunk_id_from_relid(tableoid) FROM chunk_id_from_relid_test; +SELECT _timescaledb_functions.chunk_id_from_relid(tableoid) FROM chunk_id_from_relid_test; DROP TABLE chunk_id_from_relid_test; @@ -425,11 +425,11 @@ SELECT hypertable_id FROM create_hypertable('chunk_id_from_relid_test', INSERT INTO chunk_id_from_relid_test VALUES (0, 1.1, 2), (0, 1.3, 11), (12, 2.0, 2), (12, 0.1, 11); -SELECT _timescaledb_internal.chunk_id_from_relid(tableoid) FROM chunk_id_from_relid_test; +SELECT _timescaledb_functions.chunk_id_from_relid(tableoid) FROM chunk_id_from_relid_test; \set ON_ERROR_STOP 0 -SELECT _timescaledb_internal.chunk_id_from_relid('pg_type'::regclass); -SELECT _timescaledb_internal.chunk_id_from_relid('chunk_id_from_relid_test'::regclass); +SELECT _timescaledb_functions.chunk_id_from_relid('pg_type'::regclass); +SELECT _timescaledb_functions.chunk_id_from_relid('chunk_id_from_relid_test'::regclass); -- test drop/show_chunks on custom partition types CREATE FUNCTION extract_time(a jsonb) @@ -620,7 +620,7 @@ WHERE hypertable_name = 'hyper1' and hypertable_schema = 'test1' ORDER BY chunk_name LIMIT 1 \gset -SELECT _timescaledb_internal.drop_chunk(:'CHNAME'); +SELECT _timescaledb_functions.drop_chunk(:'CHNAME'); SELECT chunk_schema as "CHSCHEMA", chunk_name as "CHNAME" FROM timescaledb_information.chunks WHERE hypertable_name = 'hyper1' and hypertable_schema = 'test1' diff --git a/test/sql/include/plan_expand_hypertable_chunks_in_query.sql b/test/sql/include/plan_expand_hypertable_chunks_in_query.sql index 57ce7f1462d..43b93f54379 100644 --- a/test/sql/include/plan_expand_hypertable_chunks_in_query.sql +++ b/test/sql/include/plan_expand_hypertable_chunks_in_query.sql @@ -8,36 +8,36 @@ SET constraint_exclusion = 'off'; :PREFIX SELECT * FROM hyper ORDER BY value; -- explicit chunk exclusion -:PREFIX SELECT * FROM hyper WHERE _timescaledb_internal.chunks_in(hyper, ARRAY[1,2]) ORDER BY value; -:PREFIX SELECT * FROM (SELECT * FROM hyper h WHERE _timescaledb_internal.chunks_in(h, ARRAY[1,2,3])) T ORDER BY value; -:PREFIX SELECT * FROM hyper WHERE _timescaledb_internal.chunks_in(hyper, ARRAY[1,2,3]) AND time < 10 ORDER BY value; -:PREFIX SELECT * FROM hyper_ts WHERE device_id = 'dev1' AND time < to_timestamp(10) AND _timescaledb_internal.chunks_in(hyper_ts, ARRAY[116]) ORDER BY value; -:PREFIX SELECT * FROM hyper_ts h JOIN tag on (h.tag_id = tag.id ) WHERE _timescaledb_internal.chunks_in(h, ARRAY[116]) AND time < to_timestamp(10) AND device_id = 'dev1' ORDER BY value; -:PREFIX SELECT * FROM hyper_w_space h1 JOIN hyper_ts h2 ON h1.device_id=h2.device_id WHERE _timescaledb_internal.chunks_in(h1, ARRAY[104,105]) AND _timescaledb_internal.chunks_in(h2, ARRAY[116,117]) ORDER BY h1.value; -:PREFIX SELECT * FROM hyper_w_space h1 JOIN hyper_ts h2 ON h1.device_id=h2.device_id AND _timescaledb_internal.chunks_in(h2, ARRAY[116,117]) WHERE _timescaledb_internal.chunks_in(h1, ARRAY[104,105]) ORDER BY h1.value; -:PREFIX SELECT * FROM hyper h1, hyper h2 WHERE _timescaledb_internal.chunks_in(h1, ARRAY[1,2]) AND _timescaledb_internal.chunks_in(h2, ARRAY[2,3]); +:PREFIX SELECT * FROM hyper WHERE _timescaledb_functions.chunks_in(hyper, ARRAY[1,2]) ORDER BY value; +:PREFIX SELECT * FROM (SELECT * FROM hyper h WHERE _timescaledb_functions.chunks_in(h, ARRAY[1,2,3])) T ORDER BY value; +:PREFIX SELECT * FROM hyper WHERE _timescaledb_functions.chunks_in(hyper, ARRAY[1,2,3]) AND time < 10 ORDER BY value; +:PREFIX SELECT * FROM hyper_ts WHERE device_id = 'dev1' AND time < to_timestamp(10) AND _timescaledb_functions.chunks_in(hyper_ts, ARRAY[116]) ORDER BY value; +:PREFIX SELECT * FROM hyper_ts h JOIN tag on (h.tag_id = tag.id ) WHERE _timescaledb_functions.chunks_in(h, ARRAY[116]) AND time < to_timestamp(10) AND device_id = 'dev1' ORDER BY value; +:PREFIX SELECT * FROM hyper_w_space h1 JOIN hyper_ts h2 ON h1.device_id=h2.device_id WHERE _timescaledb_functions.chunks_in(h1, ARRAY[104,105]) AND _timescaledb_functions.chunks_in(h2, ARRAY[116,117]) ORDER BY h1.value; +:PREFIX SELECT * FROM hyper_w_space h1 JOIN hyper_ts h2 ON h1.device_id=h2.device_id AND _timescaledb_functions.chunks_in(h2, ARRAY[116,117]) WHERE _timescaledb_functions.chunks_in(h1, ARRAY[104,105]) ORDER BY h1.value; +:PREFIX SELECT * FROM hyper h1, hyper h2 WHERE _timescaledb_functions.chunks_in(h1, ARRAY[1,2]) AND _timescaledb_functions.chunks_in(h2, ARRAY[2,3]); SET enable_seqscan=false; -- Should perform index-only scan. Since we pass whole row into the function it might block planner from using index-only scan. -- But since we'll remove the function from the query tree before planner decision it shouldn't affect index-only decision. -:PREFIX SELECT time FROM hyper WHERE time=0 AND _timescaledb_internal.chunks_in(hyper, ARRAY[1]); -:PREFIX SELECT first(value, time) FROM hyper h WHERE _timescaledb_internal.chunks_in(h, ARRAY[1]); +:PREFIX SELECT time FROM hyper WHERE time=0 AND _timescaledb_functions.chunks_in(hyper, ARRAY[1]); +:PREFIX SELECT first(value, time) FROM hyper h WHERE _timescaledb_functions.chunks_in(h, ARRAY[1]); \set ON_ERROR_STOP 0 -SELECT * FROM hyper WHERE _timescaledb_internal.chunks_in(hyper, ARRAY[1,2]) AND _timescaledb_internal.chunks_in(hyper, ARRAY[2,3]); -SELECT * FROM hyper WHERE _timescaledb_internal.chunks_in(2, ARRAY[1]); -SELECT * FROM hyper WHERE time < 10 OR _timescaledb_internal.chunks_in(hyper, ARRAY[1,2]); -SELECT _timescaledb_internal.chunks_in(hyper, ARRAY[1,2]) FROM hyper; +SELECT * FROM hyper WHERE _timescaledb_functions.chunks_in(hyper, ARRAY[1,2]) AND _timescaledb_functions.chunks_in(hyper, ARRAY[2,3]); +SELECT * FROM hyper WHERE _timescaledb_functions.chunks_in(2, ARRAY[1]); +SELECT * FROM hyper WHERE time < 10 OR _timescaledb_functions.chunks_in(hyper, ARRAY[1,2]); +SELECT _timescaledb_functions.chunks_in(hyper, ARRAY[1,2]) FROM hyper; -- non existing chunk id -SELECT * FROM hyper WHERE _timescaledb_internal.chunks_in(hyper, ARRAY[123456789]); +SELECT * FROM hyper WHERE _timescaledb_functions.chunks_in(hyper, ARRAY[123456789]); -- chunk that belongs to another hypertable -SELECT * FROM hyper WHERE _timescaledb_internal.chunks_in(hyper, ARRAY[104]); +SELECT * FROM hyper WHERE _timescaledb_functions.chunks_in(hyper, ARRAY[104]); -- passing wrong row ref -SELECT * FROM hyper WHERE _timescaledb_internal.chunks_in(ROW(1,2), ARRAY[104]); +SELECT * FROM hyper WHERE _timescaledb_functions.chunks_in(ROW(1,2), ARRAY[104]); -- passing func as chunk id -SELECT * FROM hyper h WHERE _timescaledb_internal.chunks_in(h, array_append(ARRAY[1],current_setting('server_version_num')::int)); +SELECT * FROM hyper h WHERE _timescaledb_functions.chunks_in(h, array_append(ARRAY[1],current_setting('server_version_num')::int)); -- NULL chunk IDs not allowed in chunk array -SELECT * FROM hyper h WHERE _timescaledb_internal.chunks_in(h, ARRAY[NULL::int]); +SELECT * FROM hyper h WHERE _timescaledb_functions.chunks_in(h, ARRAY[NULL::int]); \set ON_ERROR_STOP 1 -- chunks_in is STRICT function and for NULL arguments a null result is returned -SELECT * FROM hyper h WHERE _timescaledb_internal.chunks_in(h, NULL); +SELECT * FROM hyper h WHERE _timescaledb_functions.chunks_in(h, NULL); diff --git a/tsl/src/chunk_api.c b/tsl/src/chunk_api.c index 8493f447fd5..ec77ae8e8e4 100644 --- a/tsl/src/chunk_api.c +++ b/tsl/src/chunk_api.c @@ -399,7 +399,7 @@ chunk_create(PG_FUNCTION_ARGS) #define CREATE_CHUNK_FUNCTION_NAME "create_chunk" #define CREATE_CHUNK_NUM_ARGS 5 #define CHUNK_CREATE_STMT \ - "SELECT * FROM " INTERNAL_SCHEMA_NAME "." CREATE_CHUNK_FUNCTION_NAME "($1, $2, $3, $4, $5)" + "SELECT * FROM " FUNCTIONS_SCHEMA_NAME "." CREATE_CHUNK_FUNCTION_NAME "($1, $2, $3, $4, $5)" #define ESTIMATE_JSON_STR_SIZE(num_dims) (60 * (num_dims)) @@ -415,7 +415,7 @@ static void get_create_chunk_result_type(TupleDesc *tupdesc) { Oid funcoid = ts_get_function_oid(CREATE_CHUNK_FUNCTION_NAME, - INTERNAL_SCHEMA_NAME, + FUNCTIONS_SCHEMA_NAME, CREATE_CHUNK_NUM_ARGS, create_chunk_argtypes); @@ -1562,8 +1562,8 @@ chunk_api_iterate_colstats_context(FuncCallContext *funcctx) * This function reconstructs the fcinfo argument of the * chunk_api_get_chunk_stats() function in order to call * fetch_remote_chunk_stats() and execute either - * _timescaledb_internal.get_chunk_relstats() or - * _timescaledb_internal.get_chunk_colstats() remotely (depending on the + * _timescaledb_functions.get_chunk_relstats() or + * _timescaledb_functions.get_chunk_colstats() remotely (depending on the * passed `col_stats` bool). */ static void @@ -1586,7 +1586,7 @@ chunk_api_update_distributed_hypertable_chunk_stats(Oid table_id, bool col_stats /* Prepare fcinfo context for remote execution of _timescaledb_internal.get_chunk_relstats() */ funcoid = ts_get_function_oid(col_stats ? GET_CHUNK_COLSTATS_NAME : GET_CHUNK_RELSTATS_NAME, - INTERNAL_SCHEMA_NAME, + FUNCTIONS_SCHEMA_NAME, 1, get_chunk_stats_argtypes); fmgr_info_cxt(funcoid, &flinfo, CurrentMemoryContext); @@ -1779,7 +1779,7 @@ chunk_api_call_create_empty_chunk_table(const Hypertable *ht, const Chunk *chunk const char *node_name) { const char *create_cmd = - psprintf("SELECT %s.%s($1, $2, $3, $4)", INTERNAL_SCHEMA_NAME, CREATE_CHUNK_TABLE_NAME); + psprintf("SELECT %s.%s($1, $2, $3, $4)", FUNCTIONS_SCHEMA_NAME, CREATE_CHUNK_TABLE_NAME); const char *params[4] = { quote_qualified_identifier(NameStr(ht->fd.schema_name), NameStr(ht->fd.table_name)), chunk_api_dimension_slices_json(chunk, ht), diff --git a/tsl/src/chunk_copy.c b/tsl/src/chunk_copy.c index 60feff83758..d0b0f3db711 100644 --- a/tsl/src/chunk_copy.c +++ b/tsl/src/chunk_copy.c @@ -573,7 +573,7 @@ chunk_copy_create_dest_empty_compressed_chunk(ChunkCopy *cc) "FROM _timescaledb_catalog.hypertable h1 " "JOIN _timescaledb_catalog.hypertable h2 ON (h1.compressed_hypertable_id = h2.id) " "WHERE h1.table_name = %s", - INTERNAL_SCHEMA_NAME, + FUNCTIONS_SCHEMA_NAME, quote_literal_cstr(INTERNAL_SCHEMA_NAME), quote_literal_cstr(NameStr(cc->fd.compressed_chunk_name)), quote_literal_cstr(NameStr(ht->fd.table_name))); diff --git a/tsl/src/continuous_aggs/materialize.c b/tsl/src/continuous_aggs/materialize.c index 2114dad10a3..3831122fd7c 100644 --- a/tsl/src/continuous_aggs/materialize.c +++ b/tsl/src/continuous_aggs/materialize.c @@ -417,7 +417,7 @@ mattablecolumninfo_addinternal(MatTableColumnInfo *matcolinfo) * : chunk_for_tuple( htid, table.*). */ chunkfnoid = - LookupFuncName(list_make2(makeString(INTERNAL_SCHEMA_NAME), makeString(CHUNKIDFROMRELID)), + LookupFuncName(list_make2(makeString(FUNCTIONS_SCHEMA_NAME), makeString(CHUNKIDFROMRELID)), sizeof(argtype) / sizeof(argtype[0]), argtype, false); diff --git a/tsl/src/fdw/deparse.c b/tsl/src/fdw/deparse.c index 15da1b67ce9..5e25003496e 100644 --- a/tsl/src/fdw/deparse.c +++ b/tsl/src/fdw/deparse.c @@ -1306,7 +1306,7 @@ append_chunk_exclusion_condition(deparse_expr_cxt *context, bool use_alias) ListCell *lc; bool first = true; - appendStringInfoString(buf, INTERNAL_SCHEMA_NAME "." CHUNK_EXCL_FUNC_NAME "("); + appendStringInfoString(buf, FUNCTIONS_SCHEMA_NAME "." CHUNK_EXCL_FUNC_NAME "("); if (use_alias) appendStringInfo(buf, "%s%d, ", REL_ALIAS_PREFIX, scanrel->relid); diff --git a/tsl/test/expected/chunk_api.out b/tsl/test/expected/chunk_api.out index e4ca4b89a45..e3a2f867112 100644 --- a/tsl/test/expected/chunk_api.out +++ b/tsl/test/expected/chunk_api.out @@ -32,7 +32,7 @@ NOTICE: adding not-null constraint to column "time" (1 row) INSERT INTO chunkapi VALUES ('2018-01-01 05:00:00-8', 1, 23.4, int8range(4, 10)); -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('chunkapi') ORDER BY chunk_id; chunk_id | hypertable_id | schema_name | table_name | relkind | slices @@ -42,7 +42,7 @@ ORDER BY chunk_id; -- Creating a chunk with the constraints of an existing chunk should -- return the existing chunk -SELECT * FROM _timescaledb_internal.create_chunk('chunkapi',' {"time": [1514419200000000, 1515024000000000], "device": [-9223372036854775808, 1073741823]}'); +SELECT * FROM _timescaledb_functions.create_chunk('chunkapi',' {"time": [1514419200000000, 1515024000000000], "device": [-9223372036854775808, 1073741823]}'); chunk_id | hypertable_id | schema_name | table_name | relkind | slices | created ----------+---------------+-----------------------+------------------+---------+----------------------------------------------------------------------------------------------+--------- 1 | 1 | _timescaledb_internal | _hyper_1_1_chunk | r | {"time": [1514419200000000, 1515024000000000], "device": [-9223372036854775808, 1073741823]} | f @@ -51,36 +51,36 @@ SELECT * FROM _timescaledb_internal.create_chunk('chunkapi',' {"time": [15144192 \set VERBOSITY default \set ON_ERROR_STOP 0 -- Modified time constraint should fail with collision -SELECT * FROM _timescaledb_internal.create_chunk('chunkapi',' {"time": [1514419600000000, 1515024000000000], "device": [-9223372036854775808, 1073741823]}'); +SELECT * FROM _timescaledb_functions.create_chunk('chunkapi',' {"time": [1514419600000000, 1515024000000000], "device": [-9223372036854775808, 1073741823]}'); ERROR: chunk creation failed due to collision -- Missing dimension -SELECT * FROM _timescaledb_internal.create_chunk('chunkapi',' {"time": [1514419600000000, 1515024000000000]}'); +SELECT * FROM _timescaledb_functions.create_chunk('chunkapi',' {"time": [1514419600000000, 1515024000000000]}'); ERROR: invalid hypercube for hypertable "chunkapi" DETAIL: invalid number of hypercube dimensions -- Extra dimension -SELECT * FROM _timescaledb_internal.create_chunk('chunkapi',' {"time": [1514419600000000, 1515024000000000], "device": [-9223372036854775808, 1073741823], "time2": [1514419600000000, 1515024000000000]}'); +SELECT * FROM _timescaledb_functions.create_chunk('chunkapi',' {"time": [1514419600000000, 1515024000000000], "device": [-9223372036854775808, 1073741823], "time2": [1514419600000000, 1515024000000000]}'); ERROR: invalid hypercube for hypertable "chunkapi" DETAIL: invalid number of hypercube dimensions -- Bad dimension name -SELECT * FROM _timescaledb_internal.create_chunk('chunkapi',' {"time": [1514419600000000, 1515024000000000], "dev": [-9223372036854775808, 1073741823]}'); +SELECT * FROM _timescaledb_functions.create_chunk('chunkapi',' {"time": [1514419600000000, 1515024000000000], "dev": [-9223372036854775808, 1073741823]}'); ERROR: invalid hypercube for hypertable "chunkapi" DETAIL: dimension "dev" does not exist in hypertable -- Same dimension twice -SELECT * FROM _timescaledb_internal.create_chunk('chunkapi',' {"time": [1514419600000000, 1515024000000000], "time": [1514419600000000, 1515024000000000]}'); +SELECT * FROM _timescaledb_functions.create_chunk('chunkapi',' {"time": [1514419600000000, 1515024000000000], "time": [1514419600000000, 1515024000000000]}'); ERROR: invalid hypercube for hypertable "chunkapi" DETAIL: invalid number of hypercube dimensions -- Bad bounds format -SELECT * FROM _timescaledb_internal.create_chunk('chunkapi',' {"time": ["1514419200000000", 1515024000000000], "device": [-9223372036854775808, 1073741823]}'); +SELECT * FROM _timescaledb_functions.create_chunk('chunkapi',' {"time": ["1514419200000000", 1515024000000000], "device": [-9223372036854775808, 1073741823]}'); ERROR: invalid hypercube for hypertable "chunkapi" DETAIL: constraint for dimension "time" is not numeric -- Bad slices format -SELECT * FROM _timescaledb_internal.create_chunk('chunkapi',' {"time": [1515024000000000], "device": [-9223372036854775808, 1073741823]}'); +SELECT * FROM _timescaledb_functions.create_chunk('chunkapi',' {"time": [1515024000000000], "device": [-9223372036854775808, 1073741823]}'); ERROR: invalid hypercube for hypertable "chunkapi" DETAIL: unexpected number of dimensional bounds for dimension "time" -- Bad slices json -SELECT * FROM _timescaledb_internal.create_chunk('chunkapi',' {"time: [1515024000000000] "device": [-9223372036854775808, 1073741823]}'); +SELECT * FROM _timescaledb_functions.create_chunk('chunkapi',' {"time: [1515024000000000] "device": [-9223372036854775808, 1073741823]}'); ERROR: invalid input syntax for type json -LINE 1: ...ROM _timescaledb_internal.create_chunk('chunkapi',' {"time: ... +LINE 1: ...OM _timescaledb_functions.create_chunk('chunkapi',' {"time: ... ^ DETAIL: Token "device" is invalid. CONTEXT: JSON data, line 1: {"time: [1515024000000000] "device... @@ -89,45 +89,45 @@ SET ROLE :ROLE_DEFAULT_PERM_USER; -- Test create_chunk_table for errors \set ON_ERROR_STOP 0 -- Test create_chunk_table for NULL input -SELECT * FROM _timescaledb_internal.create_chunk_table(NULL,' {"time": [1515024000000000, 1519024000000000], "device": [-9223372036854775808, 1073741823]}', '_timescaledb_internal','_hyper_1_1_chunk'); +SELECT * FROM _timescaledb_functions.create_chunk_table(NULL,' {"time": [1515024000000000, 1519024000000000], "device": [-9223372036854775808, 1073741823]}', '_timescaledb_internal','_hyper_1_1_chunk'); ERROR: hypertable cannot be NULL -SELECT * FROM _timescaledb_internal.create_chunk_table('chunkapi', NULL, '_timescaledb_internal','_hyper_1_1_chunk'); +SELECT * FROM _timescaledb_functions.create_chunk_table('chunkapi', NULL, '_timescaledb_internal','_hyper_1_1_chunk'); ERROR: slices cannot be NULL -SELECT * FROM _timescaledb_internal.create_chunk_table('chunkapi',' {"time": [1515024000000000, 1519024000000000], "device": [-9223372036854775808, 1073741823]}', NULL,'_hyper_1_1_chunk'); +SELECT * FROM _timescaledb_functions.create_chunk_table('chunkapi',' {"time": [1515024000000000, 1519024000000000], "device": [-9223372036854775808, 1073741823]}', NULL,'_hyper_1_1_chunk'); ERROR: chunk schema name cannot be NULL -SELECT * FROM _timescaledb_internal.create_chunk_table('chunkapi',' {"time": [1515024000000000, 1519024000000000], "device": [-9223372036854775808, 1073741823]}', '_timescaledb_internal',NULL); +SELECT * FROM _timescaledb_functions.create_chunk_table('chunkapi',' {"time": [1515024000000000, 1519024000000000], "device": [-9223372036854775808, 1073741823]}', '_timescaledb_internal',NULL); ERROR: chunk table name cannot be NULL -- Modified time constraint should fail with collision -SELECT * FROM _timescaledb_internal.create_chunk_table('chunkapi',' {"time": [1514419600000000, 1515024000000000], "device": [-9223372036854775808, 1073741823]}', '_timescaledb_internal','_hyper_1_1_chunk'); +SELECT * FROM _timescaledb_functions.create_chunk_table('chunkapi',' {"time": [1514419600000000, 1515024000000000], "device": [-9223372036854775808, 1073741823]}', '_timescaledb_internal','_hyper_1_1_chunk'); ERROR: chunk table creation failed due to dimension slice collision -- Missing dimension -SELECT * FROM _timescaledb_internal.create_chunk_table('chunkapi',' {"time": [1514419600000000, 1515024000000000]}', '_timescaledb_internal','_hyper_1_1_chunk'); +SELECT * FROM _timescaledb_functions.create_chunk_table('chunkapi',' {"time": [1514419600000000, 1515024000000000]}', '_timescaledb_internal','_hyper_1_1_chunk'); ERROR: invalid hypercube for hypertable "chunkapi" DETAIL: invalid number of hypercube dimensions -- Extra dimension -SELECT * FROM _timescaledb_internal.create_chunk_table('chunkapi',' {"time": [1514419600000000, 1515024000000000], "device": [-9223372036854775808, 1073741823], "time2": [1514419600000000, 1515024000000000]}', '_timescaledb_internal','_hyper_1_1_chunk'); +SELECT * FROM _timescaledb_functions.create_chunk_table('chunkapi',' {"time": [1514419600000000, 1515024000000000], "device": [-9223372036854775808, 1073741823], "time2": [1514419600000000, 1515024000000000]}', '_timescaledb_internal','_hyper_1_1_chunk'); ERROR: invalid hypercube for hypertable "chunkapi" DETAIL: invalid number of hypercube dimensions -- Bad dimension name -SELECT * FROM _timescaledb_internal.create_chunk_table('chunkapi',' {"time": [1514419600000000, 1515024000000000], "dev": [-9223372036854775808, 1073741823]}', '_timescaledb_internal','_hyper_1_1_chunk'); +SELECT * FROM _timescaledb_functions.create_chunk_table('chunkapi',' {"time": [1514419600000000, 1515024000000000], "dev": [-9223372036854775808, 1073741823]}', '_timescaledb_internal','_hyper_1_1_chunk'); ERROR: invalid hypercube for hypertable "chunkapi" DETAIL: dimension "dev" does not exist in hypertable -- Same dimension twice -SELECT * FROM _timescaledb_internal.create_chunk_table('chunkapi',' {"time": [1514419600000000, 1515024000000000], "time": [1514419600000000, 1515024000000000]}', '_timescaledb_internal','_hyper_1_1_chunk'); +SELECT * FROM _timescaledb_functions.create_chunk_table('chunkapi',' {"time": [1514419600000000, 1515024000000000], "time": [1514419600000000, 1515024000000000]}', '_timescaledb_internal','_hyper_1_1_chunk'); ERROR: invalid hypercube for hypertable "chunkapi" DETAIL: invalid number of hypercube dimensions -- Bad bounds format -SELECT * FROM _timescaledb_internal.create_chunk_table('chunkapi',' {"time": ["1514419200000000", 1515024000000000], "device": [-9223372036854775808, 1073741823]}', '_timescaledb_internal','_hyper_1_1_chunk'); +SELECT * FROM _timescaledb_functions.create_chunk_table('chunkapi',' {"time": ["1514419200000000", 1515024000000000], "device": [-9223372036854775808, 1073741823]}', '_timescaledb_internal','_hyper_1_1_chunk'); ERROR: invalid hypercube for hypertable "chunkapi" DETAIL: constraint for dimension "time" is not numeric -- Bad slices format -SELECT * FROM _timescaledb_internal.create_chunk_table('chunkapi',' {"time": [1515024000000000], "device": [-9223372036854775808, 1073741823]}', '_timescaledb_internal','_hyper_1_1_chunk'); +SELECT * FROM _timescaledb_functions.create_chunk_table('chunkapi',' {"time": [1515024000000000], "device": [-9223372036854775808, 1073741823]}', '_timescaledb_internal','_hyper_1_1_chunk'); ERROR: invalid hypercube for hypertable "chunkapi" DETAIL: unexpected number of dimensional bounds for dimension "time" -- Bad slices json -SELECT * FROM _timescaledb_internal.create_chunk_table('chunkapi',' {"time: [1515024000000000] "device": [-9223372036854775808, 1073741823]}', '_timescaledb_internal','_hyper_1_1_chunk'); +SELECT * FROM _timescaledb_functions.create_chunk_table('chunkapi',' {"time: [1515024000000000] "device": [-9223372036854775808, 1073741823]}', '_timescaledb_internal','_hyper_1_1_chunk'); ERROR: invalid input syntax for type json -LINE 1: ...imescaledb_internal.create_chunk_table('chunkapi',' {"time: ... +LINE 1: ...mescaledb_functions.create_chunk_table('chunkapi',' {"time: ... ^ DETAIL: Token "device" is invalid. CONTEXT: JSON data, line 1: {"time: [1515024000000000] "device... @@ -138,7 +138,7 @@ CONTEXT: JSON data, line 1: {"time: [1515024000000000] "device... SET ROLE :ROLE_SUPERUSER; GRANT INSERT ON chunkapi TO :ROLE_DEFAULT_PERM_USER_2; SET ROLE :ROLE_DEFAULT_PERM_USER_2; -SELECT * FROM _timescaledb_internal.create_chunk('chunkapi',' {"time": [1515024000000000, 1519024000000000], "device": [-9223372036854775808, 1073741823]}', 'ChunkSchema', 'My_chunk_Table_name'); +SELECT * FROM _timescaledb_functions.create_chunk('chunkapi',' {"time": [1515024000000000, 1519024000000000], "device": [-9223372036854775808, 1073741823]}', 'ChunkSchema', 'My_chunk_Table_name'); chunk_id | hypertable_id | schema_name | table_name | relkind | slices | created ----------+---------------+-------------+---------------------+---------+----------------------------------------------------------------------------------------------+--------- 2 | 1 | ChunkSchema | My_chunk_Table_name | r | {"time": [1515024000000000, 1519024000000000], "device": [-9223372036854775808, 1073741823]} | t @@ -146,7 +146,7 @@ SELECT * FROM _timescaledb_internal.create_chunk('chunkapi',' {"time": [15150240 SET ROLE :ROLE_DEFAULT_PERM_USER; \set VERBOSITY terse -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('chunkapi') ORDER BY chunk_id; chunk_id | hypertable_id | schema_name | table_name | relkind | slices @@ -180,7 +180,7 @@ SELECT setseed(1); -- Test getting relation stats for chunks. First get stats -- chunk-by-chunk. Note that the table isn't ANALYZED, so no stats -- present yet. -SELECT (_timescaledb_internal.get_chunk_relstats(show_chunks)).* +SELECT (_timescaledb_functions.get_chunk_relstats(show_chunks)).* FROM show_chunks('chunkapi') ORDER BY chunk_id; chunk_id | hypertable_id | num_pages | num_tuples | num_allvisible @@ -189,7 +189,7 @@ ORDER BY chunk_id; 2 | 1 | 0 | 0 | 0 (2 rows) -SELECT (_timescaledb_internal.get_chunk_colstats(show_chunks)).* +SELECT (_timescaledb_functions.get_chunk_colstats(show_chunks)).* FROM show_chunks('chunkapi') ORDER BY chunk_id; chunk_id | hypertable_id | att_num | nullfrac | width | distinctval | slotkind | slotopstrings | slotcollations | slot1numbers | slot2numbers | slot3numbers | slot4numbers | slot5numbers | slotvaluetypetrings | slot1values | slot2values | slot3values | slot4values | slot5values @@ -197,21 +197,21 @@ ORDER BY chunk_id; (0 rows) -- Get the same stats but by giving the hypertable as input -SELECT * FROM _timescaledb_internal.get_chunk_relstats('chunkapi'); +SELECT * FROM _timescaledb_functions.get_chunk_relstats('chunkapi'); chunk_id | hypertable_id | num_pages | num_tuples | num_allvisible ----------+---------------+-----------+------------+---------------- 1 | 1 | 0 | 0 | 0 2 | 1 | 0 | 0 | 0 (2 rows) -SELECT * FROM _timescaledb_internal.get_chunk_colstats('chunkapi'); +SELECT * FROM _timescaledb_functions.get_chunk_colstats('chunkapi'); chunk_id | hypertable_id | att_num | nullfrac | width | distinctval | slotkind | slotopstrings | slotcollations | slot1numbers | slot2numbers | slot3numbers | slot4numbers | slot5numbers | slotvaluetypetrings | slot1values | slot2values | slot3values | slot4values | slot5values ----------+---------------+---------+----------+-------+-------------+----------+---------------+----------------+--------------+--------------+--------------+--------------+--------------+---------------------+-------------+-------------+-------------+-------------+------------- (0 rows) -- reltuples is -1 on PG14 when no VACUUM/ANALYZE has run yet SELECT relname, CASE WHEN reltuples > 0 THEN reltuples ELSE 0 END AS reltuples, relpages, relallvisible FROM pg_class WHERE relname IN -(SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name +(SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('chunkapi')) ORDER BY relname; relname | reltuples | relpages | relallvisible @@ -222,7 +222,7 @@ ORDER BY relname; SELECT tablename, attname, inherited, null_frac, avg_width, n_distinct FROM pg_stats WHERE tablename IN -(SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name +(SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('chunkapi')) ORDER BY tablename, attname; tablename | attname | inherited | null_frac | avg_width | n_distinct @@ -231,14 +231,14 @@ ORDER BY tablename, attname; -- Show stats after analyze ANALYZE chunkapi; -SELECT * FROM _timescaledb_internal.get_chunk_relstats('chunkapi'); +SELECT * FROM _timescaledb_functions.get_chunk_relstats('chunkapi'); chunk_id | hypertable_id | num_pages | num_tuples | num_allvisible ----------+---------------+-----------+------------+---------------- 1 | 1 | 1 | 1 | 0 2 | 1 | 0 | 0 | 0 (2 rows) -SELECT * FROM _timescaledb_internal.get_chunk_colstats('chunkapi'); +SELECT * FROM _timescaledb_functions.get_chunk_colstats('chunkapi'); chunk_id | hypertable_id | att_num | nullfrac | width | distinctval | slotkind | slotopstrings | slotcollations | slot1numbers | slot2numbers | slot3numbers | slot4numbers | slot5numbers | slotvaluetypetrings | slot1values | slot2values | slot3values | slot4values | slot5values ----------+---------------+---------+----------+-------+-------------+-------------+----------------------------------------------------+----------------+--------------+--------------+--------------+--------------+--------------+---------------------+-------------+-------------+-------------+-------------+------------- 1 | 1 | 1 | 0 | 8 | -1 | {0,0,0,0,0} | {} | {0,0,0,0,0} | | | | | | {} | | | | | @@ -248,7 +248,7 @@ SELECT * FROM _timescaledb_internal.get_chunk_colstats('chunkapi'); (4 rows) SELECT relname, reltuples, relpages, relallvisible FROM pg_class WHERE relname IN -(SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name +(SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('chunkapi')) ORDER BY relname; relname | reltuples | relpages | relallvisible @@ -259,7 +259,7 @@ ORDER BY relname; SELECT tablename, attname, inherited, null_frac, avg_width, n_distinct FROM pg_stats WHERE tablename IN -(SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name +(SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('chunkapi')) ORDER BY tablename, attname; tablename | attname | inherited | null_frac | avg_width | n_distinct @@ -303,20 +303,20 @@ INSERT INTO disttable VALUES ('2018-01-01 05:00:00-8', 1, 23.4, 'green'), -- Make sure we get deterministic behavior across all nodes CALL distributed_exec($$ SELECT setseed(1); $$); -- No stats on the local table -SELECT * FROM _timescaledb_internal.get_chunk_relstats('disttable'); +SELECT * FROM _timescaledb_functions.get_chunk_relstats('disttable'); chunk_id | hypertable_id | num_pages | num_tuples | num_allvisible ----------+---------------+-----------+------------+---------------- 3 | 2 | 0 | 0 | 0 4 | 2 | 0 | 0 | 0 (2 rows) -SELECT * FROM _timescaledb_internal.get_chunk_colstats('disttable'); +SELECT * FROM _timescaledb_functions.get_chunk_colstats('disttable'); chunk_id | hypertable_id | att_num | nullfrac | width | distinctval | slotkind | slotopstrings | slotcollations | slot1numbers | slot2numbers | slot3numbers | slot4numbers | slot5numbers | slotvaluetypetrings | slot1values | slot2values | slot3values | slot4values | slot5values ----------+---------------+---------+----------+-------+-------------+----------+---------------+----------------+--------------+--------------+--------------+--------------+--------------+---------------------+-------------+-------------+-------------+-------------+------------- (0 rows) SELECT relname, reltuples, relpages, relallvisible FROM pg_class WHERE relname IN -(SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name +(SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable')) ORDER BY relname; relname | reltuples | relpages | relallvisible @@ -326,7 +326,7 @@ ORDER BY relname; (2 rows) SELECT * FROM pg_stats WHERE tablename IN -(SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name +(SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable')) ORDER BY 1,2,3; schemaname | tablename | attname | inherited | null_frac | avg_width | n_distinct | most_common_vals | most_common_freqs | histogram_bounds | correlation | most_common_elems | most_common_elem_freqs | elem_count_histogram @@ -337,7 +337,7 @@ ORDER BY 1,2,3; CALL distributed_exec('ANALYZE disttable', ARRAY[:'DATA_NODE_1']); -- Stats should now be refreshed after running get_chunk_{col,rel}stats SELECT relname, reltuples, relpages, relallvisible FROM pg_class WHERE relname IN -(SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name +(SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable')) ORDER BY relname; relname | reltuples | relpages | relallvisible @@ -347,21 +347,21 @@ ORDER BY relname; (2 rows) SELECT * FROM pg_stats WHERE tablename IN -(SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name +(SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable')) ORDER BY 1,2,3; schemaname | tablename | attname | inherited | null_frac | avg_width | n_distinct | most_common_vals | most_common_freqs | histogram_bounds | correlation | most_common_elems | most_common_elem_freqs | elem_count_histogram ------------+-----------+---------+-----------+-----------+-----------+------------+------------------+-------------------+------------------+-------------+-------------------+------------------------+---------------------- (0 rows) -SELECT * FROM _timescaledb_internal.get_chunk_relstats('disttable'); +SELECT * FROM _timescaledb_functions.get_chunk_relstats('disttable'); chunk_id | hypertable_id | num_pages | num_tuples | num_allvisible ----------+---------------+-----------+------------+---------------- 3 | 2 | 1 | 2 | 0 4 | 2 | 0 | 0 | 0 (2 rows) -SELECT * FROM _timescaledb_internal.get_chunk_colstats('disttable'); +SELECT * FROM _timescaledb_functions.get_chunk_colstats('disttable'); chunk_id | hypertable_id | att_num | nullfrac | width | distinctval | slotkind | slotopstrings | slotcollations | slot1numbers | slot2numbers | slot3numbers | slot4numbers | slot5numbers | slotvaluetypetrings | slot1values | slot2values | slot3values | slot4values | slot5values ----------+---------------+---------+----------+-------+-------------+-------------+-------------------------------------------------------------------------------------------------------------------------+-----------------+--------------+--------------+--------------+--------------+--------------+--------------------------+-----------------------------------------------------------------+-------------+-------------+-------------+------------- 3 | 2 | 1 | 0 | 8 | -1 | {2,3,0,0,0} | {<,pg_catalog,timestamptz,pg_catalog,timestamptz,pg_catalog,<,pg_catalog,timestamptz,pg_catalog,timestamptz,pg_catalog} | {0,0,0,0,0} | | {1} | | | | {timestamptz,pg_catalog} | {"Mon Jan 01 05:00:00 2018 PST","Mon Jan 01 06:00:00 2018 PST"} | | | | @@ -371,7 +371,7 @@ SELECT * FROM _timescaledb_internal.get_chunk_colstats('disttable'); (4 rows) SELECT relname, reltuples, relpages, relallvisible FROM pg_class WHERE relname IN -(SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name +(SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable')) ORDER BY relname; relname | reltuples | relpages | relallvisible @@ -381,7 +381,7 @@ ORDER BY relname; (2 rows) SELECT * FROM pg_stats WHERE tablename IN -(SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name +(SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable')) ORDER BY 1,2,3; schemaname | tablename | attname | inherited | null_frac | avg_width | n_distinct | most_common_vals | most_common_freqs | histogram_bounds | correlation | most_common_elems | most_common_elem_freqs | elem_count_histogram @@ -394,7 +394,7 @@ ORDER BY 1,2,3; -- Test that user without table permissions can't get column stats SET ROLE :ROLE_DEFAULT_PERM_USER; -SELECT * FROM _timescaledb_internal.get_chunk_colstats('disttable'); +SELECT * FROM _timescaledb_functions.get_chunk_colstats('disttable'); chunk_id | hypertable_id | att_num | nullfrac | width | distinctval | slotkind | slotopstrings | slotcollations | slot1numbers | slot2numbers | slot3numbers | slot4numbers | slot5numbers | slotvaluetypetrings | slot1values | slot2values | slot3values | slot4values | slot5values ----------+---------------+---------+----------+-------+-------------+----------+---------------+----------------+--------------+--------------+--------------+--------------+--------------+---------------------+-------------+-------------+-------------+-------------+------------- (0 rows) @@ -403,14 +403,14 @@ SET ROLE :ROLE_1; -- Run ANALYZE again, but on both nodes. ANALYZE disttable; -- Now expect stats from all data node chunks -SELECT * FROM _timescaledb_internal.get_chunk_relstats('disttable'); +SELECT * FROM _timescaledb_functions.get_chunk_relstats('disttable'); chunk_id | hypertable_id | num_pages | num_tuples | num_allvisible ----------+---------------+-----------+------------+---------------- 3 | 2 | 1 | 2 | 0 4 | 2 | 1 | 1 | 0 (2 rows) -SELECT * FROM _timescaledb_internal.get_chunk_colstats('disttable'); +SELECT * FROM _timescaledb_functions.get_chunk_colstats('disttable'); chunk_id | hypertable_id | att_num | nullfrac | width | distinctval | slotkind | slotopstrings | slotcollations | slot1numbers | slot2numbers | slot3numbers | slot4numbers | slot5numbers | slotvaluetypetrings | slot1values | slot2values | slot3values | slot4values | slot5values ----------+---------------+---------+----------+-------+-------------+-------------+-------------------------------------------------------------------------------------------------------------------------+-----------------+--------------+--------------+--------------+--------------+--------------+--------------------------+-----------------------------------------------------------------+-------------+-------------+-------------+------------- 3 | 2 | 1 | 0 | 8 | -1 | {2,3,0,0,0} | {<,pg_catalog,timestamptz,pg_catalog,timestamptz,pg_catalog,<,pg_catalog,timestamptz,pg_catalog,timestamptz,pg_catalog} | {0,0,0,0,0} | | {1} | | | | {timestamptz,pg_catalog} | {"Mon Jan 01 05:00:00 2018 PST","Mon Jan 01 06:00:00 2018 PST"} | | | | @@ -438,7 +438,7 @@ INSERT INTO disttable VALUES ('2019-01-01 05:00:00-8', 1, 23.4, 'green'); ANALYZE disttable; ANALYZE disttable; SELECT relname, reltuples, relpages, relallvisible FROM pg_class WHERE relname IN -(SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name +(SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable')) ORDER BY relname; relname | reltuples | relpages | relallvisible @@ -449,7 +449,7 @@ ORDER BY relname; (3 rows) SELECT * FROM pg_stats WHERE tablename IN -(SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name +(SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable')) ORDER BY 1,2,3; schemaname | tablename | attname | inherited | null_frac | avg_width | n_distinct | most_common_vals | most_common_freqs | histogram_bounds | correlation | most_common_elems | most_common_elem_freqs | elem_count_histogram @@ -578,7 +578,7 @@ FROM timescaledb_information.chunks c ORDER BY chunk_name DESC LIMIT 1 \gset SELECT slices AS "SLICES" -FROM _timescaledb_internal.show_chunk(:'CHUNK_SCHEMA'||'.'||:'CHUNK_NAME') \gset +FROM _timescaledb_functions.show_chunk(:'CHUNK_SCHEMA'||'.'||:'CHUNK_NAME') \gset SELECT relname FROM pg_catalog.pg_inherits, pg_class WHERE inhrelid = (:'CHUNK_SCHEMA'||'.'||:'CHUNK_NAME')::regclass AND inhparent = oid; @@ -604,7 +604,7 @@ SELECT * FROM _timescaledb_catalog.dimension_slice ORDER BY id; (2 rows) SELECT count(*) FROM - _timescaledb_internal.create_chunk_table('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME'); + _timescaledb_functions.create_chunk_table('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME'); count ------- 1 @@ -626,7 +626,7 @@ WHERE inhrelid = (:'CHUNK_SCHEMA'||'.'||:'CHUNK_NAME')::regclass AND inhparent = -- Test that creat_chunk fails since chunk table already exists \set ON_ERROR_STOP 0 -SELECT * FROM _timescaledb_internal.create_chunk('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME'); +SELECT * FROM _timescaledb_functions.create_chunk('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME'); ERROR: relation "_hyper_1_1_chunk" already exists \set ON_ERROR_STOP 1 -- Test create_chunk_table on a hypertable where the chunk didn't exist before @@ -641,7 +641,7 @@ NOTICE: adding not-null constraint to column "time" (1 row) SELECT count(*) FROM - _timescaledb_internal.create_chunk_table('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME'); + _timescaledb_functions.create_chunk_table('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME'); count ------- 1 @@ -658,7 +658,7 @@ SELECT * FROM create_hypertable('chunkapi', 'time', 'device', 2, '3d'); (1 row) SELECT count(*) FROM - _timescaledb_internal.create_chunk_table('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME'); + _timescaledb_functions.create_chunk_table('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME'); count ------- 1 @@ -674,7 +674,7 @@ SELECT * FROM create_hypertable('chunkapi', 'time', 'device', 3); (1 row) SELECT count(*) FROM - _timescaledb_internal.create_chunk_table('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME'); + _timescaledb_functions.create_chunk_table('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME'); count ------- 1 @@ -692,7 +692,7 @@ SELECT * FROM create_hypertable('chunkapi', 'time', 'device', 3); INSERT INTO chunkapi VALUES ('2018-01-01 05:00:00-8', 1, 23.4); \set ON_ERROR_STOP 0 -SELECT _timescaledb_internal.create_chunk_table('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME'); +SELECT _timescaledb_functions.create_chunk_table('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME'); ERROR: chunk table creation failed due to dimension slice collision \set ON_ERROR_STOP 1 -- Test create_chunk_table when a chunk exists in different space partition and thus doesn't collide @@ -705,7 +705,7 @@ SELECT * FROM create_hypertable('chunkapi', 'time', 'device', 2); (1 row) INSERT INTO chunkapi VALUES ('2018-01-01 05:00:00-8', 2, 23.4); -SELECT _timescaledb_internal.create_chunk_table('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME'); +SELECT _timescaledb_functions.create_chunk_table('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME'); create_chunk_table -------------------- t @@ -722,7 +722,7 @@ SELECT * FROM create_hypertable('chunkapi', 'time', 'device', 2); (1 row) INSERT INTO chunkapi VALUES ('2018-02-01 05:00:00-8', 1, 23.4); -SELECT _timescaledb_internal.create_chunk_table('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME'); +SELECT _timescaledb_functions.create_chunk_table('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME'); create_chunk_table -------------------- t @@ -760,7 +760,7 @@ SELECT attach_tablespace('tablespace2', 'chunkapi'); (1 row) SELECT count(*) FROM - _timescaledb_internal.create_chunk_table('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME'); + _timescaledb_functions.create_chunk_table('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME'); count ------- 1 @@ -790,7 +790,7 @@ FROM timescaledb_information.chunks c ORDER BY chunk_name DESC LIMIT 1 \gset SELECT slices AS "SLICES" -FROM _timescaledb_internal.show_chunk(:'CHUNK_SCHEMA'||'.'||:'CHUNK_NAME') \gset +FROM _timescaledb_functions.show_chunk(:'CHUNK_SCHEMA'||'.'||:'CHUNK_NAME') \gset -- Save the constraints info in a table for later comparison CREATE TABLE original_chunk_constraints AS SELECT "Constraint", "Type", "Columns", "Index"::text, "Expr", "Deferrable", "Deferred", "Validated" @@ -819,7 +819,7 @@ SELECT attach_tablespace('tablespace2', 'chunkapi'); (1 row) SELECT count(*) FROM - _timescaledb_internal.create_chunk_table('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME'); + _timescaledb_functions.create_chunk_table('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME'); count ------- 1 @@ -832,7 +832,7 @@ SELECT tablespace FROM pg_tables WHERE tablename = :'CHUNK_NAME'; (1 row) -- Now create the complete chunk from the chunk table -SELECT _timescaledb_internal.create_chunk('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME', +SELECT _timescaledb_functions.create_chunk('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME', format('%I.%I', :'CHUNK_SCHEMA', :'CHUNK_NAME')::regclass); create_chunk --------------------------------------------------------------------------------------------------------- @@ -897,7 +897,7 @@ WHERE inhrelid = (:'CHUNK_SCHEMA'||'.'||:'CHUNK_NAME')::regclass AND inhparent = SELECT :'CHUNK_SCHEMA' AS expected_schema, :'CHUNK_NAME' AS expected_table_name, - (_timescaledb_internal.show_chunk(ch)).* + (_timescaledb_functions.show_chunk(ch)).* FROM show_chunks('chunkapi') ch; expected_schema | expected_table_name | chunk_id | hypertable_id | schema_name | table_name | relkind | slices -----------------------+---------------------+----------+---------------+-----------------------+--------------------+---------+------------------------------------------------ @@ -930,7 +930,7 @@ INSERT INTO newchunk VALUES ('2018-01-01 05:00:00-8', 1, 23.4); -- constraints, but not foreign key, unique, or primary key -- constraints. We should probably add checks to enforce the latter -- too or auto-create all constraints. -SELECT * FROM _timescaledb_internal.create_chunk('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME', 'newchunk'); +SELECT * FROM _timescaledb_functions.create_chunk('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME', 'newchunk'); ERROR: child table is missing constraint "chunkapi_temp_check" \set ON_ERROR_STOP 1 -- Add the missing CHECK constraint. Note that the name must be the @@ -938,7 +938,7 @@ ERROR: child table is missing constraint "chunkapi_temp_check" ALTER TABLE newchunk ADD CONSTRAINT chunkapi_temp_check CHECK (temp > 0); CREATE TABLE newchunk2 as select * from newchunk; ALTER TABLE newchunk2 ADD CONSTRAINT chunkapi_temp_check CHECK (temp > 0); -SELECT * FROM _timescaledb_internal.create_chunk('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME', 'newchunk'); +SELECT * FROM _timescaledb_functions.create_chunk('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME', 'newchunk'); chunk_id | hypertable_id | schema_name | table_name | relkind | slices | created ----------+---------------+-----------------------+--------------------+---------+------------------------------------------------+--------- 13 | 11 | _timescaledb_internal | _hyper_10_10_chunk | r | {"time": [1514419200000000, 1515024000000000]} | t @@ -946,14 +946,14 @@ SELECT * FROM _timescaledb_internal.create_chunk('chunkapi', :'SLICES', :'CHUNK_ -- adding an existing table to an exiting range must fail \set ON_ERROR_STOP 0 -SELECT * FROM _timescaledb_internal.create_chunk('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME', 'newchunk2'); +SELECT * FROM _timescaledb_functions.create_chunk('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME', 'newchunk2'); ERROR: chunk creation failed due to collision \set ON_ERROR_STOP 1 -- Show the chunk and that names are what we'd expect SELECT :'CHUNK_SCHEMA' AS expected_schema, :'CHUNK_NAME' AS expected_table_name, - (_timescaledb_internal.show_chunk(ch)).* + (_timescaledb_functions.show_chunk(ch)).* FROM show_chunks('chunkapi') ch; expected_schema | expected_table_name | chunk_id | hypertable_id | schema_name | table_name | relkind | slices -----------------------+---------------------+----------+---------------+-----------------------+--------------------+---------+------------------------------------------------ diff --git a/tsl/test/expected/chunk_utils_internal.out b/tsl/test/expected/chunk_utils_internal.out index 1dab840229a..a51ab75d681 100644 --- a/tsl/test/expected/chunk_utils_internal.out +++ b/tsl/test/expected/chunk_utils_internal.out @@ -65,7 +65,7 @@ WHERE hypertable_name = 'hyper1' and hypertable_schema = 'test1' ORDER BY chunk_name LIMIT 1 \gset -- Freeze -SELECT _timescaledb_internal.freeze_chunk( :'CHNAME'); +SELECT _timescaledb_functions.freeze_chunk( :'CHNAME'); freeze_chunk -------------- t @@ -203,7 +203,7 @@ FROM _timescaledb_catalog.chunk WHERE table_name = :'CHUNK_NAME'; _hyper_1_1_chunk | 4 (1 row) -SELECT _timescaledb_internal.unfreeze_chunk( :'CHNAME'); +SELECT _timescaledb_functions.unfreeze_chunk( :'CHNAME'); unfreeze_chunk ---------------- t @@ -227,13 +227,13 @@ UPDATE test1.hyper1 SET temp = 40; -- Test delete works after unfreeze DELETE FROM test1.hyper1; --unfreezing again works -SELECT _timescaledb_internal.unfreeze_chunk( :'CHNAME'); +SELECT _timescaledb_functions.unfreeze_chunk( :'CHNAME'); unfreeze_chunk ---------------- t (1 row) -SELECT _timescaledb_internal.drop_chunk( :'CHNAME'); +SELECT _timescaledb_functions.drop_chunk( :'CHNAME'); drop_chunk ------------ t @@ -271,7 +271,7 @@ SELECT compress_chunk( :'CHNAME'); _timescaledb_internal._hyper_2_3_chunk (1 row) -SELECT _timescaledb_internal.freeze_chunk( :'CHNAME'); +SELECT _timescaledb_functions.freeze_chunk( :'CHNAME'); freeze_chunk -------------- t @@ -299,7 +299,7 @@ DELETE FROM public.table_to_compress WHERE time < '2020-01-02'; ERROR: cannot modify frozen chunk status \set ON_ERROR_STOP 1 --try to refreeze -SELECT _timescaledb_internal.freeze_chunk( :'CHNAME'); +SELECT _timescaledb_functions.freeze_chunk( :'CHNAME'); freeze_chunk -------------- t @@ -331,13 +331,13 @@ SELECT drop_chunks('table_to_compress', older_than=> '1 day'::interval); (2 rows) --unfreeze and drop it -SELECT _timescaledb_internal.unfreeze_chunk( :'CHNAME'); +SELECT _timescaledb_functions.unfreeze_chunk( :'CHNAME'); unfreeze_chunk ---------------- t (1 row) -SELECT _timescaledb_internal.drop_chunk( :'CHNAME'); +SELECT _timescaledb_functions.drop_chunk( :'CHNAME'); drop_chunk ------------ t @@ -351,7 +351,7 @@ FROM timescaledb_information.chunks WHERE hypertable_name = 'table_to_compress' and hypertable_schema = 'public' ORDER BY chunk_name DESC LIMIT 1 \gset -SELECT _timescaledb_internal.freeze_chunk( :'CHNAME'); +SELECT _timescaledb_functions.freeze_chunk( :'CHNAME'); freeze_chunk -------------- t @@ -365,7 +365,7 @@ ERROR: compress_chunk not permitted on frozen chunk "_hyper_2_7_chunk" --DO NOT CHANGE this behavior --- -- frozen chunks cannot be dropped. \set ON_ERROR_STOP 0 -SELECT _timescaledb_internal.drop_chunk(:'CHNAME'); +SELECT _timescaledb_functions.drop_chunk(:'CHNAME'); ERROR: drop_chunk not permitted on frozen chunk "_hyper_2_7_chunk" \set ON_ERROR_STOP 1 -- Prepare table for CAGG tests @@ -396,7 +396,7 @@ FROM timescaledb_information.chunks WHERE hypertable_name = 'hyper1' and hypertable_schema = 'test1' ORDER BY chunk_name LIMIT 1 \gset -SELECT _timescaledb_internal.freeze_chunk( :'CHNAME1'); +SELECT _timescaledb_functions.freeze_chunk( :'CHNAME1'); freeze_chunk -------------- t @@ -404,11 +404,11 @@ SELECT _timescaledb_internal.freeze_chunk( :'CHNAME1'); --cannot drop frozen chunk \set ON_ERROR_STOP 0 -SELECT _timescaledb_internal.drop_chunk( :'CHNAME1'); +SELECT _timescaledb_functions.drop_chunk( :'CHNAME1'); ERROR: drop_chunk not permitted on frozen chunk "_hyper_1_8_chunk" \set ON_ERROR_STOP 1 -- unfreeze the chunk, then drop the single chunk -SELECT _timescaledb_internal.unfreeze_chunk( :'CHNAME1'); +SELECT _timescaledb_functions.unfreeze_chunk( :'CHNAME1'); unfreeze_chunk ---------------- t @@ -422,7 +422,7 @@ SELECT * FROM test1.hyper1 ORDER BY 1; 31 | 31 (2 rows) -SELECT _timescaledb_internal.drop_chunk( :'CHNAME1'); +SELECT _timescaledb_functions.drop_chunk( :'CHNAME1'); drop_chunk ------------ t @@ -469,9 +469,9 @@ SELECT ts_undo_osm_hook(); --TEST error case (un)freeze a non-chunk CREATE TABLE nochunk_tab( a timestamp, b integer); \set ON_ERROR_STOP 0 -SELECT _timescaledb_internal.freeze_chunk('nochunk_tab'); +SELECT _timescaledb_functions.freeze_chunk('nochunk_tab'); ERROR: chunk not found -SELECT _timescaledb_internal.unfreeze_chunk('nochunk_tab'); +SELECT _timescaledb_functions.unfreeze_chunk('nochunk_tab'); ERROR: chunk not found \set ON_ERROR_STOP 1 ----- TESTS for attach_osm_table_chunk ------------ @@ -514,7 +514,7 @@ SELECT * FROM child_fdw_table; Wed Jan 01 01:00:00 2020 PST | 100 | 1000 (1 row) -SELECT _timescaledb_internal.attach_osm_table_chunk('ht_try', 'child_fdw_table'); +SELECT _timescaledb_functions.attach_osm_table_chunk('ht_try', 'child_fdw_table'); attach_osm_table_chunk ------------------------ t @@ -668,11 +668,11 @@ SELECT ts_undo_osm_hook(); -- TEST error have to be hypertable owner to attach a chunk to it \c :TEST_DBNAME :ROLE_DEFAULT_PERM_USER \set ON_ERROR_STOP 0 -SELECT _timescaledb_internal.attach_osm_table_chunk('ht_try', 'child_fdw_table'); +SELECT _timescaledb_functions.attach_osm_table_chunk('ht_try', 'child_fdw_table'); ERROR: must be owner of hypertable "ht_try" -- TEST error try to attach to non hypertable CREATE TABLE non_ht (time bigint, temp float); -SELECT _timescaledb_internal.attach_osm_table_chunk('non_ht', 'child_fdw_table'); +SELECT _timescaledb_functions.attach_osm_table_chunk('non_ht', 'child_fdw_table'); ERROR: "non_ht" is not a hypertable \set ON_ERROR_STOP 1 -- TEST drop the hypertable and make sure foreign chunks are dropped as well -- @@ -725,9 +725,9 @@ WHERE hypertable_name = 'disthyper' ORDER BY chunk_name LIMIT 1 \gset \set ON_ERROR_STOP 0 -SELECT _timescaledb_internal.freeze_chunk( :'CHNAME3'); +SELECT _timescaledb_functions.freeze_chunk( :'CHNAME3'); ERROR: operation not supported on distributed chunk or foreign table "_dist_hyper_6_12_chunk" -SELECT _timescaledb_internal.unfreeze_chunk( :'CHNAME3'); +SELECT _timescaledb_functions.unfreeze_chunk( :'CHNAME3'); ERROR: operation not supported on distributed chunk or foreign table "_dist_hyper_6_12_chunk" \set ON_ERROR_STOP 1 -- TEST can create OSM chunk if there are constraints on the hypertable @@ -755,7 +755,7 @@ CREATE FOREIGN TABLE child_hyper_constr ( id integer NOT NULL, time bigint NOT NULL, temp float, mid integer) SERVER s3_server OPTIONS ( schema_name 'public', table_name 'fdw_hyper_constr'); --check constraints are automatically added for the foreign table -SELECT _timescaledb_internal.attach_osm_table_chunk('hyper_constr', 'child_hyper_constr'); +SELECT _timescaledb_functions.attach_osm_table_chunk('hyper_constr', 'child_hyper_constr'); attach_osm_table_chunk ------------------------ t @@ -826,7 +826,7 @@ FROM timescaledb_information.chunks WHERE hypertable_name = 'copy_test' and hypertable_schema = 'test1' ORDER BY chunk_name LIMIT 1 \gset -SELECT _timescaledb_internal.freeze_chunk( :'COPY_CHNAME'); +SELECT _timescaledb_functions.freeze_chunk( :'COPY_CHNAME'); freeze_chunk -------------- t @@ -873,7 +873,7 @@ SELECT COUNT(*) FROM test1.copy_test; (1 row) -- Check unfreeze restored chunk -SELECT _timescaledb_internal.unfreeze_chunk( :'COPY_CHNAME'); +SELECT _timescaledb_functions.unfreeze_chunk( :'COPY_CHNAME'); unfreeze_chunk ---------------- t diff --git a/tsl/test/expected/compression.out b/tsl/test/expected/compression.out index a6d6b660954..e9e625d2f72 100644 --- a/tsl/test/expected/compression.out +++ b/tsl/test/expected/compression.out @@ -1745,7 +1745,7 @@ SELECT set_chunk_time_interval('f_sensor_data', INTERVAL '1 year'); (1 row) -- Create one chunk manually to ensure, all data is inserted into one chunk -SELECT * FROM _timescaledb_internal.create_chunk('f_sensor_data',' {"time": [181900977000000, 515024000000000]}'); +SELECT * FROM _timescaledb_functions.create_chunk('f_sensor_data',' {"time": [181900977000000, 515024000000000]}'); chunk_id | hypertable_id | schema_name | table_name | relkind | slices | created ----------+---------------+-----------------------+--------------------+---------+----------------------------------------------+--------- 71 | 37 | _timescaledb_internal | _hyper_37_71_chunk | r | {"time": [181900977000000, 515024000000000]} | t diff --git a/tsl/test/expected/continuous_aggs_deprecated-13.out b/tsl/test/expected/continuous_aggs_deprecated-13.out index c5ecd30005a..7c7b85bf9c3 100644 --- a/tsl/test/expected/continuous_aggs_deprecated-13.out +++ b/tsl/test/expected/continuous_aggs_deprecated-13.out @@ -1934,9 +1934,9 @@ View definition: _timescaledb_internal.partialize_agg(sum(transactions.fiat_value)) AS agg_3_4, transactions.amount AS var_3_5, _timescaledb_internal.partialize_agg(sum(transactions.fiat_value)) AS agg_4_6, - _timescaledb_internal.chunk_id_from_relid(transactions.tableoid) AS chunk_id + _timescaledb_functions.chunk_id_from_relid(transactions.tableoid) AS chunk_id FROM transactions - GROUP BY (time_bucket('@ 1 day'::interval, transactions."time")), transactions.amount, (_timescaledb_internal.chunk_id_from_relid(transactions.tableoid)); + GROUP BY (time_bucket('@ 1 day'::interval, transactions."time")), transactions.amount, (_timescaledb_functions.chunk_id_from_relid(transactions.tableoid)); \d+ "_timescaledb_internal".:"MAT_TABLE_NAME" Table "_timescaledb_internal._materialized_hypertable_53" diff --git a/tsl/test/expected/continuous_aggs_deprecated-14.out b/tsl/test/expected/continuous_aggs_deprecated-14.out index 51317b71a78..337d97f3fa6 100644 --- a/tsl/test/expected/continuous_aggs_deprecated-14.out +++ b/tsl/test/expected/continuous_aggs_deprecated-14.out @@ -1932,9 +1932,9 @@ View definition: _timescaledb_internal.partialize_agg(sum(transactions.fiat_value)) AS agg_3_4, transactions.amount AS var_3_5, _timescaledb_internal.partialize_agg(sum(transactions.fiat_value)) AS agg_4_6, - _timescaledb_internal.chunk_id_from_relid(transactions.tableoid) AS chunk_id + _timescaledb_functions.chunk_id_from_relid(transactions.tableoid) AS chunk_id FROM transactions - GROUP BY (time_bucket('@ 1 day'::interval, transactions."time")), transactions.amount, (_timescaledb_internal.chunk_id_from_relid(transactions.tableoid)); + GROUP BY (time_bucket('@ 1 day'::interval, transactions."time")), transactions.amount, (_timescaledb_functions.chunk_id_from_relid(transactions.tableoid)); \d+ "_timescaledb_internal".:"MAT_TABLE_NAME" Table "_timescaledb_internal._materialized_hypertable_53" diff --git a/tsl/test/expected/continuous_aggs_deprecated-15.out b/tsl/test/expected/continuous_aggs_deprecated-15.out index 51317b71a78..337d97f3fa6 100644 --- a/tsl/test/expected/continuous_aggs_deprecated-15.out +++ b/tsl/test/expected/continuous_aggs_deprecated-15.out @@ -1932,9 +1932,9 @@ View definition: _timescaledb_internal.partialize_agg(sum(transactions.fiat_value)) AS agg_3_4, transactions.amount AS var_3_5, _timescaledb_internal.partialize_agg(sum(transactions.fiat_value)) AS agg_4_6, - _timescaledb_internal.chunk_id_from_relid(transactions.tableoid) AS chunk_id + _timescaledb_functions.chunk_id_from_relid(transactions.tableoid) AS chunk_id FROM transactions - GROUP BY (time_bucket('@ 1 day'::interval, transactions."time")), transactions.amount, (_timescaledb_internal.chunk_id_from_relid(transactions.tableoid)); + GROUP BY (time_bucket('@ 1 day'::interval, transactions."time")), transactions.amount, (_timescaledb_functions.chunk_id_from_relid(transactions.tableoid)); \d+ "_timescaledb_internal".:"MAT_TABLE_NAME" Table "_timescaledb_internal._materialized_hypertable_53" diff --git a/tsl/test/expected/data_node.out b/tsl/test/expected/data_node.out index 3ee75c07031..3b981435608 100644 --- a/tsl/test/expected/data_node.out +++ b/tsl/test/expected/data_node.out @@ -503,14 +503,14 @@ WHERE c.id = cdn.chunk_id; (4 rows) -- Setting the same data node should do nothing and return false -SELECT * FROM _timescaledb_internal.set_chunk_default_data_node('_timescaledb_internal._dist_hyper_3_3_chunk', 'data_node_3'); +SELECT * FROM _timescaledb_functions.set_chunk_default_data_node('_timescaledb_internal._dist_hyper_3_3_chunk', 'data_node_3'); set_chunk_default_data_node ----------------------------- t (1 row) -- Should update the default data node and return true -SELECT * FROM _timescaledb_internal.set_chunk_default_data_node('_timescaledb_internal._dist_hyper_3_3_chunk', 'data_node_2'); +SELECT * FROM _timescaledb_functions.set_chunk_default_data_node('_timescaledb_internal._dist_hyper_3_3_chunk', 'data_node_2'); set_chunk_default_data_node ----------------------------- t @@ -526,7 +526,7 @@ ORDER BY foreign_table_name; (2 rows) -- Reset the default data node -SELECT * FROM _timescaledb_internal.set_chunk_default_data_node('_timescaledb_internal._dist_hyper_3_3_chunk', 'data_node_3'); +SELECT * FROM _timescaledb_functions.set_chunk_default_data_node('_timescaledb_internal._dist_hyper_3_3_chunk', 'data_node_3'); set_chunk_default_data_node ----------------------------- t @@ -538,16 +538,16 @@ SET ROLE :ROLE_CLUSTER_SUPERUSER; SELECT * FROM delete_data_node('data_node_2'); ERROR: data node "data_node_2" still holds data for distributed hypertable "disttable" -- non-existing chunk -SELECT * FROM _timescaledb_internal.set_chunk_default_data_node('x_chunk', 'data_node_3'); -ERROR: relation "x_chunk" does not exist at character 65 +SELECT * FROM _timescaledb_functions.set_chunk_default_data_node('x_chunk', 'data_node_3'); +ERROR: relation "x_chunk" does not exist at character 66 -- non-existing data node -SELECT * FROM _timescaledb_internal.set_chunk_default_data_node('_timescaledb_internal._dist_hyper_3_3_chunk', 'data_node_0000'); +SELECT * FROM _timescaledb_functions.set_chunk_default_data_node('_timescaledb_internal._dist_hyper_3_3_chunk', 'data_node_0000'); ERROR: server "data_node_0000" does not exist -- data node exists but does not store the chunk -SELECT * FROM _timescaledb_internal.set_chunk_default_data_node('_timescaledb_internal._dist_hyper_3_3_chunk', 'data_node_1'); +SELECT * FROM _timescaledb_functions.set_chunk_default_data_node('_timescaledb_internal._dist_hyper_3_3_chunk', 'data_node_1'); ERROR: chunk "_dist_hyper_3_3_chunk" does not exist on data node "data_node_1" -- NULL try -SELECT * FROM _timescaledb_internal.set_chunk_default_data_node(NULL, 'data_node_3'); +SELECT * FROM _timescaledb_functions.set_chunk_default_data_node(NULL, 'data_node_3'); ERROR: invalid chunk: cannot be NULL \set ON_ERROR_STOP 1 -- Deleting a data node removes the "foreign" chunk table(s) that diff --git a/tsl/test/expected/dist_compression.out b/tsl/test/expected/dist_compression.out index 81db1105b4e..efeba8789f5 100644 --- a/tsl/test/expected/dist_compression.out +++ b/tsl/test/expected/dist_compression.out @@ -81,7 +81,7 @@ table_name | compressed associated_schema_name | _timescaledb_internal associated_table_prefix | _dist_hyper_1 num_dimensions | 2 -chunk_sizing_func_schema | _timescaledb_internal +chunk_sizing_func_schema | _timescaledb_functions chunk_sizing_func_name | calculate_chunk_interval chunk_target_size | 0 compression_state | 1 diff --git a/tsl/test/expected/dist_hypertable-13.out b/tsl/test/expected/dist_hypertable-13.out index 9de23c83f67..873bc08b760 100644 --- a/tsl/test/expected/dist_hypertable-13.out +++ b/tsl/test/expected/dist_hypertable-13.out @@ -478,7 +478,7 @@ PREPARE dist_insert (timestamptz, int, float) AS INSERT INTO disttable VALUES ($1, $2, $3); EXECUTE dist_insert ('2017-01-01 06:05', 1, 1.4); -- Show chunks created -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable'); chunk_id | hypertable_id | schema_name | table_name | relkind | slices ----------+---------------+-----------------------+-----------------------+---------+--------------------------------------------------------------------------------------------- @@ -513,11 +513,11 @@ SELECT * FROM hypertable_partitions; -- Show that chunks are created on data nodes and that each data node -- has their own unique slice in the space (device) dimension. SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable'); $$); NOTICE: [db_dist_hypertable_1]: -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable') NOTICE: [db_dist_hypertable_1]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -528,7 +528,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|slice NOTICE: [db_dist_hypertable_2]: -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable') NOTICE: [db_dist_hypertable_2]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -539,7 +539,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|slice NOTICE: [db_dist_hypertable_3]: -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable') NOTICE: [db_dist_hypertable_3]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -625,8 +625,8 @@ SELECT * FROM hypertable_detailed_size('disttable') ORDER BY node_name; -- Show what some queries would look like on the frontend EXPLAIN (VERBOSE, COSTS FALSE) SELECT * FROM disttable; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: disttable."time", disttable.device, disttable.temp -> Append @@ -634,17 +634,17 @@ SELECT * FROM disttable; Output: disttable_1."time", disttable_1.device, disttable_1.temp Data node: db_dist_hypertable_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT "time", device, temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) + Remote SQL: SELECT "time", device, temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) -> Custom Scan (DataNodeScan) on public.disttable disttable_2 Output: disttable_2."time", disttable_2.device, disttable_2.temp Data node: db_dist_hypertable_2 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_5_chunk - Remote SQL: SELECT "time", device, temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) + Remote SQL: SELECT "time", device, temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) -> Custom Scan (DataNodeScan) on public.disttable disttable_3 Output: disttable_3."time", disttable_3.device, disttable_3.temp Data node: db_dist_hypertable_3 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_6_chunk - Remote SQL: SELECT "time", device, temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) + Remote SQL: SELECT "time", device, temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) (18 rows) SELECT * FROM disttable; @@ -675,8 +675,8 @@ EXPLAIN (VERBOSE, COSTS FALSE) SELECT time_bucket('3 hours', time) AS time, device, avg(temp) AS avg_temp FROM disttable GROUP BY 1, 2 ORDER BY 1; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate Output: (time_bucket('@ 3 hours'::interval, disttable."time")), disttable.device, avg(disttable.temp) Group Key: (time_bucket('@ 3 hours'::interval, disttable."time")), disttable.device @@ -688,17 +688,17 @@ ORDER BY 1; Output: time_bucket('@ 3 hours'::interval, disttable_1."time"), disttable_1.device, disttable_1.temp Data node: db_dist_hypertable_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT "time", device, temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) ORDER BY public.time_bucket('03:00:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) ORDER BY public.time_bucket('03:00:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.disttable disttable_2 Output: time_bucket('@ 3 hours'::interval, disttable_2."time"), disttable_2.device, disttable_2.temp Data node: db_dist_hypertable_2 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_5_chunk - Remote SQL: SELECT "time", device, temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) ORDER BY public.time_bucket('03:00:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) ORDER BY public.time_bucket('03:00:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.disttable disttable_3 Output: time_bucket('@ 3 hours'::interval, disttable_3."time"), disttable_3.device, disttable_3.temp Data node: db_dist_hypertable_3 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_6_chunk - Remote SQL: SELECT "time", device, temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) ORDER BY public.time_bucket('03:00:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) ORDER BY public.time_bucket('03:00:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (22 rows) -- Execute some queries on the frontend and return the results @@ -773,8 +773,8 @@ ORDER BY 1; EXPLAIN (VERBOSE, COSTS FALSE) SELECT max(temp) FROM disttable; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Result Output: $0 InitPlan 1 (returns $0) @@ -788,17 +788,17 @@ FROM disttable; Output: disttable_1.temp Data node: db_dist_hypertable_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 -> Custom Scan (DataNodeScan) on public.disttable disttable_2 Output: disttable_2.temp Data node: db_dist_hypertable_2 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_5_chunk - Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 -> Custom Scan (DataNodeScan) on public.disttable disttable_3 Output: disttable_3.temp Data node: db_dist_hypertable_3 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_6_chunk - Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 (24 rows) SELECT max(temp) @@ -813,8 +813,8 @@ SET timescaledb.enable_async_append = OFF; EXPLAIN (VERBOSE, COSTS FALSE) SELECT max(temp) FROM disttable; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Result Output: $0 InitPlan 1 (returns $0) @@ -826,25 +826,25 @@ FROM disttable; Output: disttable_1.temp Data node: db_dist_hypertable_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 -> Custom Scan (DataNodeScan) on public.disttable disttable_2 Output: disttable_2.temp Data node: db_dist_hypertable_2 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_5_chunk - Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 -> Custom Scan (DataNodeScan) on public.disttable disttable_3 Output: disttable_3.temp Data node: db_dist_hypertable_3 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_6_chunk - Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 (22 rows) SET timescaledb.enable_async_append = ON; EXPLAIN (VERBOSE, COSTS FALSE) SELECT min(temp), max(temp) FROM disttable; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------- Aggregate Output: min(disttable.temp), max(disttable.temp) -> Custom Scan (AsyncAppend) @@ -854,17 +854,17 @@ FROM disttable; Output: disttable_1.temp Data node: db_dist_hypertable_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) + Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) -> Custom Scan (DataNodeScan) on public.disttable disttable_2 Output: disttable_2.temp Data node: db_dist_hypertable_2 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_5_chunk - Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) + Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) -> Custom Scan (DataNodeScan) on public.disttable disttable_3 Output: disttable_3.temp Data node: db_dist_hypertable_3 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_6_chunk - Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) + Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) (20 rows) SELECT min(temp), max(temp) @@ -879,8 +879,8 @@ EXPLAIN (VERBOSE, COSTS FALSE) SELECT device, temp, avg(temp) OVER (PARTITION BY device) FROM disttable ORDER BY device, temp; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Sort Output: disttable.device, disttable.temp, (avg(disttable.temp) OVER (?)) Sort Key: disttable.device, disttable.temp @@ -894,17 +894,17 @@ ORDER BY device, temp; Output: disttable_1.device, disttable_1.temp Data node: db_dist_hypertable_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT device, temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.disttable disttable_2 Output: disttable_2.device, disttable_2.temp Data node: db_dist_hypertable_2 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_5_chunk - Remote SQL: SELECT device, temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.disttable disttable_3 Output: disttable_3.device, disttable_3.temp Data node: db_dist_hypertable_3 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_6_chunk - Remote SQL: SELECT device, temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) ORDER BY device ASC NULLS LAST (24 rows) SELECT device, temp, avg(temp) OVER (PARTITION BY device) @@ -936,7 +936,7 @@ ORDER BY device, temp; -- Test remote explain -- Make sure that chunks_in function only expects one-dimensional integer arrays \set ON_ERROR_STOP 0 -SELECT "time" FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[[2], [1]]) +SELECT "time" FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[[2], [1]]) ORDER BY "time" DESC NULLS FIRST LIMIT 1; ERROR: invalid number of array dimensions for chunks_in \set ON_ERROR_STOP 1 @@ -946,8 +946,8 @@ SET timescaledb.enable_remote_explain = ON; EXPLAIN (VERBOSE, COSTS FALSE) SELECT max(time) FROM disttable; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Result Output: $0 InitPlan 1 (returns $0) @@ -961,7 +961,7 @@ FROM disttable; Output: disttable_1."time" Data node: db_dist_hypertable_1 Chunks: _dist_hyper_1_4_chunk, _dist_hyper_1_1_chunk - Remote SQL: SELECT "time" FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[2, 1]) AND (("time" IS NOT NULL)) ORDER BY "time" DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT "time" FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[2, 1]) AND (("time" IS NOT NULL)) ORDER BY "time" DESC NULLS FIRST LIMIT 1 Remote EXPLAIN: Limit Output: disttable."time" @@ -981,7 +981,7 @@ FROM disttable; Output: disttable_2."time" Data node: db_dist_hypertable_2 Chunks: _dist_hyper_1_5_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT "time" FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[2, 1]) AND (("time" IS NOT NULL)) ORDER BY "time" DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT "time" FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[2, 1]) AND (("time" IS NOT NULL)) ORDER BY "time" DESC NULLS FIRST LIMIT 1 Remote EXPLAIN: Limit Output: disttable."time" @@ -1001,7 +1001,7 @@ FROM disttable; Output: disttable_3."time" Data node: db_dist_hypertable_3 Chunks: _dist_hyper_1_6_chunk, _dist_hyper_1_2_chunk - Remote SQL: SELECT "time" FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[2, 1]) AND (("time" IS NOT NULL)) ORDER BY "time" DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT "time" FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[2, 1]) AND (("time" IS NOT NULL)) ORDER BY "time" DESC NULLS FIRST LIMIT 1 Remote EXPLAIN: Limit Output: disttable."time" @@ -1022,8 +1022,8 @@ FROM disttable; EXPLAIN (VERBOSE, COSTS FALSE) SELECT max(temp) FROM disttable; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Result Output: $0 InitPlan 1 (returns $0) @@ -1037,7 +1037,7 @@ FROM disttable; Output: disttable_1.temp Data node: db_dist_hypertable_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 Remote EXPLAIN: Limit Output: _dist_hyper_1_1_chunk.temp @@ -1056,7 +1056,7 @@ FROM disttable; Output: disttable_2.temp Data node: db_dist_hypertable_2 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_5_chunk - Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 Remote EXPLAIN: Limit Output: _dist_hyper_1_3_chunk.temp @@ -1075,7 +1075,7 @@ FROM disttable; Output: disttable_3.temp Data node: db_dist_hypertable_3 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_6_chunk - Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 Remote EXPLAIN: Limit Output: _dist_hyper_1_2_chunk.temp @@ -1113,8 +1113,8 @@ FROM disttable; EXPLAIN (ANALYZE, VERBOSE, COSTS FALSE, BUFFERS OFF, TIMING OFF, SUMMARY OFF) SELECT max(temp) FROM disttable; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Result (actual rows=1 loops=1) Output: $0 InitPlan 1 (returns $0) @@ -1129,7 +1129,7 @@ FROM disttable; Data node: db_dist_hypertable_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 Remote EXPLAIN: Limit (actual rows=1 loops=1) Output: _dist_hyper_1_1_chunk.temp @@ -1150,7 +1150,7 @@ FROM disttable; Data node: db_dist_hypertable_2 Fetcher Type: COPY Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_5_chunk - Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 Remote EXPLAIN: Limit (actual rows=1 loops=1) Output: _dist_hyper_1_3_chunk.temp @@ -1171,7 +1171,7 @@ FROM disttable; Data node: db_dist_hypertable_3 Fetcher Type: COPY Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_6_chunk - Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 Remote EXPLAIN: Limit (actual rows=1 loops=1) Output: _dist_hyper_1_2_chunk.temp @@ -1350,7 +1350,7 @@ FROM test.show_subtables('disttable') st; (24 rows) SELECT cc.* -FROM (SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +FROM (SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable')) c, _timescaledb_catalog.chunk_constraint cc WHERE c.chunk_id = cc.chunk_id; @@ -1421,11 +1421,11 @@ INSERT INTO disttable (time, device, "Color", temp) VALUES ('2017-09-02 06:09', 6, 2, 10.5) ON CONFLICT DO NOTHING; SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable'); $$); NOTICE: [db_dist_hypertable_1]: -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable') NOTICE: [db_dist_hypertable_1]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -1437,7 +1437,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|slice NOTICE: [db_dist_hypertable_2]: -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable') NOTICE: [db_dist_hypertable_2]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -1449,7 +1449,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|slice NOTICE: [db_dist_hypertable_3]: -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable') NOTICE: [db_dist_hypertable_3]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -1856,7 +1856,7 @@ SELECT * FROM _timescaledb_catalog.chunk_data_node ORDER BY 1,2,3; 10 | 4 | db_dist_hypertable_3 (3 rows) -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('underreplicated'); chunk_id | hypertable_id | schema_name | table_name | relkind | slices ----------+---------------+-----------------------+------------------------+---------+------------------------------------------------ @@ -1875,11 +1875,11 @@ SELECT * FROM _timescaledb_catalog.chunk_data_node ORDER BY 1,2,3; -- Show that chunks are created on remote data nodes and that all -- data nodes/chunks have the same data due to replication SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('underreplicated'); $$); NOTICE: [db_dist_hypertable_1]: -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('underreplicated') NOTICE: [db_dist_hypertable_1]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -1889,7 +1889,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|slic NOTICE: [db_dist_hypertable_2]: -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('underreplicated') NOTICE: [db_dist_hypertable_2]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -1899,7 +1899,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|slic NOTICE: [db_dist_hypertable_3]: -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('underreplicated') NOTICE: [db_dist_hypertable_3]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -2204,9 +2204,9 @@ SELECT * FROM set_number_partitions('"Table\\Schema"."Param_Table"', 4); SELECT * FROM _timescaledb_catalog.hypertable; id | schema_name | table_name | associated_schema_name | associated_table_prefix | num_dimensions | chunk_sizing_func_schema | chunk_sizing_func_name | chunk_target_size | compression_state | compressed_hypertable_id | replication_factor ----+---------------+-----------------+------------------------+-------------------------+----------------+--------------------------+--------------------------+-------------------+-------------------+--------------------------+-------------------- - 1 | public | disttable | _timescaledb_internal | _dist_hyper_1 | 2 | _timescaledb_internal | calculate_chunk_interval | 0 | 0 | | 1 - 2 | public | underreplicated | _timescaledb_internal | _dist_hyper_2 | 1 | _timescaledb_internal | calculate_chunk_interval | 0 | 0 | | 4 - 4 | Table\\Schema | Param_Table | T3sTSch | test*pre_ | 2 | _timescaledb_internal | calculate_chunk_interval | 0 | 0 | | 2 + 1 | public | disttable | _timescaledb_internal | _dist_hyper_1 | 2 | _timescaledb_functions | calculate_chunk_interval | 0 | 0 | | 1 + 2 | public | underreplicated | _timescaledb_internal | _dist_hyper_2 | 1 | _timescaledb_functions | calculate_chunk_interval | 0 | 0 | | 4 + 4 | Table\\Schema | Param_Table | T3sTSch | test*pre_ | 2 | _timescaledb_functions | calculate_chunk_interval | 0 | 0 | | 2 (3 rows) SELECT * FROM _timescaledb_catalog.dimension; @@ -2236,9 +2236,9 @@ SELECT * FROM _timescaledb_catalog.hypertable NOTICE: [db_dist_hypertable_1]: id|schema_name |table_name |associated_schema_name|associated_table_prefix|num_dimensions|chunk_sizing_func_schema|chunk_sizing_func_name |chunk_target_size|compression_state|compressed_hypertable_id|replication_factor --+-------------+---------------+----------------------+-----------------------+--------------+------------------------+------------------------+-----------------+-----------------+------------------------+------------------ - 1|public |disttable |_timescaledb_internal |_dist_hyper_1 | 2|_timescaledb_internal |calculate_chunk_interval| 0| 0| | -1 - 2|public |underreplicated|_timescaledb_internal |_dist_hyper_2 | 1|_timescaledb_internal |calculate_chunk_interval| 0| 0| | -1 - 3|Table\\Schema|Param_Table |T3sTSch |test*pre_ | 2|_timescaledb_internal |calculate_chunk_interval| 0| 0| | -1 + 1|public |disttable |_timescaledb_internal |_dist_hyper_1 | 2|_timescaledb_functions |calculate_chunk_interval| 0| 0| | -1 + 2|public |underreplicated|_timescaledb_internal |_dist_hyper_2 | 1|_timescaledb_functions |calculate_chunk_interval| 0| 0| | -1 + 3|Table\\Schema|Param_Table |T3sTSch |test*pre_ | 2|_timescaledb_functions |calculate_chunk_interval| 0| 0| | -1 (3 rows) @@ -2270,9 +2270,9 @@ SELECT * FROM _timescaledb_catalog.hypertable NOTICE: [db_dist_hypertable_2]: id|schema_name |table_name |associated_schema_name|associated_table_prefix|num_dimensions|chunk_sizing_func_schema|chunk_sizing_func_name |chunk_target_size|compression_state|compressed_hypertable_id|replication_factor --+-------------+---------------+----------------------+-----------------------+--------------+------------------------+------------------------+-----------------+-----------------+------------------------+------------------ - 1|public |disttable |_timescaledb_internal |_dist_hyper_1 | 2|_timescaledb_internal |calculate_chunk_interval| 0| 0| | -1 - 2|public |underreplicated|_timescaledb_internal |_dist_hyper_2 | 1|_timescaledb_internal |calculate_chunk_interval| 0| 0| | -1 - 4|Table\\Schema|Param_Table |T3sTSch |test*pre_ | 2|_timescaledb_internal |calculate_chunk_interval| 0| 0| | -1 + 1|public |disttable |_timescaledb_internal |_dist_hyper_1 | 2|_timescaledb_functions |calculate_chunk_interval| 0| 0| | -1 + 2|public |underreplicated|_timescaledb_internal |_dist_hyper_2 | 1|_timescaledb_functions |calculate_chunk_interval| 0| 0| | -1 + 4|Table\\Schema|Param_Table |T3sTSch |test*pre_ | 2|_timescaledb_functions |calculate_chunk_interval| 0| 0| | -1 (3 rows) @@ -2304,9 +2304,9 @@ SELECT * FROM _timescaledb_catalog.hypertable NOTICE: [db_dist_hypertable_3]: id|schema_name |table_name |associated_schema_name|associated_table_prefix|num_dimensions|chunk_sizing_func_schema|chunk_sizing_func_name |chunk_target_size|compression_state|compressed_hypertable_id|replication_factor --+-------------+---------------+----------------------+-----------------------+--------------+------------------------+------------------------+-----------------+-----------------+------------------------+------------------ - 1|public |disttable |_timescaledb_internal |_dist_hyper_1 | 2|_timescaledb_internal |calculate_chunk_interval| 0| 0| | -1 - 2|public |underreplicated|_timescaledb_internal |_dist_hyper_2 | 1|_timescaledb_internal |calculate_chunk_interval| 0| 0| | -1 - 3|Table\\Schema|Param_Table |T3sTSch |test*pre_ | 2|_timescaledb_internal |calculate_chunk_interval| 0| 0| | -1 + 1|public |disttable |_timescaledb_internal |_dist_hyper_1 | 2|_timescaledb_functions |calculate_chunk_interval| 0| 0| | -1 + 2|public |underreplicated|_timescaledb_internal |_dist_hyper_2 | 1|_timescaledb_functions |calculate_chunk_interval| 0| 0| | -1 + 3|Table\\Schema|Param_Table |T3sTSch |test*pre_ | 2|_timescaledb_functions |calculate_chunk_interval| 0| 0| | -1 (3 rows) @@ -2563,8 +2563,8 @@ SELECT * FROM disttable_replicated; EXPLAIN (VERBOSE, ANALYZE, COSTS FALSE, TIMING FALSE, SUMMARY FALSE) SELECT * FROM disttable_replicated; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Custom Scan (AsyncAppend) (actual rows=8 loops=1) Output: disttable_replicated."time", disttable_replicated.device, disttable_replicated.temp, disttable_replicated."Color" -> Append (actual rows=8 loops=1) @@ -2573,19 +2573,19 @@ SELECT * FROM disttable_replicated; Data node: db_dist_hypertable_1 Fetcher Type: COPY Chunks: _dist_hyper_6_12_chunk, _dist_hyper_6_15_chunk - Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) + Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) -> Custom Scan (DataNodeScan) on public.disttable_replicated disttable_replicated_2 (actual rows=2 loops=1) Output: disttable_replicated_2."time", disttable_replicated_2.device, disttable_replicated_2.temp, disttable_replicated_2."Color" Data node: db_dist_hypertable_2 Fetcher Type: COPY Chunks: _dist_hyper_6_13_chunk, _dist_hyper_6_16_chunk - Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) + Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) -> Custom Scan (DataNodeScan) on public.disttable_replicated disttable_replicated_3 (actual rows=2 loops=1) Output: disttable_replicated_3."time", disttable_replicated_3.device, disttable_replicated_3.temp, disttable_replicated_3."Color" Data node: db_dist_hypertable_3 Fetcher Type: COPY Chunks: _dist_hyper_6_14_chunk, _dist_hyper_6_17_chunk - Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) + Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) (21 rows) --guc disables the optimization @@ -2631,8 +2631,8 @@ SET timescaledb.enable_per_data_node_queries = TRUE; --test WHERE clause EXPLAIN (VERBOSE, ANALYZE, COSTS FALSE, TIMING FALSE, SUMMARY FALSE) SELECT * FROM disttable_replicated WHERE temp > 2.0; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=2 loops=1) Output: disttable_replicated."time", disttable_replicated.device, disttable_replicated.temp, disttable_replicated."Color" -> Append (actual rows=2 loops=1) @@ -2641,26 +2641,26 @@ SELECT * FROM disttable_replicated WHERE temp > 2.0; Data node: db_dist_hypertable_1 Fetcher Type: COPY Chunks: _dist_hyper_6_12_chunk, _dist_hyper_6_15_chunk - Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) AND ((temp > 2::double precision)) + Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) AND ((temp > 2::double precision)) -> Custom Scan (DataNodeScan) on public.disttable_replicated disttable_replicated_2 (actual rows=0 loops=1) Output: disttable_replicated_2."time", disttable_replicated_2.device, disttable_replicated_2.temp, disttable_replicated_2."Color" Data node: db_dist_hypertable_2 Fetcher Type: COPY Chunks: _dist_hyper_6_13_chunk, _dist_hyper_6_16_chunk - Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) AND ((temp > 2::double precision)) + Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) AND ((temp > 2::double precision)) -> Custom Scan (DataNodeScan) on public.disttable_replicated disttable_replicated_3 (actual rows=2 loops=1) Output: disttable_replicated_3."time", disttable_replicated_3.device, disttable_replicated_3.temp, disttable_replicated_3."Color" Data node: db_dist_hypertable_3 Fetcher Type: COPY Chunks: _dist_hyper_6_14_chunk, _dist_hyper_6_17_chunk - Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) AND ((temp > 2::double precision)) + Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) AND ((temp > 2::double precision)) (21 rows) --test OR EXPLAIN (VERBOSE, ANALYZE, COSTS FALSE, TIMING FALSE, SUMMARY FALSE) SELECT * FROM disttable_replicated WHERE temp > 2.0 or "Color" = 11; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=3 loops=1) Output: disttable_replicated."time", disttable_replicated.device, disttable_replicated.temp, disttable_replicated."Color" -> Append (actual rows=3 loops=1) @@ -2669,26 +2669,26 @@ SELECT * FROM disttable_replicated WHERE temp > 2.0 or "Color" = 11; Data node: db_dist_hypertable_1 Fetcher Type: COPY Chunks: _dist_hyper_6_12_chunk, _dist_hyper_6_15_chunk - Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) AND (((temp > 2::double precision) OR ("Color" = 11))) + Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) AND (((temp > 2::double precision) OR ("Color" = 11))) -> Custom Scan (DataNodeScan) on public.disttable_replicated disttable_replicated_2 (actual rows=0 loops=1) Output: disttable_replicated_2."time", disttable_replicated_2.device, disttable_replicated_2.temp, disttable_replicated_2."Color" Data node: db_dist_hypertable_2 Fetcher Type: COPY Chunks: _dist_hyper_6_13_chunk, _dist_hyper_6_16_chunk - Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) AND (((temp > 2::double precision) OR ("Color" = 11))) + Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) AND (((temp > 2::double precision) OR ("Color" = 11))) -> Custom Scan (DataNodeScan) on public.disttable_replicated disttable_replicated_3 (actual rows=2 loops=1) Output: disttable_replicated_3."time", disttable_replicated_3.device, disttable_replicated_3.temp, disttable_replicated_3."Color" Data node: db_dist_hypertable_3 Fetcher Type: COPY Chunks: _dist_hyper_6_14_chunk, _dist_hyper_6_17_chunk - Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) AND (((temp > 2::double precision) OR ("Color" = 11))) + Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) AND (((temp > 2::double precision) OR ("Color" = 11))) (21 rows) --test some chunks excluded EXPLAIN (VERBOSE, ANALYZE, COSTS FALSE, TIMING FALSE, SUMMARY FALSE) SELECT * FROM disttable_replicated WHERE time < '2018-01-01 09:11'; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=2 loops=1) Output: disttable_replicated."time", disttable_replicated.device, disttable_replicated.temp, disttable_replicated."Color" -> Append (actual rows=2 loops=1) @@ -2697,13 +2697,13 @@ SELECT * FROM disttable_replicated WHERE time < '2018-01-01 09:11'; Data node: db_dist_hypertable_1 Fetcher Type: COPY Chunks: _dist_hyper_6_12_chunk - Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6]) AND (("time" < '2018-01-01 09:11:00-08'::timestamp with time zone)) + Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6]) AND (("time" < '2018-01-01 09:11:00-08'::timestamp with time zone)) -> Custom Scan (DataNodeScan) on public.disttable_replicated disttable_replicated_2 (actual rows=0 loops=1) Output: disttable_replicated_2."time", disttable_replicated_2.device, disttable_replicated_2.temp, disttable_replicated_2."Color" Data node: db_dist_hypertable_2 Fetcher Type: COPY Chunks: _dist_hyper_6_13_chunk - Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6]) AND (("time" < '2018-01-01 09:11:00-08'::timestamp with time zone)) + Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6]) AND (("time" < '2018-01-01 09:11:00-08'::timestamp with time zone)) (15 rows) --test all chunks excluded @@ -2722,8 +2722,8 @@ WITH cte AS ( SELECT * FROM disttable_replicated ) SELECT * FROM cte; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Custom Scan (AsyncAppend) (actual rows=8 loops=1) Output: disttable_replicated."time", disttable_replicated.device, disttable_replicated.temp, disttable_replicated."Color" -> Append (actual rows=8 loops=1) @@ -2732,19 +2732,19 @@ SELECT * FROM cte; Data node: db_dist_hypertable_1 Fetcher Type: COPY Chunks: _dist_hyper_6_12_chunk, _dist_hyper_6_15_chunk - Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) + Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) -> Custom Scan (DataNodeScan) on public.disttable_replicated disttable_replicated_2 (actual rows=2 loops=1) Output: disttable_replicated_2."time", disttable_replicated_2.device, disttable_replicated_2.temp, disttable_replicated_2."Color" Data node: db_dist_hypertable_2 Fetcher Type: COPY Chunks: _dist_hyper_6_13_chunk, _dist_hyper_6_16_chunk - Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) + Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) -> Custom Scan (DataNodeScan) on public.disttable_replicated disttable_replicated_3 (actual rows=2 loops=1) Output: disttable_replicated_3."time", disttable_replicated_3.device, disttable_replicated_3.temp, disttable_replicated_3."Color" Data node: db_dist_hypertable_3 Fetcher Type: COPY Chunks: _dist_hyper_6_14_chunk, _dist_hyper_6_17_chunk - Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) + Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) (21 rows) --queries that involve updates/inserts are not optimized @@ -2753,8 +2753,8 @@ WITH devices AS ( SELECT DISTINCT device FROM disttable_replicated ORDER BY device ) UPDATE disttable_replicated SET device = 2 WHERE device = (SELECT device FROM devices LIMIT 1); - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Update on public.disttable_replicated (actual rows=0 loops=1) Update on public.disttable_replicated Foreign Update on _timescaledb_internal._dist_hyper_6_12_chunk disttable_replicated_1 @@ -2783,19 +2783,19 @@ UPDATE disttable_replicated SET device = 2 WHERE device = (SELECT device FROM de Data node: db_dist_hypertable_1 Fetcher Type: Cursor Chunks: _dist_hyper_6_12_chunk, _dist_hyper_6_15_chunk - Remote SQL: SELECT DISTINCT device FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT DISTINCT device FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.disttable_replicated disttable_replicated_9 (actual rows=1 loops=1) Output: disttable_replicated_9.device Data node: db_dist_hypertable_2 Fetcher Type: Cursor Chunks: _dist_hyper_6_13_chunk, _dist_hyper_6_16_chunk - Remote SQL: SELECT DISTINCT device FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT DISTINCT device FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.disttable_replicated disttable_replicated_10 (actual rows=1 loops=1) Output: disttable_replicated_10.device Data node: db_dist_hypertable_3 Fetcher Type: Cursor Chunks: _dist_hyper_6_14_chunk, _dist_hyper_6_17_chunk - Remote SQL: SELECT DISTINCT device FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT DISTINCT device FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) ORDER BY device ASC NULLS LAST -> Seq Scan on public.disttable_replicated (actual rows=0 loops=1) Output: disttable_replicated."time", 2, disttable_replicated.temp, disttable_replicated."Color", disttable_replicated.ctid Filter: (disttable_replicated.device = $0) @@ -2983,8 +2983,8 @@ SET timescaledb.enable_remote_explain = ON; EXPLAIN (VERBOSE, COSTS OFF, TIMING OFF, SUMMARY OFF) SELECT * FROM twodim ORDER BY time; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: twodim."time", twodim."Color", twodim.temp -> Merge Append @@ -2993,7 +2993,7 @@ ORDER BY time; Output: twodim_1."time", twodim_1."Color", twodim_1.temp Data node: db_dist_hypertable_1 Chunks: _dist_hyper_7_18_chunk, _dist_hyper_7_22_chunk, _dist_hyper_7_25_chunk - Remote SQL: SELECT "time", "Color", temp FROM public.twodim WHERE _timescaledb_internal.chunks_in(public.twodim.*, ARRAY[10, 12, 14]) ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", "Color", temp FROM public.twodim WHERE _timescaledb_functions.chunks_in(public.twodim.*, ARRAY[10, 12, 14]) ORDER BY "time" ASC NULLS LAST Remote EXPLAIN: Custom Scan (ChunkAppend) on public.twodim Output: twodim."time", twodim."Color", twodim.temp @@ -3011,7 +3011,7 @@ ORDER BY time; Output: twodim_2."time", twodim_2."Color", twodim_2.temp Data node: db_dist_hypertable_2 Chunks: _dist_hyper_7_19_chunk, _dist_hyper_7_21_chunk, _dist_hyper_7_24_chunk - Remote SQL: SELECT "time", "Color", temp FROM public.twodim WHERE _timescaledb_internal.chunks_in(public.twodim.*, ARRAY[10, 11, 13]) ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", "Color", temp FROM public.twodim WHERE _timescaledb_functions.chunks_in(public.twodim.*, ARRAY[10, 11, 13]) ORDER BY "time" ASC NULLS LAST Remote EXPLAIN: Custom Scan (ChunkAppend) on public.twodim Output: twodim."time", twodim."Color", twodim.temp @@ -3029,7 +3029,7 @@ ORDER BY time; Output: twodim_3."time", twodim_3."Color", twodim_3.temp Data node: db_dist_hypertable_3 Chunks: _dist_hyper_7_20_chunk, _dist_hyper_7_23_chunk - Remote SQL: SELECT "time", "Color", temp FROM public.twodim WHERE _timescaledb_internal.chunks_in(public.twodim.*, ARRAY[10, 12]) ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", "Color", temp FROM public.twodim WHERE _timescaledb_functions.chunks_in(public.twodim.*, ARRAY[10, 12]) ORDER BY "time" ASC NULLS LAST Remote EXPLAIN: Custom Scan (ChunkAppend) on public.twodim Output: twodim."time", twodim."Color", twodim.temp @@ -3295,7 +3295,7 @@ INSERT INTO disttable_drop_chunks VALUES ('2018-07-01 09:11', 90, 2.7), ('2018-07-01 08:01', 29, 1.5); -- Show chunks on access node -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable_drop_chunks'); chunk_id | hypertable_id | schema_name | table_name | relkind | slices ----------+---------------+-----------------------+-------------------------+---------+--------------------------------------------------------------------------------------------- @@ -3309,11 +3309,11 @@ FROM show_chunks('disttable_drop_chunks'); -- Show chunks on data nodes SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable_drop_chunks'); $$); NOTICE: [db_dist_hypertable_1]: -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable_drop_chunks') NOTICE: [db_dist_hypertable_1]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -3326,7 +3326,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|sli NOTICE: [db_dist_hypertable_2]: -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable_drop_chunks') NOTICE: [db_dist_hypertable_2]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -3339,7 +3339,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|sli NOTICE: [db_dist_hypertable_3]: -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable_drop_chunks') NOTICE: [db_dist_hypertable_3]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -3373,7 +3373,7 @@ SELECT * FROM disttable_drop_chunks; Sun Jul 01 08:01:00 2018 PDT | 29 | 2 (4 rows) -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable_drop_chunks'); chunk_id | hypertable_id | schema_name | table_name | relkind | slices ----------+---------------+-----------------------+-------------------------+---------+--------------------------------------------------------------------------------------------- @@ -3383,11 +3383,11 @@ FROM show_chunks('disttable_drop_chunks'); (3 rows) SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable_drop_chunks'); $$); NOTICE: [db_dist_hypertable_1]: -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable_drop_chunks') NOTICE: [db_dist_hypertable_1]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -3398,7 +3398,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|sli NOTICE: [db_dist_hypertable_2]: -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable_drop_chunks') NOTICE: [db_dist_hypertable_2]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -3409,7 +3409,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|sli NOTICE: [db_dist_hypertable_3]: -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable_drop_chunks') NOTICE: [db_dist_hypertable_3]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -3776,13 +3776,13 @@ INSERT INTO dist_device VALUES ('2017-01-01 08:01', 1, 1.2); EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM dist_device; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------ Custom Scan (DataNodeScan) on public.dist_device Output: dist_device."time", dist_device.dist_device, dist_device.temp Data node: db_dist_hypertable_1 Chunks: _dist_hyper_15_37_chunk - Remote SQL: SELECT "time", dist_device, temp FROM public.dist_device WHERE _timescaledb_internal.chunks_in(public.dist_device.*, ARRAY[22]) + Remote SQL: SELECT "time", dist_device, temp FROM public.dist_device WHERE _timescaledb_functions.chunks_in(public.dist_device.*, ARRAY[22]) (5 rows) -- Check that datanodes use ChunkAppend plans with chunks_in function in the @@ -3790,13 +3790,13 @@ SELECT * FROM dist_device; SET timescaledb.enable_remote_explain = ON; EXPLAIN (VERBOSE, COSTS OFF, TIMING OFF, SUMMARY OFF) SELECT "time", dist_device, temp FROM public.dist_device ORDER BY "time" ASC NULLS LAST; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) on public.dist_device Output: dist_device."time", dist_device.dist_device, dist_device.temp Data node: db_dist_hypertable_1 Chunks: _dist_hyper_15_37_chunk - Remote SQL: SELECT "time", dist_device, temp FROM public.dist_device WHERE _timescaledb_internal.chunks_in(public.dist_device.*, ARRAY[22]) ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", dist_device, temp FROM public.dist_device WHERE _timescaledb_functions.chunks_in(public.dist_device.*, ARRAY[22]) ORDER BY "time" ASC NULLS LAST Remote EXPLAIN: Index Scan Backward using _dist_hyper_15_37_chunk_dist_device_time_idx on _timescaledb_internal._dist_hyper_15_37_chunk Output: _dist_hyper_15_37_chunk."time", _dist_hyper_15_37_chunk.dist_device, _dist_hyper_15_37_chunk.temp @@ -3951,11 +3951,11 @@ ERROR: [db_dist_hypertable_1]: insert or update on table "_dist_hyper_17_45_chu \set ON_ERROR_STOP 1 -- Test alter replication factor with data SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper'); $$); NOTICE: [db_dist_hypertable_1]: - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper') NOTICE: [db_dist_hypertable_1]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -3967,7 +3967,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|sli NOTICE: [db_dist_hypertable_2]: - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper') NOTICE: [db_dist_hypertable_2]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -3978,7 +3978,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|sli NOTICE: [db_dist_hypertable_3]: - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper') NOTICE: [db_dist_hypertable_3]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -4020,11 +4020,11 @@ SELECT * FROM hypertable_partitions WHERE table_name = 'hyper'; INSERT INTO hyper VALUES ('2017-01-02 07:11', 1, 1.7); SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper'); $$); NOTICE: [db_dist_hypertable_1]: - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper') NOTICE: [db_dist_hypertable_1]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -4036,7 +4036,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|sli NOTICE: [db_dist_hypertable_2]: - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper') NOTICE: [db_dist_hypertable_2]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -4047,7 +4047,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|sli NOTICE: [db_dist_hypertable_3]: - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper') NOTICE: [db_dist_hypertable_3]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -4064,11 +4064,11 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|sli INSERT INTO hyper VALUES ('2017-02-01 06:01', 1, 5.1); SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper'); $$); NOTICE: [db_dist_hypertable_1]: - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper') NOTICE: [db_dist_hypertable_1]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -4081,7 +4081,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|sli NOTICE: [db_dist_hypertable_2]: - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper') NOTICE: [db_dist_hypertable_2]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -4093,7 +4093,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|sli NOTICE: [db_dist_hypertable_3]: - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper') NOTICE: [db_dist_hypertable_3]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -4126,11 +4126,11 @@ SELECT * FROM hypertable_partitions WHERE table_name = 'hyper'; INSERT INTO hyper VALUES ('2017-03-01 06:01', 1, 15.1); SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper'); $$); NOTICE: [db_dist_hypertable_1]: - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper') NOTICE: [db_dist_hypertable_1]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -4144,7 +4144,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|sli NOTICE: [db_dist_hypertable_2]: - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper') NOTICE: [db_dist_hypertable_2]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -4157,7 +4157,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|sli NOTICE: [db_dist_hypertable_3]: - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper') NOTICE: [db_dist_hypertable_3]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -4182,11 +4182,11 @@ WARNING: hypertable "hyper" is under-replicated INSERT INTO hyper VALUES ('2017-04-01 06:01', 2, 45.1); SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper'); $$); NOTICE: [db_dist_hypertable_1]: - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper') NOTICE: [db_dist_hypertable_1]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -4200,7 +4200,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|sli NOTICE: [db_dist_hypertable_2]: - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper') NOTICE: [db_dist_hypertable_2]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -4214,7 +4214,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|sli NOTICE: [db_dist_hypertable_3]: - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper') NOTICE: [db_dist_hypertable_3]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -4305,7 +4305,7 @@ SELECT relname, reloptions FROM pg_class WHERE relname = 'disttable_with_relopts -- Ensure reloptions are not set for distributed hypertable chunks on the AN SELECT relname, reloptions FROM pg_class WHERE relname IN -(SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) +(SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname; relname | reloptions -------------------------+------------ @@ -4314,7 +4314,7 @@ ORDER BY relname; (2 rows) SELECT relname, reloptions FROM pg_class WHERE relname IN -(SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_2')) +(SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_2')) ORDER BY relname; relname | reloptions -------------------------+------------ @@ -4432,12 +4432,12 @@ disttable_with_relopts_3_idx|{fillfactor=20} -- Make sure chunks derive parent reloptions SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname; $$); NOTICE: [db_dist_hypertable_1]: SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname NOTICE: [db_dist_hypertable_1]: relname |reloptions @@ -4448,7 +4448,7 @@ _dist_hyper_18_55_chunk|{fillfactor=10} NOTICE: [db_dist_hypertable_2]: SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname NOTICE: [db_dist_hypertable_2]: relname |reloptions @@ -4459,7 +4459,7 @@ _dist_hyper_18_56_chunk|{fillfactor=10} NOTICE: [db_dist_hypertable_3]: SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname NOTICE: [db_dist_hypertable_3]: relname|reloptions @@ -4474,12 +4474,12 @@ relname|reloptions SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_2')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_2')) ORDER BY relname; $$); NOTICE: [db_dist_hypertable_1]: SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_2')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_2')) ORDER BY relname NOTICE: [db_dist_hypertable_1]: relname|reloptions @@ -4489,7 +4489,7 @@ relname|reloptions NOTICE: [db_dist_hypertable_2]: SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_2')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_2')) ORDER BY relname NOTICE: [db_dist_hypertable_2]: relname |reloptions @@ -4500,7 +4500,7 @@ _dist_hyper_19_57_chunk|{fillfactor=10,parallel_workers=1} NOTICE: [db_dist_hypertable_3]: SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_2')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_2')) ORDER BY relname NOTICE: [db_dist_hypertable_3]: relname |reloptions @@ -4526,7 +4526,7 @@ SELECT relname, reloptions FROM pg_class WHERE relname = 'disttable_with_relopts -- Ensure chunks are not affected on the AN SELECT relname, reloptions FROM pg_class WHERE relname IN -(SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) +(SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname; relname | reloptions -------------------------+------------ @@ -4537,12 +4537,12 @@ ORDER BY relname; -- Ensure data node chunks has proper options set SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname; $$); NOTICE: [db_dist_hypertable_1]: SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname NOTICE: [db_dist_hypertable_1]: relname |reloptions @@ -4553,7 +4553,7 @@ _dist_hyper_18_55_chunk|{fillfactor=40} NOTICE: [db_dist_hypertable_2]: SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname NOTICE: [db_dist_hypertable_2]: relname |reloptions @@ -4564,7 +4564,7 @@ _dist_hyper_18_56_chunk|{fillfactor=40} NOTICE: [db_dist_hypertable_3]: SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname NOTICE: [db_dist_hypertable_3]: relname|reloptions @@ -4587,7 +4587,7 @@ SELECT relname, reloptions FROM pg_class WHERE relname = 'disttable_with_relopts -- Ensure chunks are not affected on the AN SELECT relname, reloptions FROM pg_class WHERE relname IN -(SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) +(SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname; relname | reloptions -------------------------+------------ @@ -4598,12 +4598,12 @@ ORDER BY relname; -- Ensure data node chunks has proper options set SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname; $$); NOTICE: [db_dist_hypertable_1]: SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname NOTICE: [db_dist_hypertable_1]: relname |reloptions @@ -4614,7 +4614,7 @@ _dist_hyper_18_55_chunk| NOTICE: [db_dist_hypertable_2]: SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname NOTICE: [db_dist_hypertable_2]: relname |reloptions @@ -4625,7 +4625,7 @@ _dist_hyper_18_56_chunk| NOTICE: [db_dist_hypertable_3]: SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname NOTICE: [db_dist_hypertable_3]: relname|reloptions @@ -5672,8 +5672,8 @@ SELECT * FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz::times EXPLAIN (verbose, costs off) SELECT * FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz::timestamp; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: test_tz."time", test_tz.v -> Append @@ -5681,7 +5681,7 @@ SELECT * FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz::times Output: test_tz_1."time", test_tz_1.v Data node: db_dist_hypertable_1 Chunks: _dist_hyper_31_97_chunk - Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_internal.chunks_in(public.test_tz.*, ARRAY[45]) AND (("time" > '2018-01-02 12:00:00'::timestamp without time zone)) + Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_functions.chunks_in(public.test_tz.*, ARRAY[45]) AND (("time" > '2018-01-02 12:00:00'::timestamp without time zone)) Remote EXPLAIN: Index Scan using _dist_hyper_31_97_chunk_test_tz_time_idx on _timescaledb_internal._dist_hyper_31_97_chunk Output: _dist_hyper_31_97_chunk."time", _dist_hyper_31_97_chunk.v @@ -5691,7 +5691,7 @@ SELECT * FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz::times Output: test_tz_2."time", test_tz_2.v Data node: db_dist_hypertable_2 Chunks: _dist_hyper_31_95_chunk, _dist_hyper_31_96_chunk, _dist_hyper_31_98_chunk - Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_internal.chunks_in(public.test_tz.*, ARRAY[43, 44, 45]) AND (("time" > '2018-01-02 12:00:00'::timestamp without time zone)) + Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_functions.chunks_in(public.test_tz.*, ARRAY[43, 44, 45]) AND (("time" > '2018-01-02 12:00:00'::timestamp without time zone)) Remote EXPLAIN: Append -> Index Scan using _dist_hyper_31_95_chunk_test_tz_time_idx on _timescaledb_internal._dist_hyper_31_95_chunk @@ -5712,8 +5712,8 @@ SELECT count(*) FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz EXPLAIN (verbose, costs off) SELECT count(*) FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz::timestamp; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Aggregate Output: count(*) -> Custom Scan (AsyncAppend) @@ -5721,7 +5721,7 @@ SELECT count(*) FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz -> Custom Scan (DataNodeScan) on public.test_tz test_tz_1 Data node: db_dist_hypertable_1 Chunks: _dist_hyper_31_97_chunk - Remote SQL: SELECT NULL FROM public.test_tz WHERE _timescaledb_internal.chunks_in(public.test_tz.*, ARRAY[45]) AND (("time" > '2018-01-02 12:00:00'::timestamp without time zone)) + Remote SQL: SELECT NULL FROM public.test_tz WHERE _timescaledb_functions.chunks_in(public.test_tz.*, ARRAY[45]) AND (("time" > '2018-01-02 12:00:00'::timestamp without time zone)) Remote EXPLAIN: Result Output: NULL::text @@ -5731,7 +5731,7 @@ SELECT count(*) FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz -> Custom Scan (DataNodeScan) on public.test_tz test_tz_2 Data node: db_dist_hypertable_2 Chunks: _dist_hyper_31_95_chunk, _dist_hyper_31_96_chunk, _dist_hyper_31_98_chunk - Remote SQL: SELECT NULL FROM public.test_tz WHERE _timescaledb_internal.chunks_in(public.test_tz.*, ARRAY[43, 44, 45]) AND (("time" > '2018-01-02 12:00:00'::timestamp without time zone)) + Remote SQL: SELECT NULL FROM public.test_tz WHERE _timescaledb_functions.chunks_in(public.test_tz.*, ARRAY[43, 44, 45]) AND (("time" > '2018-01-02 12:00:00'::timestamp without time zone)) Remote EXPLAIN: Result Output: NULL::text @@ -5762,8 +5762,8 @@ SELECT * FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz::times EXPLAIN (verbose, costs off) SELECT * FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz::timestamp; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: test_tz."time", test_tz.v -> Append @@ -5771,7 +5771,7 @@ SELECT * FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz::times Output: test_tz_1."time", test_tz_1.v Data node: db_dist_hypertable_1 Chunks: _dist_hyper_31_97_chunk - Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_internal.chunks_in(public.test_tz.*, ARRAY[45]) AND (("time" > '2018-01-02 11:00:00'::timestamp without time zone)) + Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_functions.chunks_in(public.test_tz.*, ARRAY[45]) AND (("time" > '2018-01-02 11:00:00'::timestamp without time zone)) Remote EXPLAIN: Index Scan using _dist_hyper_31_97_chunk_test_tz_time_idx on _timescaledb_internal._dist_hyper_31_97_chunk Output: _dist_hyper_31_97_chunk."time", _dist_hyper_31_97_chunk.v @@ -5781,7 +5781,7 @@ SELECT * FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz::times Output: test_tz_2."time", test_tz_2.v Data node: db_dist_hypertable_2 Chunks: _dist_hyper_31_95_chunk, _dist_hyper_31_96_chunk, _dist_hyper_31_98_chunk - Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_internal.chunks_in(public.test_tz.*, ARRAY[43, 44, 45]) AND (("time" > '2018-01-02 11:00:00'::timestamp without time zone)) + Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_functions.chunks_in(public.test_tz.*, ARRAY[43, 44, 45]) AND (("time" > '2018-01-02 11:00:00'::timestamp without time zone)) Remote EXPLAIN: Append -> Index Scan using _dist_hyper_31_95_chunk_test_tz_time_idx on _timescaledb_internal._dist_hyper_31_95_chunk @@ -5804,8 +5804,8 @@ SELECT count(*) FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz EXPLAIN (verbose, costs off) SELECT count(*) FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz::timestamp; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Aggregate Output: count(*) -> Custom Scan (AsyncAppend) @@ -5813,7 +5813,7 @@ SELECT count(*) FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz -> Custom Scan (DataNodeScan) on public.test_tz test_tz_1 Data node: db_dist_hypertable_1 Chunks: _dist_hyper_31_97_chunk - Remote SQL: SELECT NULL FROM public.test_tz WHERE _timescaledb_internal.chunks_in(public.test_tz.*, ARRAY[45]) AND (("time" > '2018-01-02 11:00:00'::timestamp without time zone)) + Remote SQL: SELECT NULL FROM public.test_tz WHERE _timescaledb_functions.chunks_in(public.test_tz.*, ARRAY[45]) AND (("time" > '2018-01-02 11:00:00'::timestamp without time zone)) Remote EXPLAIN: Result Output: NULL::text @@ -5823,7 +5823,7 @@ SELECT count(*) FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz -> Custom Scan (DataNodeScan) on public.test_tz test_tz_2 Data node: db_dist_hypertable_2 Chunks: _dist_hyper_31_95_chunk, _dist_hyper_31_96_chunk, _dist_hyper_31_98_chunk - Remote SQL: SELECT NULL FROM public.test_tz WHERE _timescaledb_internal.chunks_in(public.test_tz.*, ARRAY[43, 44, 45]) AND (("time" > '2018-01-02 11:00:00'::timestamp without time zone)) + Remote SQL: SELECT NULL FROM public.test_tz WHERE _timescaledb_functions.chunks_in(public.test_tz.*, ARRAY[43, 44, 45]) AND (("time" > '2018-01-02 11:00:00'::timestamp without time zone)) Remote EXPLAIN: Result Output: NULL::text @@ -5860,8 +5860,8 @@ WHERE time > x + (x = x)::int -- stable * (x = '2018-01-02 11:00:00'::timestamp)::int -- immutable * INTERVAL '1 hour'; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: test_tz."time", test_tz.v, (('Tue Jan 02 11:00:00 2018 -01'::timestamp with time zone)::timestamp without time zone) -> Append @@ -5869,7 +5869,7 @@ WHERE time > x Output: test_tz_1."time", test_tz_1.v, ('Tue Jan 02 11:00:00 2018 -01'::timestamp with time zone)::timestamp without time zone Data node: db_dist_hypertable_1 Chunks: _dist_hyper_31_97_chunk - Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_internal.chunks_in(public.test_tz.*, ARRAY[45]) AND (("time" > '2018-01-02 12:00:00'::timestamp without time zone)) + Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_functions.chunks_in(public.test_tz.*, ARRAY[45]) AND (("time" > '2018-01-02 12:00:00'::timestamp without time zone)) Remote EXPLAIN: Index Scan using _dist_hyper_31_97_chunk_test_tz_time_idx on _timescaledb_internal._dist_hyper_31_97_chunk Output: _dist_hyper_31_97_chunk."time", _dist_hyper_31_97_chunk.v @@ -5879,7 +5879,7 @@ WHERE time > x Output: test_tz_2."time", test_tz_2.v, ('Tue Jan 02 11:00:00 2018 -01'::timestamp with time zone)::timestamp without time zone Data node: db_dist_hypertable_2 Chunks: _dist_hyper_31_95_chunk, _dist_hyper_31_96_chunk, _dist_hyper_31_98_chunk - Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_internal.chunks_in(public.test_tz.*, ARRAY[43, 44, 45]) AND (("time" > '2018-01-02 12:00:00'::timestamp without time zone)) + Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_functions.chunks_in(public.test_tz.*, ARRAY[43, 44, 45]) AND (("time" > '2018-01-02 12:00:00'::timestamp without time zone)) Remote EXPLAIN: Append -> Index Scan using _dist_hyper_31_95_chunk_test_tz_time_idx on _timescaledb_internal._dist_hyper_31_95_chunk @@ -5905,8 +5905,8 @@ EXPLAIN (COSTS OFF, VERBOSE) SELECT * FROM test_tz WHERE date_trunc('month', time) > date_in('2021-01-01') AND time::time > '00:00:00'::time + (INTERVAL '1 hour') * date_part('hour', INTERVAL '1 hour'); - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: test_tz."time", test_tz.v -> Append @@ -5914,7 +5914,7 @@ SELECT * FROM test_tz WHERE date_trunc('month', time) > date_in('2021-01-01') Output: test_tz_1."time", test_tz_1.v Data node: db_dist_hypertable_1 Chunks: _dist_hyper_31_97_chunk - Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_internal.chunks_in(public.test_tz.*, ARRAY[45]) AND (("time"::time without time zone > '01:00:00'::time without time zone)) AND ((date_trunc('month'::text, "time") > '2021-01-01'::date)) + Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_functions.chunks_in(public.test_tz.*, ARRAY[45]) AND (("time"::time without time zone > '01:00:00'::time without time zone)) AND ((date_trunc('month'::text, "time") > '2021-01-01'::date)) Remote EXPLAIN: Seq Scan on _timescaledb_internal._dist_hyper_31_97_chunk Output: _dist_hyper_31_97_chunk."time", _dist_hyper_31_97_chunk.v @@ -5924,7 +5924,7 @@ SELECT * FROM test_tz WHERE date_trunc('month', time) > date_in('2021-01-01') Output: test_tz_2."time", test_tz_2.v Data node: db_dist_hypertable_2 Chunks: _dist_hyper_31_95_chunk, _dist_hyper_31_96_chunk, _dist_hyper_31_98_chunk - Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_internal.chunks_in(public.test_tz.*, ARRAY[43, 44, 45]) AND (("time"::time without time zone > '01:00:00'::time without time zone)) AND ((date_trunc('month'::text, "time") > '2021-01-01'::date)) + Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_functions.chunks_in(public.test_tz.*, ARRAY[43, 44, 45]) AND (("time"::time without time zone > '01:00:00'::time without time zone)) AND ((date_trunc('month'::text, "time") > '2021-01-01'::date)) Remote EXPLAIN: Append -> Seq Scan on _timescaledb_internal._dist_hyper_31_95_chunk @@ -6139,7 +6139,7 @@ WHERE hypertable_name = 'pruned_chunks_1' ORDER BY chunk_name LIMIT 1 \gset \set ON_ERROR_STOP 0 -SELECT _timescaledb_internal.freeze_chunk( :'CHNAME'); +SELECT _timescaledb_functions.freeze_chunk( :'CHNAME'); ERROR: operation not supported on distributed chunk or foreign table "_dist_hyper_36_107_chunk" \set ON_ERROR_STOP 1 --TEST freeze_chunk api for regular hypertables. Works only for >= PG14 @@ -6152,7 +6152,7 @@ SELECT table_name FROM create_hypertable('freeze_1', 'time'); INSERT INTO freeze_1 VALUES ('2020-12-09',1,32.2); \set ON_ERROR_STOP 0 -SELECT _timescaledb_internal.freeze_chunk( ch) FROM ( select show_chunks('freeze_1') ch ) q; +SELECT _timescaledb_functions.freeze_chunk( ch) FROM ( select show_chunks('freeze_1') ch ) q; ERROR: freeze chunk supported only for PG14 or greater \set ON_ERROR_STOP 1 DROP TABLE pruned_chunks_1; diff --git a/tsl/test/expected/dist_hypertable-14.out b/tsl/test/expected/dist_hypertable-14.out index 2b54d271587..b6a1bc01665 100644 --- a/tsl/test/expected/dist_hypertable-14.out +++ b/tsl/test/expected/dist_hypertable-14.out @@ -482,7 +482,7 @@ PREPARE dist_insert (timestamptz, int, float) AS INSERT INTO disttable VALUES ($1, $2, $3); EXECUTE dist_insert ('2017-01-01 06:05', 1, 1.4); -- Show chunks created -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable'); chunk_id | hypertable_id | schema_name | table_name | relkind | slices ----------+---------------+-----------------------+-----------------------+---------+--------------------------------------------------------------------------------------------- @@ -517,11 +517,11 @@ SELECT * FROM hypertable_partitions; -- Show that chunks are created on data nodes and that each data node -- has their own unique slice in the space (device) dimension. SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable'); $$); NOTICE: [db_dist_hypertable_1]: -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable') NOTICE: [db_dist_hypertable_1]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -532,7 +532,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|slice NOTICE: [db_dist_hypertable_2]: -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable') NOTICE: [db_dist_hypertable_2]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -543,7 +543,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|slice NOTICE: [db_dist_hypertable_3]: -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable') NOTICE: [db_dist_hypertable_3]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -629,8 +629,8 @@ SELECT * FROM hypertable_detailed_size('disttable') ORDER BY node_name; -- Show what some queries would look like on the frontend EXPLAIN (VERBOSE, COSTS FALSE) SELECT * FROM disttable; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: disttable."time", disttable.device, disttable.temp -> Append @@ -638,17 +638,17 @@ SELECT * FROM disttable; Output: disttable_1."time", disttable_1.device, disttable_1.temp Data node: db_dist_hypertable_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT "time", device, temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) + Remote SQL: SELECT "time", device, temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) -> Custom Scan (DataNodeScan) on public.disttable disttable_2 Output: disttable_2."time", disttable_2.device, disttable_2.temp Data node: db_dist_hypertable_2 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_5_chunk - Remote SQL: SELECT "time", device, temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) + Remote SQL: SELECT "time", device, temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) -> Custom Scan (DataNodeScan) on public.disttable disttable_3 Output: disttable_3."time", disttable_3.device, disttable_3.temp Data node: db_dist_hypertable_3 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_6_chunk - Remote SQL: SELECT "time", device, temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) + Remote SQL: SELECT "time", device, temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) (18 rows) SELECT * FROM disttable; @@ -679,8 +679,8 @@ EXPLAIN (VERBOSE, COSTS FALSE) SELECT time_bucket('3 hours', time) AS time, device, avg(temp) AS avg_temp FROM disttable GROUP BY 1, 2 ORDER BY 1; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate Output: (time_bucket('@ 3 hours'::interval, disttable."time")), disttable.device, avg(disttable.temp) Group Key: (time_bucket('@ 3 hours'::interval, disttable."time")), disttable.device @@ -692,17 +692,17 @@ ORDER BY 1; Output: time_bucket('@ 3 hours'::interval, disttable_1."time"), disttable_1.device, disttable_1.temp Data node: db_dist_hypertable_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT "time", device, temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) ORDER BY public.time_bucket('03:00:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) ORDER BY public.time_bucket('03:00:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.disttable disttable_2 Output: time_bucket('@ 3 hours'::interval, disttable_2."time"), disttable_2.device, disttable_2.temp Data node: db_dist_hypertable_2 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_5_chunk - Remote SQL: SELECT "time", device, temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) ORDER BY public.time_bucket('03:00:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) ORDER BY public.time_bucket('03:00:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.disttable disttable_3 Output: time_bucket('@ 3 hours'::interval, disttable_3."time"), disttable_3.device, disttable_3.temp Data node: db_dist_hypertable_3 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_6_chunk - Remote SQL: SELECT "time", device, temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) ORDER BY public.time_bucket('03:00:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) ORDER BY public.time_bucket('03:00:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (22 rows) -- Execute some queries on the frontend and return the results @@ -777,8 +777,8 @@ ORDER BY 1; EXPLAIN (VERBOSE, COSTS FALSE) SELECT max(temp) FROM disttable; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Result Output: $0 InitPlan 1 (returns $0) @@ -792,17 +792,17 @@ FROM disttable; Output: disttable_1.temp Data node: db_dist_hypertable_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 -> Custom Scan (DataNodeScan) on public.disttable disttable_2 Output: disttable_2.temp Data node: db_dist_hypertable_2 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_5_chunk - Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 -> Custom Scan (DataNodeScan) on public.disttable disttable_3 Output: disttable_3.temp Data node: db_dist_hypertable_3 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_6_chunk - Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 (24 rows) SELECT max(temp) @@ -817,8 +817,8 @@ SET timescaledb.enable_async_append = OFF; EXPLAIN (VERBOSE, COSTS FALSE) SELECT max(temp) FROM disttable; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Result Output: $0 InitPlan 1 (returns $0) @@ -830,25 +830,25 @@ FROM disttable; Output: disttable_1.temp Data node: db_dist_hypertable_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 -> Custom Scan (DataNodeScan) on public.disttable disttable_2 Output: disttable_2.temp Data node: db_dist_hypertable_2 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_5_chunk - Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 -> Custom Scan (DataNodeScan) on public.disttable disttable_3 Output: disttable_3.temp Data node: db_dist_hypertable_3 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_6_chunk - Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 (22 rows) SET timescaledb.enable_async_append = ON; EXPLAIN (VERBOSE, COSTS FALSE) SELECT min(temp), max(temp) FROM disttable; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------- Aggregate Output: min(disttable.temp), max(disttable.temp) -> Custom Scan (AsyncAppend) @@ -858,17 +858,17 @@ FROM disttable; Output: disttable_1.temp Data node: db_dist_hypertable_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) + Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) -> Custom Scan (DataNodeScan) on public.disttable disttable_2 Output: disttable_2.temp Data node: db_dist_hypertable_2 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_5_chunk - Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) + Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) -> Custom Scan (DataNodeScan) on public.disttable disttable_3 Output: disttable_3.temp Data node: db_dist_hypertable_3 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_6_chunk - Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) + Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) (20 rows) SELECT min(temp), max(temp) @@ -883,8 +883,8 @@ EXPLAIN (VERBOSE, COSTS FALSE) SELECT device, temp, avg(temp) OVER (PARTITION BY device) FROM disttable ORDER BY device, temp; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Sort Output: disttable.device, disttable.temp, (avg(disttable.temp) OVER (?)) Sort Key: disttable.device, disttable.temp @@ -898,17 +898,17 @@ ORDER BY device, temp; Output: disttable_1.device, disttable_1.temp Data node: db_dist_hypertable_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT device, temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.disttable disttable_2 Output: disttable_2.device, disttable_2.temp Data node: db_dist_hypertable_2 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_5_chunk - Remote SQL: SELECT device, temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.disttable disttable_3 Output: disttable_3.device, disttable_3.temp Data node: db_dist_hypertable_3 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_6_chunk - Remote SQL: SELECT device, temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) ORDER BY device ASC NULLS LAST (24 rows) SELECT device, temp, avg(temp) OVER (PARTITION BY device) @@ -940,7 +940,7 @@ ORDER BY device, temp; -- Test remote explain -- Make sure that chunks_in function only expects one-dimensional integer arrays \set ON_ERROR_STOP 0 -SELECT "time" FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[[2], [1]]) +SELECT "time" FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[[2], [1]]) ORDER BY "time" DESC NULLS FIRST LIMIT 1; ERROR: invalid number of array dimensions for chunks_in \set ON_ERROR_STOP 1 @@ -950,8 +950,8 @@ SET timescaledb.enable_remote_explain = ON; EXPLAIN (VERBOSE, COSTS FALSE) SELECT max(time) FROM disttable; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Result Output: $0 InitPlan 1 (returns $0) @@ -965,7 +965,7 @@ FROM disttable; Output: disttable_1."time" Data node: db_dist_hypertable_1 Chunks: _dist_hyper_1_4_chunk, _dist_hyper_1_1_chunk - Remote SQL: SELECT "time" FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[2, 1]) AND (("time" IS NOT NULL)) ORDER BY "time" DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT "time" FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[2, 1]) AND (("time" IS NOT NULL)) ORDER BY "time" DESC NULLS FIRST LIMIT 1 Remote EXPLAIN: Limit Output: disttable."time" @@ -985,7 +985,7 @@ FROM disttable; Output: disttable_2."time" Data node: db_dist_hypertable_2 Chunks: _dist_hyper_1_5_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT "time" FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[2, 1]) AND (("time" IS NOT NULL)) ORDER BY "time" DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT "time" FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[2, 1]) AND (("time" IS NOT NULL)) ORDER BY "time" DESC NULLS FIRST LIMIT 1 Remote EXPLAIN: Limit Output: disttable."time" @@ -1005,7 +1005,7 @@ FROM disttable; Output: disttable_3."time" Data node: db_dist_hypertable_3 Chunks: _dist_hyper_1_6_chunk, _dist_hyper_1_2_chunk - Remote SQL: SELECT "time" FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[2, 1]) AND (("time" IS NOT NULL)) ORDER BY "time" DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT "time" FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[2, 1]) AND (("time" IS NOT NULL)) ORDER BY "time" DESC NULLS FIRST LIMIT 1 Remote EXPLAIN: Limit Output: disttable."time" @@ -1026,8 +1026,8 @@ FROM disttable; EXPLAIN (VERBOSE, COSTS FALSE) SELECT max(temp) FROM disttable; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Result Output: $0 InitPlan 1 (returns $0) @@ -1041,7 +1041,7 @@ FROM disttable; Output: disttable_1.temp Data node: db_dist_hypertable_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 Remote EXPLAIN: Limit Output: _dist_hyper_1_1_chunk.temp @@ -1060,7 +1060,7 @@ FROM disttable; Output: disttable_2.temp Data node: db_dist_hypertable_2 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_5_chunk - Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 Remote EXPLAIN: Limit Output: _dist_hyper_1_3_chunk.temp @@ -1079,7 +1079,7 @@ FROM disttable; Output: disttable_3.temp Data node: db_dist_hypertable_3 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_6_chunk - Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 Remote EXPLAIN: Limit Output: _dist_hyper_1_2_chunk.temp @@ -1117,8 +1117,8 @@ FROM disttable; EXPLAIN (ANALYZE, VERBOSE, COSTS FALSE, BUFFERS OFF, TIMING OFF, SUMMARY OFF) SELECT max(temp) FROM disttable; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Result (actual rows=1 loops=1) Output: $0 InitPlan 1 (returns $0) @@ -1133,7 +1133,7 @@ FROM disttable; Data node: db_dist_hypertable_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 Remote EXPLAIN: Limit (actual rows=1 loops=1) Output: _dist_hyper_1_1_chunk.temp @@ -1154,7 +1154,7 @@ FROM disttable; Data node: db_dist_hypertable_2 Fetcher Type: COPY Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_5_chunk - Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 Remote EXPLAIN: Limit (actual rows=1 loops=1) Output: _dist_hyper_1_3_chunk.temp @@ -1175,7 +1175,7 @@ FROM disttable; Data node: db_dist_hypertable_3 Fetcher Type: COPY Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_6_chunk - Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 Remote EXPLAIN: Limit (actual rows=1 loops=1) Output: _dist_hyper_1_2_chunk.temp @@ -1354,7 +1354,7 @@ FROM test.show_subtables('disttable') st; (24 rows) SELECT cc.* -FROM (SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +FROM (SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable')) c, _timescaledb_catalog.chunk_constraint cc WHERE c.chunk_id = cc.chunk_id; @@ -1425,11 +1425,11 @@ INSERT INTO disttable (time, device, "Color", temp) VALUES ('2017-09-02 06:09', 6, 2, 10.5) ON CONFLICT DO NOTHING; SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable'); $$); NOTICE: [db_dist_hypertable_1]: -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable') NOTICE: [db_dist_hypertable_1]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -1441,7 +1441,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|slice NOTICE: [db_dist_hypertable_2]: -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable') NOTICE: [db_dist_hypertable_2]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -1453,7 +1453,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|slice NOTICE: [db_dist_hypertable_3]: -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable') NOTICE: [db_dist_hypertable_3]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -1860,7 +1860,7 @@ SELECT * FROM _timescaledb_catalog.chunk_data_node ORDER BY 1,2,3; 10 | 4 | db_dist_hypertable_3 (3 rows) -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('underreplicated'); chunk_id | hypertable_id | schema_name | table_name | relkind | slices ----------+---------------+-----------------------+------------------------+---------+------------------------------------------------ @@ -1879,11 +1879,11 @@ SELECT * FROM _timescaledb_catalog.chunk_data_node ORDER BY 1,2,3; -- Show that chunks are created on remote data nodes and that all -- data nodes/chunks have the same data due to replication SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('underreplicated'); $$); NOTICE: [db_dist_hypertable_1]: -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('underreplicated') NOTICE: [db_dist_hypertable_1]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -1893,7 +1893,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|slic NOTICE: [db_dist_hypertable_2]: -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('underreplicated') NOTICE: [db_dist_hypertable_2]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -1903,7 +1903,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|slic NOTICE: [db_dist_hypertable_3]: -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('underreplicated') NOTICE: [db_dist_hypertable_3]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -2208,9 +2208,9 @@ SELECT * FROM set_number_partitions('"Table\\Schema"."Param_Table"', 4); SELECT * FROM _timescaledb_catalog.hypertable; id | schema_name | table_name | associated_schema_name | associated_table_prefix | num_dimensions | chunk_sizing_func_schema | chunk_sizing_func_name | chunk_target_size | compression_state | compressed_hypertable_id | replication_factor ----+---------------+-----------------+------------------------+-------------------------+----------------+--------------------------+--------------------------+-------------------+-------------------+--------------------------+-------------------- - 1 | public | disttable | _timescaledb_internal | _dist_hyper_1 | 2 | _timescaledb_internal | calculate_chunk_interval | 0 | 0 | | 1 - 2 | public | underreplicated | _timescaledb_internal | _dist_hyper_2 | 1 | _timescaledb_internal | calculate_chunk_interval | 0 | 0 | | 4 - 4 | Table\\Schema | Param_Table | T3sTSch | test*pre_ | 2 | _timescaledb_internal | calculate_chunk_interval | 0 | 0 | | 2 + 1 | public | disttable | _timescaledb_internal | _dist_hyper_1 | 2 | _timescaledb_functions | calculate_chunk_interval | 0 | 0 | | 1 + 2 | public | underreplicated | _timescaledb_internal | _dist_hyper_2 | 1 | _timescaledb_functions | calculate_chunk_interval | 0 | 0 | | 4 + 4 | Table\\Schema | Param_Table | T3sTSch | test*pre_ | 2 | _timescaledb_functions | calculate_chunk_interval | 0 | 0 | | 2 (3 rows) SELECT * FROM _timescaledb_catalog.dimension; @@ -2240,9 +2240,9 @@ SELECT * FROM _timescaledb_catalog.hypertable NOTICE: [db_dist_hypertable_1]: id|schema_name |table_name |associated_schema_name|associated_table_prefix|num_dimensions|chunk_sizing_func_schema|chunk_sizing_func_name |chunk_target_size|compression_state|compressed_hypertable_id|replication_factor --+-------------+---------------+----------------------+-----------------------+--------------+------------------------+------------------------+-----------------+-----------------+------------------------+------------------ - 1|public |disttable |_timescaledb_internal |_dist_hyper_1 | 2|_timescaledb_internal |calculate_chunk_interval| 0| 0| | -1 - 2|public |underreplicated|_timescaledb_internal |_dist_hyper_2 | 1|_timescaledb_internal |calculate_chunk_interval| 0| 0| | -1 - 3|Table\\Schema|Param_Table |T3sTSch |test*pre_ | 2|_timescaledb_internal |calculate_chunk_interval| 0| 0| | -1 + 1|public |disttable |_timescaledb_internal |_dist_hyper_1 | 2|_timescaledb_functions |calculate_chunk_interval| 0| 0| | -1 + 2|public |underreplicated|_timescaledb_internal |_dist_hyper_2 | 1|_timescaledb_functions |calculate_chunk_interval| 0| 0| | -1 + 3|Table\\Schema|Param_Table |T3sTSch |test*pre_ | 2|_timescaledb_functions |calculate_chunk_interval| 0| 0| | -1 (3 rows) @@ -2274,9 +2274,9 @@ SELECT * FROM _timescaledb_catalog.hypertable NOTICE: [db_dist_hypertable_2]: id|schema_name |table_name |associated_schema_name|associated_table_prefix|num_dimensions|chunk_sizing_func_schema|chunk_sizing_func_name |chunk_target_size|compression_state|compressed_hypertable_id|replication_factor --+-------------+---------------+----------------------+-----------------------+--------------+------------------------+------------------------+-----------------+-----------------+------------------------+------------------ - 1|public |disttable |_timescaledb_internal |_dist_hyper_1 | 2|_timescaledb_internal |calculate_chunk_interval| 0| 0| | -1 - 2|public |underreplicated|_timescaledb_internal |_dist_hyper_2 | 1|_timescaledb_internal |calculate_chunk_interval| 0| 0| | -1 - 4|Table\\Schema|Param_Table |T3sTSch |test*pre_ | 2|_timescaledb_internal |calculate_chunk_interval| 0| 0| | -1 + 1|public |disttable |_timescaledb_internal |_dist_hyper_1 | 2|_timescaledb_functions |calculate_chunk_interval| 0| 0| | -1 + 2|public |underreplicated|_timescaledb_internal |_dist_hyper_2 | 1|_timescaledb_functions |calculate_chunk_interval| 0| 0| | -1 + 4|Table\\Schema|Param_Table |T3sTSch |test*pre_ | 2|_timescaledb_functions |calculate_chunk_interval| 0| 0| | -1 (3 rows) @@ -2308,9 +2308,9 @@ SELECT * FROM _timescaledb_catalog.hypertable NOTICE: [db_dist_hypertable_3]: id|schema_name |table_name |associated_schema_name|associated_table_prefix|num_dimensions|chunk_sizing_func_schema|chunk_sizing_func_name |chunk_target_size|compression_state|compressed_hypertable_id|replication_factor --+-------------+---------------+----------------------+-----------------------+--------------+------------------------+------------------------+-----------------+-----------------+------------------------+------------------ - 1|public |disttable |_timescaledb_internal |_dist_hyper_1 | 2|_timescaledb_internal |calculate_chunk_interval| 0| 0| | -1 - 2|public |underreplicated|_timescaledb_internal |_dist_hyper_2 | 1|_timescaledb_internal |calculate_chunk_interval| 0| 0| | -1 - 3|Table\\Schema|Param_Table |T3sTSch |test*pre_ | 2|_timescaledb_internal |calculate_chunk_interval| 0| 0| | -1 + 1|public |disttable |_timescaledb_internal |_dist_hyper_1 | 2|_timescaledb_functions |calculate_chunk_interval| 0| 0| | -1 + 2|public |underreplicated|_timescaledb_internal |_dist_hyper_2 | 1|_timescaledb_functions |calculate_chunk_interval| 0| 0| | -1 + 3|Table\\Schema|Param_Table |T3sTSch |test*pre_ | 2|_timescaledb_functions |calculate_chunk_interval| 0| 0| | -1 (3 rows) @@ -2567,8 +2567,8 @@ SELECT * FROM disttable_replicated; EXPLAIN (VERBOSE, ANALYZE, COSTS FALSE, TIMING FALSE, SUMMARY FALSE) SELECT * FROM disttable_replicated; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Custom Scan (AsyncAppend) (actual rows=8 loops=1) Output: disttable_replicated."time", disttable_replicated.device, disttable_replicated.temp, disttable_replicated."Color" -> Append (actual rows=8 loops=1) @@ -2577,19 +2577,19 @@ SELECT * FROM disttable_replicated; Data node: db_dist_hypertable_1 Fetcher Type: COPY Chunks: _dist_hyper_6_12_chunk, _dist_hyper_6_15_chunk - Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) + Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) -> Custom Scan (DataNodeScan) on public.disttable_replicated disttable_replicated_2 (actual rows=2 loops=1) Output: disttable_replicated_2."time", disttable_replicated_2.device, disttable_replicated_2.temp, disttable_replicated_2."Color" Data node: db_dist_hypertable_2 Fetcher Type: COPY Chunks: _dist_hyper_6_13_chunk, _dist_hyper_6_16_chunk - Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) + Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) -> Custom Scan (DataNodeScan) on public.disttable_replicated disttable_replicated_3 (actual rows=2 loops=1) Output: disttable_replicated_3."time", disttable_replicated_3.device, disttable_replicated_3.temp, disttable_replicated_3."Color" Data node: db_dist_hypertable_3 Fetcher Type: COPY Chunks: _dist_hyper_6_14_chunk, _dist_hyper_6_17_chunk - Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) + Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) (21 rows) --guc disables the optimization @@ -2635,8 +2635,8 @@ SET timescaledb.enable_per_data_node_queries = TRUE; --test WHERE clause EXPLAIN (VERBOSE, ANALYZE, COSTS FALSE, TIMING FALSE, SUMMARY FALSE) SELECT * FROM disttable_replicated WHERE temp > 2.0; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=2 loops=1) Output: disttable_replicated."time", disttable_replicated.device, disttable_replicated.temp, disttable_replicated."Color" -> Append (actual rows=2 loops=1) @@ -2645,26 +2645,26 @@ SELECT * FROM disttable_replicated WHERE temp > 2.0; Data node: db_dist_hypertable_1 Fetcher Type: COPY Chunks: _dist_hyper_6_12_chunk, _dist_hyper_6_15_chunk - Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) AND ((temp > 2::double precision)) + Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) AND ((temp > 2::double precision)) -> Custom Scan (DataNodeScan) on public.disttable_replicated disttable_replicated_2 (actual rows=0 loops=1) Output: disttable_replicated_2."time", disttable_replicated_2.device, disttable_replicated_2.temp, disttable_replicated_2."Color" Data node: db_dist_hypertable_2 Fetcher Type: COPY Chunks: _dist_hyper_6_13_chunk, _dist_hyper_6_16_chunk - Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) AND ((temp > 2::double precision)) + Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) AND ((temp > 2::double precision)) -> Custom Scan (DataNodeScan) on public.disttable_replicated disttable_replicated_3 (actual rows=2 loops=1) Output: disttable_replicated_3."time", disttable_replicated_3.device, disttable_replicated_3.temp, disttable_replicated_3."Color" Data node: db_dist_hypertable_3 Fetcher Type: COPY Chunks: _dist_hyper_6_14_chunk, _dist_hyper_6_17_chunk - Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) AND ((temp > 2::double precision)) + Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) AND ((temp > 2::double precision)) (21 rows) --test OR EXPLAIN (VERBOSE, ANALYZE, COSTS FALSE, TIMING FALSE, SUMMARY FALSE) SELECT * FROM disttable_replicated WHERE temp > 2.0 or "Color" = 11; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=3 loops=1) Output: disttable_replicated."time", disttable_replicated.device, disttable_replicated.temp, disttable_replicated."Color" -> Append (actual rows=3 loops=1) @@ -2673,26 +2673,26 @@ SELECT * FROM disttable_replicated WHERE temp > 2.0 or "Color" = 11; Data node: db_dist_hypertable_1 Fetcher Type: COPY Chunks: _dist_hyper_6_12_chunk, _dist_hyper_6_15_chunk - Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) AND (((temp > 2::double precision) OR ("Color" = 11))) + Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) AND (((temp > 2::double precision) OR ("Color" = 11))) -> Custom Scan (DataNodeScan) on public.disttable_replicated disttable_replicated_2 (actual rows=0 loops=1) Output: disttable_replicated_2."time", disttable_replicated_2.device, disttable_replicated_2.temp, disttable_replicated_2."Color" Data node: db_dist_hypertable_2 Fetcher Type: COPY Chunks: _dist_hyper_6_13_chunk, _dist_hyper_6_16_chunk - Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) AND (((temp > 2::double precision) OR ("Color" = 11))) + Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) AND (((temp > 2::double precision) OR ("Color" = 11))) -> Custom Scan (DataNodeScan) on public.disttable_replicated disttable_replicated_3 (actual rows=2 loops=1) Output: disttable_replicated_3."time", disttable_replicated_3.device, disttable_replicated_3.temp, disttable_replicated_3."Color" Data node: db_dist_hypertable_3 Fetcher Type: COPY Chunks: _dist_hyper_6_14_chunk, _dist_hyper_6_17_chunk - Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) AND (((temp > 2::double precision) OR ("Color" = 11))) + Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) AND (((temp > 2::double precision) OR ("Color" = 11))) (21 rows) --test some chunks excluded EXPLAIN (VERBOSE, ANALYZE, COSTS FALSE, TIMING FALSE, SUMMARY FALSE) SELECT * FROM disttable_replicated WHERE time < '2018-01-01 09:11'; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=2 loops=1) Output: disttable_replicated."time", disttable_replicated.device, disttable_replicated.temp, disttable_replicated."Color" -> Append (actual rows=2 loops=1) @@ -2701,13 +2701,13 @@ SELECT * FROM disttable_replicated WHERE time < '2018-01-01 09:11'; Data node: db_dist_hypertable_1 Fetcher Type: COPY Chunks: _dist_hyper_6_12_chunk - Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6]) AND (("time" < '2018-01-01 09:11:00-08'::timestamp with time zone)) + Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6]) AND (("time" < '2018-01-01 09:11:00-08'::timestamp with time zone)) -> Custom Scan (DataNodeScan) on public.disttable_replicated disttable_replicated_2 (actual rows=0 loops=1) Output: disttable_replicated_2."time", disttable_replicated_2.device, disttable_replicated_2.temp, disttable_replicated_2."Color" Data node: db_dist_hypertable_2 Fetcher Type: COPY Chunks: _dist_hyper_6_13_chunk - Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6]) AND (("time" < '2018-01-01 09:11:00-08'::timestamp with time zone)) + Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6]) AND (("time" < '2018-01-01 09:11:00-08'::timestamp with time zone)) (15 rows) --test all chunks excluded @@ -2726,8 +2726,8 @@ WITH cte AS ( SELECT * FROM disttable_replicated ) SELECT * FROM cte; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Custom Scan (AsyncAppend) (actual rows=8 loops=1) Output: disttable_replicated."time", disttable_replicated.device, disttable_replicated.temp, disttable_replicated."Color" -> Append (actual rows=8 loops=1) @@ -2736,19 +2736,19 @@ SELECT * FROM cte; Data node: db_dist_hypertable_1 Fetcher Type: COPY Chunks: _dist_hyper_6_12_chunk, _dist_hyper_6_15_chunk - Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) + Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) -> Custom Scan (DataNodeScan) on public.disttable_replicated disttable_replicated_2 (actual rows=2 loops=1) Output: disttable_replicated_2."time", disttable_replicated_2.device, disttable_replicated_2.temp, disttable_replicated_2."Color" Data node: db_dist_hypertable_2 Fetcher Type: COPY Chunks: _dist_hyper_6_13_chunk, _dist_hyper_6_16_chunk - Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) + Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) -> Custom Scan (DataNodeScan) on public.disttable_replicated disttable_replicated_3 (actual rows=2 loops=1) Output: disttable_replicated_3."time", disttable_replicated_3.device, disttable_replicated_3.temp, disttable_replicated_3."Color" Data node: db_dist_hypertable_3 Fetcher Type: COPY Chunks: _dist_hyper_6_14_chunk, _dist_hyper_6_17_chunk - Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) + Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) (21 rows) --queries that involve updates/inserts are not optimized @@ -2757,8 +2757,8 @@ WITH devices AS ( SELECT DISTINCT device FROM disttable_replicated ORDER BY device ) UPDATE disttable_replicated SET device = 2 WHERE device = (SELECT device FROM devices LIMIT 1); - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Update on public.disttable_replicated (actual rows=0 loops=1) Update on public.disttable_replicated disttable_replicated_1 Foreign Update on _timescaledb_internal._dist_hyper_6_12_chunk disttable_replicated_2 @@ -2787,19 +2787,19 @@ UPDATE disttable_replicated SET device = 2 WHERE device = (SELECT device FROM de Data node: db_dist_hypertable_1 Fetcher Type: Cursor Chunks: _dist_hyper_6_12_chunk, _dist_hyper_6_15_chunk - Remote SQL: SELECT DISTINCT device FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT DISTINCT device FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.disttable_replicated disttable_replicated_10 (actual rows=1 loops=1) Output: disttable_replicated_10.device Data node: db_dist_hypertable_2 Fetcher Type: Cursor Chunks: _dist_hyper_6_13_chunk, _dist_hyper_6_16_chunk - Remote SQL: SELECT DISTINCT device FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT DISTINCT device FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.disttable_replicated disttable_replicated_11 (actual rows=1 loops=1) Output: disttable_replicated_11.device Data node: db_dist_hypertable_3 Fetcher Type: Cursor Chunks: _dist_hyper_6_14_chunk, _dist_hyper_6_17_chunk - Remote SQL: SELECT DISTINCT device FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT DISTINCT device FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) ORDER BY device ASC NULLS LAST -> Result (actual rows=2 loops=1) Output: 2, disttable_replicated.tableoid, disttable_replicated.ctid, (NULL::record) -> Append (actual rows=2 loops=1) @@ -2990,8 +2990,8 @@ SET timescaledb.enable_remote_explain = ON; EXPLAIN (VERBOSE, COSTS OFF, TIMING OFF, SUMMARY OFF) SELECT * FROM twodim ORDER BY time; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: twodim."time", twodim."Color", twodim.temp -> Merge Append @@ -3000,7 +3000,7 @@ ORDER BY time; Output: twodim_1."time", twodim_1."Color", twodim_1.temp Data node: db_dist_hypertable_1 Chunks: _dist_hyper_7_18_chunk, _dist_hyper_7_22_chunk, _dist_hyper_7_25_chunk - Remote SQL: SELECT "time", "Color", temp FROM public.twodim WHERE _timescaledb_internal.chunks_in(public.twodim.*, ARRAY[10, 12, 14]) ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", "Color", temp FROM public.twodim WHERE _timescaledb_functions.chunks_in(public.twodim.*, ARRAY[10, 12, 14]) ORDER BY "time" ASC NULLS LAST Remote EXPLAIN: Custom Scan (ChunkAppend) on public.twodim Output: twodim."time", twodim."Color", twodim.temp @@ -3018,7 +3018,7 @@ ORDER BY time; Output: twodim_2."time", twodim_2."Color", twodim_2.temp Data node: db_dist_hypertable_2 Chunks: _dist_hyper_7_19_chunk, _dist_hyper_7_21_chunk, _dist_hyper_7_24_chunk - Remote SQL: SELECT "time", "Color", temp FROM public.twodim WHERE _timescaledb_internal.chunks_in(public.twodim.*, ARRAY[10, 11, 13]) ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", "Color", temp FROM public.twodim WHERE _timescaledb_functions.chunks_in(public.twodim.*, ARRAY[10, 11, 13]) ORDER BY "time" ASC NULLS LAST Remote EXPLAIN: Custom Scan (ChunkAppend) on public.twodim Output: twodim."time", twodim."Color", twodim.temp @@ -3036,7 +3036,7 @@ ORDER BY time; Output: twodim_3."time", twodim_3."Color", twodim_3.temp Data node: db_dist_hypertable_3 Chunks: _dist_hyper_7_20_chunk, _dist_hyper_7_23_chunk - Remote SQL: SELECT "time", "Color", temp FROM public.twodim WHERE _timescaledb_internal.chunks_in(public.twodim.*, ARRAY[10, 12]) ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", "Color", temp FROM public.twodim WHERE _timescaledb_functions.chunks_in(public.twodim.*, ARRAY[10, 12]) ORDER BY "time" ASC NULLS LAST Remote EXPLAIN: Custom Scan (ChunkAppend) on public.twodim Output: twodim."time", twodim."Color", twodim.temp @@ -3302,7 +3302,7 @@ INSERT INTO disttable_drop_chunks VALUES ('2018-07-01 09:11', 90, 2.7), ('2018-07-01 08:01', 29, 1.5); -- Show chunks on access node -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable_drop_chunks'); chunk_id | hypertable_id | schema_name | table_name | relkind | slices ----------+---------------+-----------------------+-------------------------+---------+--------------------------------------------------------------------------------------------- @@ -3316,11 +3316,11 @@ FROM show_chunks('disttable_drop_chunks'); -- Show chunks on data nodes SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable_drop_chunks'); $$); NOTICE: [db_dist_hypertable_1]: -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable_drop_chunks') NOTICE: [db_dist_hypertable_1]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -3333,7 +3333,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|sli NOTICE: [db_dist_hypertable_2]: -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable_drop_chunks') NOTICE: [db_dist_hypertable_2]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -3346,7 +3346,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|sli NOTICE: [db_dist_hypertable_3]: -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable_drop_chunks') NOTICE: [db_dist_hypertable_3]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -3380,7 +3380,7 @@ SELECT * FROM disttable_drop_chunks; Sun Jul 01 08:01:00 2018 PDT | 29 | 2 (4 rows) -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable_drop_chunks'); chunk_id | hypertable_id | schema_name | table_name | relkind | slices ----------+---------------+-----------------------+-------------------------+---------+--------------------------------------------------------------------------------------------- @@ -3390,11 +3390,11 @@ FROM show_chunks('disttable_drop_chunks'); (3 rows) SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable_drop_chunks'); $$); NOTICE: [db_dist_hypertable_1]: -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable_drop_chunks') NOTICE: [db_dist_hypertable_1]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -3405,7 +3405,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|sli NOTICE: [db_dist_hypertable_2]: -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable_drop_chunks') NOTICE: [db_dist_hypertable_2]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -3416,7 +3416,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|sli NOTICE: [db_dist_hypertable_3]: -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable_drop_chunks') NOTICE: [db_dist_hypertable_3]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -3783,13 +3783,13 @@ INSERT INTO dist_device VALUES ('2017-01-01 08:01', 1, 1.2); EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM dist_device; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------ Custom Scan (DataNodeScan) on public.dist_device Output: dist_device."time", dist_device.dist_device, dist_device.temp Data node: db_dist_hypertable_1 Chunks: _dist_hyper_15_37_chunk - Remote SQL: SELECT "time", dist_device, temp FROM public.dist_device WHERE _timescaledb_internal.chunks_in(public.dist_device.*, ARRAY[22]) + Remote SQL: SELECT "time", dist_device, temp FROM public.dist_device WHERE _timescaledb_functions.chunks_in(public.dist_device.*, ARRAY[22]) (5 rows) -- Check that datanodes use ChunkAppend plans with chunks_in function in the @@ -3797,13 +3797,13 @@ SELECT * FROM dist_device; SET timescaledb.enable_remote_explain = ON; EXPLAIN (VERBOSE, COSTS OFF, TIMING OFF, SUMMARY OFF) SELECT "time", dist_device, temp FROM public.dist_device ORDER BY "time" ASC NULLS LAST; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) on public.dist_device Output: dist_device."time", dist_device.dist_device, dist_device.temp Data node: db_dist_hypertable_1 Chunks: _dist_hyper_15_37_chunk - Remote SQL: SELECT "time", dist_device, temp FROM public.dist_device WHERE _timescaledb_internal.chunks_in(public.dist_device.*, ARRAY[22]) ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", dist_device, temp FROM public.dist_device WHERE _timescaledb_functions.chunks_in(public.dist_device.*, ARRAY[22]) ORDER BY "time" ASC NULLS LAST Remote EXPLAIN: Index Scan Backward using _dist_hyper_15_37_chunk_dist_device_time_idx on _timescaledb_internal._dist_hyper_15_37_chunk Output: _dist_hyper_15_37_chunk."time", _dist_hyper_15_37_chunk.dist_device, _dist_hyper_15_37_chunk.temp @@ -3958,11 +3958,11 @@ ERROR: [db_dist_hypertable_1]: insert or update on table "_dist_hyper_17_45_chu \set ON_ERROR_STOP 1 -- Test alter replication factor with data SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper'); $$); NOTICE: [db_dist_hypertable_1]: - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper') NOTICE: [db_dist_hypertable_1]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -3974,7 +3974,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|sli NOTICE: [db_dist_hypertable_2]: - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper') NOTICE: [db_dist_hypertable_2]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -3985,7 +3985,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|sli NOTICE: [db_dist_hypertable_3]: - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper') NOTICE: [db_dist_hypertable_3]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -4027,11 +4027,11 @@ SELECT * FROM hypertable_partitions WHERE table_name = 'hyper'; INSERT INTO hyper VALUES ('2017-01-02 07:11', 1, 1.7); SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper'); $$); NOTICE: [db_dist_hypertable_1]: - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper') NOTICE: [db_dist_hypertable_1]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -4043,7 +4043,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|sli NOTICE: [db_dist_hypertable_2]: - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper') NOTICE: [db_dist_hypertable_2]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -4054,7 +4054,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|sli NOTICE: [db_dist_hypertable_3]: - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper') NOTICE: [db_dist_hypertable_3]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -4071,11 +4071,11 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|sli INSERT INTO hyper VALUES ('2017-02-01 06:01', 1, 5.1); SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper'); $$); NOTICE: [db_dist_hypertable_1]: - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper') NOTICE: [db_dist_hypertable_1]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -4088,7 +4088,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|sli NOTICE: [db_dist_hypertable_2]: - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper') NOTICE: [db_dist_hypertable_2]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -4100,7 +4100,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|sli NOTICE: [db_dist_hypertable_3]: - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper') NOTICE: [db_dist_hypertable_3]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -4133,11 +4133,11 @@ SELECT * FROM hypertable_partitions WHERE table_name = 'hyper'; INSERT INTO hyper VALUES ('2017-03-01 06:01', 1, 15.1); SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper'); $$); NOTICE: [db_dist_hypertable_1]: - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper') NOTICE: [db_dist_hypertable_1]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -4151,7 +4151,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|sli NOTICE: [db_dist_hypertable_2]: - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper') NOTICE: [db_dist_hypertable_2]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -4164,7 +4164,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|sli NOTICE: [db_dist_hypertable_3]: - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper') NOTICE: [db_dist_hypertable_3]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -4189,11 +4189,11 @@ WARNING: hypertable "hyper" is under-replicated INSERT INTO hyper VALUES ('2017-04-01 06:01', 2, 45.1); SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper'); $$); NOTICE: [db_dist_hypertable_1]: - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper') NOTICE: [db_dist_hypertable_1]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -4207,7 +4207,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|sli NOTICE: [db_dist_hypertable_2]: - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper') NOTICE: [db_dist_hypertable_2]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -4221,7 +4221,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|sli NOTICE: [db_dist_hypertable_3]: - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper') NOTICE: [db_dist_hypertable_3]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -4312,7 +4312,7 @@ SELECT relname, reloptions FROM pg_class WHERE relname = 'disttable_with_relopts -- Ensure reloptions are not set for distributed hypertable chunks on the AN SELECT relname, reloptions FROM pg_class WHERE relname IN -(SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) +(SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname; relname | reloptions -------------------------+------------ @@ -4321,7 +4321,7 @@ ORDER BY relname; (2 rows) SELECT relname, reloptions FROM pg_class WHERE relname IN -(SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_2')) +(SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_2')) ORDER BY relname; relname | reloptions -------------------------+------------ @@ -4439,12 +4439,12 @@ disttable_with_relopts_3_idx|{fillfactor=20} -- Make sure chunks derive parent reloptions SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname; $$); NOTICE: [db_dist_hypertable_1]: SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname NOTICE: [db_dist_hypertable_1]: relname |reloptions @@ -4455,7 +4455,7 @@ _dist_hyper_18_55_chunk|{fillfactor=10} NOTICE: [db_dist_hypertable_2]: SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname NOTICE: [db_dist_hypertable_2]: relname |reloptions @@ -4466,7 +4466,7 @@ _dist_hyper_18_56_chunk|{fillfactor=10} NOTICE: [db_dist_hypertable_3]: SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname NOTICE: [db_dist_hypertable_3]: relname|reloptions @@ -4481,12 +4481,12 @@ relname|reloptions SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_2')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_2')) ORDER BY relname; $$); NOTICE: [db_dist_hypertable_1]: SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_2')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_2')) ORDER BY relname NOTICE: [db_dist_hypertable_1]: relname|reloptions @@ -4496,7 +4496,7 @@ relname|reloptions NOTICE: [db_dist_hypertable_2]: SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_2')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_2')) ORDER BY relname NOTICE: [db_dist_hypertable_2]: relname |reloptions @@ -4507,7 +4507,7 @@ _dist_hyper_19_57_chunk|{fillfactor=10,parallel_workers=1} NOTICE: [db_dist_hypertable_3]: SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_2')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_2')) ORDER BY relname NOTICE: [db_dist_hypertable_3]: relname |reloptions @@ -4533,7 +4533,7 @@ SELECT relname, reloptions FROM pg_class WHERE relname = 'disttable_with_relopts -- Ensure chunks are not affected on the AN SELECT relname, reloptions FROM pg_class WHERE relname IN -(SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) +(SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname; relname | reloptions -------------------------+------------ @@ -4544,12 +4544,12 @@ ORDER BY relname; -- Ensure data node chunks has proper options set SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname; $$); NOTICE: [db_dist_hypertable_1]: SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname NOTICE: [db_dist_hypertable_1]: relname |reloptions @@ -4560,7 +4560,7 @@ _dist_hyper_18_55_chunk|{fillfactor=40} NOTICE: [db_dist_hypertable_2]: SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname NOTICE: [db_dist_hypertable_2]: relname |reloptions @@ -4571,7 +4571,7 @@ _dist_hyper_18_56_chunk|{fillfactor=40} NOTICE: [db_dist_hypertable_3]: SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname NOTICE: [db_dist_hypertable_3]: relname|reloptions @@ -4594,7 +4594,7 @@ SELECT relname, reloptions FROM pg_class WHERE relname = 'disttable_with_relopts -- Ensure chunks are not affected on the AN SELECT relname, reloptions FROM pg_class WHERE relname IN -(SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) +(SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname; relname | reloptions -------------------------+------------ @@ -4605,12 +4605,12 @@ ORDER BY relname; -- Ensure data node chunks has proper options set SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname; $$); NOTICE: [db_dist_hypertable_1]: SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname NOTICE: [db_dist_hypertable_1]: relname |reloptions @@ -4621,7 +4621,7 @@ _dist_hyper_18_55_chunk| NOTICE: [db_dist_hypertable_2]: SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname NOTICE: [db_dist_hypertable_2]: relname |reloptions @@ -4632,7 +4632,7 @@ _dist_hyper_18_56_chunk| NOTICE: [db_dist_hypertable_3]: SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname NOTICE: [db_dist_hypertable_3]: relname|reloptions @@ -5717,8 +5717,8 @@ SELECT * FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz::times EXPLAIN (verbose, costs off) SELECT * FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz::timestamp; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: test_tz."time", test_tz.v -> Append @@ -5726,7 +5726,7 @@ SELECT * FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz::times Output: test_tz_1."time", test_tz_1.v Data node: db_dist_hypertable_1 Chunks: _dist_hyper_31_97_chunk - Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_internal.chunks_in(public.test_tz.*, ARRAY[45]) AND (("time" > '2018-01-02 12:00:00'::timestamp without time zone)) + Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_functions.chunks_in(public.test_tz.*, ARRAY[45]) AND (("time" > '2018-01-02 12:00:00'::timestamp without time zone)) Remote EXPLAIN: Index Scan using _dist_hyper_31_97_chunk_test_tz_time_idx on _timescaledb_internal._dist_hyper_31_97_chunk Output: _dist_hyper_31_97_chunk."time", _dist_hyper_31_97_chunk.v @@ -5736,7 +5736,7 @@ SELECT * FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz::times Output: test_tz_2."time", test_tz_2.v Data node: db_dist_hypertable_2 Chunks: _dist_hyper_31_95_chunk, _dist_hyper_31_96_chunk, _dist_hyper_31_98_chunk - Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_internal.chunks_in(public.test_tz.*, ARRAY[43, 44, 45]) AND (("time" > '2018-01-02 12:00:00'::timestamp without time zone)) + Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_functions.chunks_in(public.test_tz.*, ARRAY[43, 44, 45]) AND (("time" > '2018-01-02 12:00:00'::timestamp without time zone)) Remote EXPLAIN: Append -> Index Scan using _dist_hyper_31_95_chunk_test_tz_time_idx on _timescaledb_internal._dist_hyper_31_95_chunk @@ -5757,8 +5757,8 @@ SELECT count(*) FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz EXPLAIN (verbose, costs off) SELECT count(*) FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz::timestamp; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Aggregate Output: count(*) -> Custom Scan (AsyncAppend) @@ -5766,7 +5766,7 @@ SELECT count(*) FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz -> Custom Scan (DataNodeScan) on public.test_tz test_tz_1 Data node: db_dist_hypertable_1 Chunks: _dist_hyper_31_97_chunk - Remote SQL: SELECT NULL FROM public.test_tz WHERE _timescaledb_internal.chunks_in(public.test_tz.*, ARRAY[45]) AND (("time" > '2018-01-02 12:00:00'::timestamp without time zone)) + Remote SQL: SELECT NULL FROM public.test_tz WHERE _timescaledb_functions.chunks_in(public.test_tz.*, ARRAY[45]) AND (("time" > '2018-01-02 12:00:00'::timestamp without time zone)) Remote EXPLAIN: Result Output: NULL::text @@ -5776,7 +5776,7 @@ SELECT count(*) FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz -> Custom Scan (DataNodeScan) on public.test_tz test_tz_2 Data node: db_dist_hypertable_2 Chunks: _dist_hyper_31_95_chunk, _dist_hyper_31_96_chunk, _dist_hyper_31_98_chunk - Remote SQL: SELECT NULL FROM public.test_tz WHERE _timescaledb_internal.chunks_in(public.test_tz.*, ARRAY[43, 44, 45]) AND (("time" > '2018-01-02 12:00:00'::timestamp without time zone)) + Remote SQL: SELECT NULL FROM public.test_tz WHERE _timescaledb_functions.chunks_in(public.test_tz.*, ARRAY[43, 44, 45]) AND (("time" > '2018-01-02 12:00:00'::timestamp without time zone)) Remote EXPLAIN: Result Output: NULL::text @@ -5807,8 +5807,8 @@ SELECT * FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz::times EXPLAIN (verbose, costs off) SELECT * FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz::timestamp; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: test_tz."time", test_tz.v -> Append @@ -5816,7 +5816,7 @@ SELECT * FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz::times Output: test_tz_1."time", test_tz_1.v Data node: db_dist_hypertable_1 Chunks: _dist_hyper_31_97_chunk - Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_internal.chunks_in(public.test_tz.*, ARRAY[45]) AND (("time" > '2018-01-02 11:00:00'::timestamp without time zone)) + Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_functions.chunks_in(public.test_tz.*, ARRAY[45]) AND (("time" > '2018-01-02 11:00:00'::timestamp without time zone)) Remote EXPLAIN: Index Scan using _dist_hyper_31_97_chunk_test_tz_time_idx on _timescaledb_internal._dist_hyper_31_97_chunk Output: _dist_hyper_31_97_chunk."time", _dist_hyper_31_97_chunk.v @@ -5826,7 +5826,7 @@ SELECT * FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz::times Output: test_tz_2."time", test_tz_2.v Data node: db_dist_hypertable_2 Chunks: _dist_hyper_31_95_chunk, _dist_hyper_31_96_chunk, _dist_hyper_31_98_chunk - Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_internal.chunks_in(public.test_tz.*, ARRAY[43, 44, 45]) AND (("time" > '2018-01-02 11:00:00'::timestamp without time zone)) + Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_functions.chunks_in(public.test_tz.*, ARRAY[43, 44, 45]) AND (("time" > '2018-01-02 11:00:00'::timestamp without time zone)) Remote EXPLAIN: Append -> Index Scan using _dist_hyper_31_95_chunk_test_tz_time_idx on _timescaledb_internal._dist_hyper_31_95_chunk @@ -5849,8 +5849,8 @@ SELECT count(*) FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz EXPLAIN (verbose, costs off) SELECT count(*) FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz::timestamp; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Aggregate Output: count(*) -> Custom Scan (AsyncAppend) @@ -5858,7 +5858,7 @@ SELECT count(*) FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz -> Custom Scan (DataNodeScan) on public.test_tz test_tz_1 Data node: db_dist_hypertable_1 Chunks: _dist_hyper_31_97_chunk - Remote SQL: SELECT NULL FROM public.test_tz WHERE _timescaledb_internal.chunks_in(public.test_tz.*, ARRAY[45]) AND (("time" > '2018-01-02 11:00:00'::timestamp without time zone)) + Remote SQL: SELECT NULL FROM public.test_tz WHERE _timescaledb_functions.chunks_in(public.test_tz.*, ARRAY[45]) AND (("time" > '2018-01-02 11:00:00'::timestamp without time zone)) Remote EXPLAIN: Result Output: NULL::text @@ -5868,7 +5868,7 @@ SELECT count(*) FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz -> Custom Scan (DataNodeScan) on public.test_tz test_tz_2 Data node: db_dist_hypertable_2 Chunks: _dist_hyper_31_95_chunk, _dist_hyper_31_96_chunk, _dist_hyper_31_98_chunk - Remote SQL: SELECT NULL FROM public.test_tz WHERE _timescaledb_internal.chunks_in(public.test_tz.*, ARRAY[43, 44, 45]) AND (("time" > '2018-01-02 11:00:00'::timestamp without time zone)) + Remote SQL: SELECT NULL FROM public.test_tz WHERE _timescaledb_functions.chunks_in(public.test_tz.*, ARRAY[43, 44, 45]) AND (("time" > '2018-01-02 11:00:00'::timestamp without time zone)) Remote EXPLAIN: Result Output: NULL::text @@ -5905,8 +5905,8 @@ WHERE time > x + (x = x)::int -- stable * (x = '2018-01-02 11:00:00'::timestamp)::int -- immutable * INTERVAL '1 hour'; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: test_tz."time", test_tz.v, (('Tue Jan 02 11:00:00 2018 -01'::timestamp with time zone)::timestamp without time zone) -> Append @@ -5914,7 +5914,7 @@ WHERE time > x Output: test_tz_1."time", test_tz_1.v, ('Tue Jan 02 11:00:00 2018 -01'::timestamp with time zone)::timestamp without time zone Data node: db_dist_hypertable_1 Chunks: _dist_hyper_31_97_chunk - Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_internal.chunks_in(public.test_tz.*, ARRAY[45]) AND (("time" > '2018-01-02 12:00:00'::timestamp without time zone)) + Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_functions.chunks_in(public.test_tz.*, ARRAY[45]) AND (("time" > '2018-01-02 12:00:00'::timestamp without time zone)) Remote EXPLAIN: Index Scan using _dist_hyper_31_97_chunk_test_tz_time_idx on _timescaledb_internal._dist_hyper_31_97_chunk Output: _dist_hyper_31_97_chunk."time", _dist_hyper_31_97_chunk.v @@ -5924,7 +5924,7 @@ WHERE time > x Output: test_tz_2."time", test_tz_2.v, ('Tue Jan 02 11:00:00 2018 -01'::timestamp with time zone)::timestamp without time zone Data node: db_dist_hypertable_2 Chunks: _dist_hyper_31_95_chunk, _dist_hyper_31_96_chunk, _dist_hyper_31_98_chunk - Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_internal.chunks_in(public.test_tz.*, ARRAY[43, 44, 45]) AND (("time" > '2018-01-02 12:00:00'::timestamp without time zone)) + Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_functions.chunks_in(public.test_tz.*, ARRAY[43, 44, 45]) AND (("time" > '2018-01-02 12:00:00'::timestamp without time zone)) Remote EXPLAIN: Append -> Index Scan using _dist_hyper_31_95_chunk_test_tz_time_idx on _timescaledb_internal._dist_hyper_31_95_chunk @@ -5950,8 +5950,8 @@ EXPLAIN (COSTS OFF, VERBOSE) SELECT * FROM test_tz WHERE date_trunc('month', time) > date_in('2021-01-01') AND time::time > '00:00:00'::time + (INTERVAL '1 hour') * date_part('hour', INTERVAL '1 hour'); - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: test_tz."time", test_tz.v -> Append @@ -5959,7 +5959,7 @@ SELECT * FROM test_tz WHERE date_trunc('month', time) > date_in('2021-01-01') Output: test_tz_1."time", test_tz_1.v Data node: db_dist_hypertable_1 Chunks: _dist_hyper_31_97_chunk - Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_internal.chunks_in(public.test_tz.*, ARRAY[45]) AND (("time"::time without time zone > '01:00:00'::time without time zone)) AND ((date_trunc('month'::text, "time") > '2021-01-01'::date)) + Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_functions.chunks_in(public.test_tz.*, ARRAY[45]) AND (("time"::time without time zone > '01:00:00'::time without time zone)) AND ((date_trunc('month'::text, "time") > '2021-01-01'::date)) Remote EXPLAIN: Seq Scan on _timescaledb_internal._dist_hyper_31_97_chunk Output: _dist_hyper_31_97_chunk."time", _dist_hyper_31_97_chunk.v @@ -5969,7 +5969,7 @@ SELECT * FROM test_tz WHERE date_trunc('month', time) > date_in('2021-01-01') Output: test_tz_2."time", test_tz_2.v Data node: db_dist_hypertable_2 Chunks: _dist_hyper_31_95_chunk, _dist_hyper_31_96_chunk, _dist_hyper_31_98_chunk - Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_internal.chunks_in(public.test_tz.*, ARRAY[43, 44, 45]) AND (("time"::time without time zone > '01:00:00'::time without time zone)) AND ((date_trunc('month'::text, "time") > '2021-01-01'::date)) + Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_functions.chunks_in(public.test_tz.*, ARRAY[43, 44, 45]) AND (("time"::time without time zone > '01:00:00'::time without time zone)) AND ((date_trunc('month'::text, "time") > '2021-01-01'::date)) Remote EXPLAIN: Append -> Seq Scan on _timescaledb_internal._dist_hyper_31_95_chunk @@ -6184,7 +6184,7 @@ WHERE hypertable_name = 'pruned_chunks_1' ORDER BY chunk_name LIMIT 1 \gset \set ON_ERROR_STOP 0 -SELECT _timescaledb_internal.freeze_chunk( :'CHNAME'); +SELECT _timescaledb_functions.freeze_chunk( :'CHNAME'); ERROR: operation not supported on distributed chunk or foreign table "_dist_hyper_36_107_chunk" \set ON_ERROR_STOP 1 --TEST freeze_chunk api for regular hypertables. Works only for >= PG14 @@ -6197,7 +6197,7 @@ SELECT table_name FROM create_hypertable('freeze_1', 'time'); INSERT INTO freeze_1 VALUES ('2020-12-09',1,32.2); \set ON_ERROR_STOP 0 -SELECT _timescaledb_internal.freeze_chunk( ch) FROM ( select show_chunks('freeze_1') ch ) q; +SELECT _timescaledb_functions.freeze_chunk( ch) FROM ( select show_chunks('freeze_1') ch ) q; freeze_chunk -------------- t diff --git a/tsl/test/expected/dist_hypertable-15.out b/tsl/test/expected/dist_hypertable-15.out index e29a90a55dd..f6280de1ebe 100644 --- a/tsl/test/expected/dist_hypertable-15.out +++ b/tsl/test/expected/dist_hypertable-15.out @@ -482,7 +482,7 @@ PREPARE dist_insert (timestamptz, int, float) AS INSERT INTO disttable VALUES ($1, $2, $3); EXECUTE dist_insert ('2017-01-01 06:05', 1, 1.4); -- Show chunks created -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable'); chunk_id | hypertable_id | schema_name | table_name | relkind | slices ----------+---------------+-----------------------+-----------------------+---------+--------------------------------------------------------------------------------------------- @@ -517,11 +517,11 @@ SELECT * FROM hypertable_partitions; -- Show that chunks are created on data nodes and that each data node -- has their own unique slice in the space (device) dimension. SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable'); $$); NOTICE: [db_dist_hypertable_1]: -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable') NOTICE: [db_dist_hypertable_1]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -532,7 +532,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|slice NOTICE: [db_dist_hypertable_2]: -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable') NOTICE: [db_dist_hypertable_2]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -543,7 +543,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|slice NOTICE: [db_dist_hypertable_3]: -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable') NOTICE: [db_dist_hypertable_3]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -629,8 +629,8 @@ SELECT * FROM hypertable_detailed_size('disttable') ORDER BY node_name; -- Show what some queries would look like on the frontend EXPLAIN (VERBOSE, COSTS FALSE) SELECT * FROM disttable; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: disttable."time", disttable.device, disttable.temp -> Append @@ -638,17 +638,17 @@ SELECT * FROM disttable; Output: disttable_1."time", disttable_1.device, disttable_1.temp Data node: db_dist_hypertable_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT "time", device, temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) + Remote SQL: SELECT "time", device, temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) -> Custom Scan (DataNodeScan) on public.disttable disttable_2 Output: disttable_2."time", disttable_2.device, disttable_2.temp Data node: db_dist_hypertable_2 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_5_chunk - Remote SQL: SELECT "time", device, temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) + Remote SQL: SELECT "time", device, temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) -> Custom Scan (DataNodeScan) on public.disttable disttable_3 Output: disttable_3."time", disttable_3.device, disttable_3.temp Data node: db_dist_hypertable_3 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_6_chunk - Remote SQL: SELECT "time", device, temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) + Remote SQL: SELECT "time", device, temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) (18 rows) SELECT * FROM disttable; @@ -679,8 +679,8 @@ EXPLAIN (VERBOSE, COSTS FALSE) SELECT time_bucket('3 hours', time) AS time, device, avg(temp) AS avg_temp FROM disttable GROUP BY 1, 2 ORDER BY 1; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate Output: (time_bucket('@ 3 hours'::interval, disttable."time")), disttable.device, avg(disttable.temp) Group Key: (time_bucket('@ 3 hours'::interval, disttable."time")), disttable.device @@ -694,21 +694,21 @@ ORDER BY 1; Output: disttable_1."time", disttable_1.device, disttable_1.temp Data node: db_dist_hypertable_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT "time", device, temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) ORDER BY public.time_bucket('03:00:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) ORDER BY public.time_bucket('03:00:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Result Output: time_bucket('@ 3 hours'::interval, disttable_2."time"), disttable_2.device, disttable_2.temp -> Custom Scan (DataNodeScan) on public.disttable disttable_2 Output: disttable_2."time", disttable_2.device, disttable_2.temp Data node: db_dist_hypertable_2 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_5_chunk - Remote SQL: SELECT "time", device, temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) ORDER BY public.time_bucket('03:00:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) ORDER BY public.time_bucket('03:00:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Result Output: time_bucket('@ 3 hours'::interval, disttable_3."time"), disttable_3.device, disttable_3.temp -> Custom Scan (DataNodeScan) on public.disttable disttable_3 Output: disttable_3."time", disttable_3.device, disttable_3.temp Data node: db_dist_hypertable_3 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_6_chunk - Remote SQL: SELECT "time", device, temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) ORDER BY public.time_bucket('03:00:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) ORDER BY public.time_bucket('03:00:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (28 rows) -- Execute some queries on the frontend and return the results @@ -783,8 +783,8 @@ ORDER BY 1; EXPLAIN (VERBOSE, COSTS FALSE) SELECT max(temp) FROM disttable; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Result Output: $0 InitPlan 1 (returns $0) @@ -798,17 +798,17 @@ FROM disttable; Output: disttable_1.temp Data node: db_dist_hypertable_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 -> Custom Scan (DataNodeScan) on public.disttable disttable_2 Output: disttable_2.temp Data node: db_dist_hypertable_2 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_5_chunk - Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 -> Custom Scan (DataNodeScan) on public.disttable disttable_3 Output: disttable_3.temp Data node: db_dist_hypertable_3 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_6_chunk - Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 (24 rows) SELECT max(temp) @@ -823,8 +823,8 @@ SET timescaledb.enable_async_append = OFF; EXPLAIN (VERBOSE, COSTS FALSE) SELECT max(temp) FROM disttable; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Result Output: $0 InitPlan 1 (returns $0) @@ -836,25 +836,25 @@ FROM disttable; Output: disttable_1.temp Data node: db_dist_hypertable_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 -> Custom Scan (DataNodeScan) on public.disttable disttable_2 Output: disttable_2.temp Data node: db_dist_hypertable_2 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_5_chunk - Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 -> Custom Scan (DataNodeScan) on public.disttable disttable_3 Output: disttable_3.temp Data node: db_dist_hypertable_3 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_6_chunk - Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 (22 rows) SET timescaledb.enable_async_append = ON; EXPLAIN (VERBOSE, COSTS FALSE) SELECT min(temp), max(temp) FROM disttable; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------- Aggregate Output: min(disttable.temp), max(disttable.temp) -> Custom Scan (AsyncAppend) @@ -864,17 +864,17 @@ FROM disttable; Output: disttable_1.temp Data node: db_dist_hypertable_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) + Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) -> Custom Scan (DataNodeScan) on public.disttable disttable_2 Output: disttable_2.temp Data node: db_dist_hypertable_2 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_5_chunk - Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) + Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) -> Custom Scan (DataNodeScan) on public.disttable disttable_3 Output: disttable_3.temp Data node: db_dist_hypertable_3 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_6_chunk - Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) + Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) (20 rows) SELECT min(temp), max(temp) @@ -889,8 +889,8 @@ EXPLAIN (VERBOSE, COSTS FALSE) SELECT device, temp, avg(temp) OVER (PARTITION BY device) FROM disttable ORDER BY device, temp; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Sort Output: disttable.device, disttable.temp, (avg(disttable.temp) OVER (?)) Sort Key: disttable.device, disttable.temp @@ -904,17 +904,17 @@ ORDER BY device, temp; Output: disttable_1.device, disttable_1.temp Data node: db_dist_hypertable_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT device, temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.disttable disttable_2 Output: disttable_2.device, disttable_2.temp Data node: db_dist_hypertable_2 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_5_chunk - Remote SQL: SELECT device, temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.disttable disttable_3 Output: disttable_3.device, disttable_3.temp Data node: db_dist_hypertable_3 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_6_chunk - Remote SQL: SELECT device, temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) ORDER BY device ASC NULLS LAST (24 rows) SELECT device, temp, avg(temp) OVER (PARTITION BY device) @@ -946,7 +946,7 @@ ORDER BY device, temp; -- Test remote explain -- Make sure that chunks_in function only expects one-dimensional integer arrays \set ON_ERROR_STOP 0 -SELECT "time" FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[[2], [1]]) +SELECT "time" FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[[2], [1]]) ORDER BY "time" DESC NULLS FIRST LIMIT 1; ERROR: invalid number of array dimensions for chunks_in \set ON_ERROR_STOP 1 @@ -956,8 +956,8 @@ SET timescaledb.enable_remote_explain = ON; EXPLAIN (VERBOSE, COSTS FALSE) SELECT max(time) FROM disttable; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Result Output: $0 InitPlan 1 (returns $0) @@ -971,7 +971,7 @@ FROM disttable; Output: disttable_1."time" Data node: db_dist_hypertable_1 Chunks: _dist_hyper_1_4_chunk, _dist_hyper_1_1_chunk - Remote SQL: SELECT "time" FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[2, 1]) AND (("time" IS NOT NULL)) ORDER BY "time" DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT "time" FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[2, 1]) AND (("time" IS NOT NULL)) ORDER BY "time" DESC NULLS FIRST LIMIT 1 Remote EXPLAIN: Limit Output: disttable."time" @@ -991,7 +991,7 @@ FROM disttable; Output: disttable_2."time" Data node: db_dist_hypertable_2 Chunks: _dist_hyper_1_5_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT "time" FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[2, 1]) AND (("time" IS NOT NULL)) ORDER BY "time" DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT "time" FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[2, 1]) AND (("time" IS NOT NULL)) ORDER BY "time" DESC NULLS FIRST LIMIT 1 Remote EXPLAIN: Limit Output: disttable."time" @@ -1011,7 +1011,7 @@ FROM disttable; Output: disttable_3."time" Data node: db_dist_hypertable_3 Chunks: _dist_hyper_1_6_chunk, _dist_hyper_1_2_chunk - Remote SQL: SELECT "time" FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[2, 1]) AND (("time" IS NOT NULL)) ORDER BY "time" DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT "time" FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[2, 1]) AND (("time" IS NOT NULL)) ORDER BY "time" DESC NULLS FIRST LIMIT 1 Remote EXPLAIN: Limit Output: disttable."time" @@ -1032,8 +1032,8 @@ FROM disttable; EXPLAIN (VERBOSE, COSTS FALSE) SELECT max(temp) FROM disttable; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Result Output: $0 InitPlan 1 (returns $0) @@ -1047,7 +1047,7 @@ FROM disttable; Output: disttable_1.temp Data node: db_dist_hypertable_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 Remote EXPLAIN: Limit Output: _dist_hyper_1_1_chunk.temp @@ -1066,7 +1066,7 @@ FROM disttable; Output: disttable_2.temp Data node: db_dist_hypertable_2 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_5_chunk - Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 Remote EXPLAIN: Limit Output: _dist_hyper_1_3_chunk.temp @@ -1085,7 +1085,7 @@ FROM disttable; Output: disttable_3.temp Data node: db_dist_hypertable_3 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_6_chunk - Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 Remote EXPLAIN: Limit Output: _dist_hyper_1_2_chunk.temp @@ -1123,8 +1123,8 @@ FROM disttable; EXPLAIN (ANALYZE, VERBOSE, COSTS FALSE, BUFFERS OFF, TIMING OFF, SUMMARY OFF) SELECT max(temp) FROM disttable; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Result (actual rows=1 loops=1) Output: $0 InitPlan 1 (returns $0) @@ -1139,7 +1139,7 @@ FROM disttable; Data node: db_dist_hypertable_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 Remote EXPLAIN: Limit (actual rows=1 loops=1) Output: _dist_hyper_1_1_chunk.temp @@ -1160,7 +1160,7 @@ FROM disttable; Data node: db_dist_hypertable_2 Fetcher Type: COPY Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_5_chunk - Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 Remote EXPLAIN: Limit (actual rows=1 loops=1) Output: _dist_hyper_1_3_chunk.temp @@ -1181,7 +1181,7 @@ FROM disttable; Data node: db_dist_hypertable_3 Fetcher Type: COPY Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_6_chunk - Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT temp FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[1, 2]) AND ((temp IS NOT NULL)) ORDER BY temp DESC NULLS FIRST LIMIT 1 Remote EXPLAIN: Limit (actual rows=1 loops=1) Output: _dist_hyper_1_2_chunk.temp @@ -1360,7 +1360,7 @@ FROM test.show_subtables('disttable') st; (24 rows) SELECT cc.* -FROM (SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +FROM (SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable')) c, _timescaledb_catalog.chunk_constraint cc WHERE c.chunk_id = cc.chunk_id; @@ -1431,11 +1431,11 @@ INSERT INTO disttable (time, device, "Color", temp) VALUES ('2017-09-02 06:09', 6, 2, 10.5) ON CONFLICT DO NOTHING; SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable'); $$); NOTICE: [db_dist_hypertable_1]: -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable') NOTICE: [db_dist_hypertable_1]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -1447,7 +1447,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|slice NOTICE: [db_dist_hypertable_2]: -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable') NOTICE: [db_dist_hypertable_2]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -1459,7 +1459,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|slice NOTICE: [db_dist_hypertable_3]: -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable') NOTICE: [db_dist_hypertable_3]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -1866,7 +1866,7 @@ SELECT * FROM _timescaledb_catalog.chunk_data_node ORDER BY 1,2,3; 10 | 4 | db_dist_hypertable_3 (3 rows) -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('underreplicated'); chunk_id | hypertable_id | schema_name | table_name | relkind | slices ----------+---------------+-----------------------+------------------------+---------+------------------------------------------------ @@ -1885,11 +1885,11 @@ SELECT * FROM _timescaledb_catalog.chunk_data_node ORDER BY 1,2,3; -- Show that chunks are created on remote data nodes and that all -- data nodes/chunks have the same data due to replication SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('underreplicated'); $$); NOTICE: [db_dist_hypertable_1]: -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('underreplicated') NOTICE: [db_dist_hypertable_1]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -1899,7 +1899,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|slic NOTICE: [db_dist_hypertable_2]: -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('underreplicated') NOTICE: [db_dist_hypertable_2]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -1909,7 +1909,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|slic NOTICE: [db_dist_hypertable_3]: -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('underreplicated') NOTICE: [db_dist_hypertable_3]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -2214,9 +2214,9 @@ SELECT * FROM set_number_partitions('"Table\\Schema"."Param_Table"', 4); SELECT * FROM _timescaledb_catalog.hypertable; id | schema_name | table_name | associated_schema_name | associated_table_prefix | num_dimensions | chunk_sizing_func_schema | chunk_sizing_func_name | chunk_target_size | compression_state | compressed_hypertable_id | replication_factor ----+---------------+-----------------+------------------------+-------------------------+----------------+--------------------------+--------------------------+-------------------+-------------------+--------------------------+-------------------- - 1 | public | disttable | _timescaledb_internal | _dist_hyper_1 | 2 | _timescaledb_internal | calculate_chunk_interval | 0 | 0 | | 1 - 2 | public | underreplicated | _timescaledb_internal | _dist_hyper_2 | 1 | _timescaledb_internal | calculate_chunk_interval | 0 | 0 | | 4 - 4 | Table\\Schema | Param_Table | T3sTSch | test*pre_ | 2 | _timescaledb_internal | calculate_chunk_interval | 0 | 0 | | 2 + 1 | public | disttable | _timescaledb_internal | _dist_hyper_1 | 2 | _timescaledb_functions | calculate_chunk_interval | 0 | 0 | | 1 + 2 | public | underreplicated | _timescaledb_internal | _dist_hyper_2 | 1 | _timescaledb_functions | calculate_chunk_interval | 0 | 0 | | 4 + 4 | Table\\Schema | Param_Table | T3sTSch | test*pre_ | 2 | _timescaledb_functions | calculate_chunk_interval | 0 | 0 | | 2 (3 rows) SELECT * FROM _timescaledb_catalog.dimension; @@ -2246,9 +2246,9 @@ SELECT * FROM _timescaledb_catalog.hypertable NOTICE: [db_dist_hypertable_1]: id|schema_name |table_name |associated_schema_name|associated_table_prefix|num_dimensions|chunk_sizing_func_schema|chunk_sizing_func_name |chunk_target_size|compression_state|compressed_hypertable_id|replication_factor --+-------------+---------------+----------------------+-----------------------+--------------+------------------------+------------------------+-----------------+-----------------+------------------------+------------------ - 1|public |disttable |_timescaledb_internal |_dist_hyper_1 | 2|_timescaledb_internal |calculate_chunk_interval| 0| 0| | -1 - 2|public |underreplicated|_timescaledb_internal |_dist_hyper_2 | 1|_timescaledb_internal |calculate_chunk_interval| 0| 0| | -1 - 3|Table\\Schema|Param_Table |T3sTSch |test*pre_ | 2|_timescaledb_internal |calculate_chunk_interval| 0| 0| | -1 + 1|public |disttable |_timescaledb_internal |_dist_hyper_1 | 2|_timescaledb_functions |calculate_chunk_interval| 0| 0| | -1 + 2|public |underreplicated|_timescaledb_internal |_dist_hyper_2 | 1|_timescaledb_functions |calculate_chunk_interval| 0| 0| | -1 + 3|Table\\Schema|Param_Table |T3sTSch |test*pre_ | 2|_timescaledb_functions |calculate_chunk_interval| 0| 0| | -1 (3 rows) @@ -2280,9 +2280,9 @@ SELECT * FROM _timescaledb_catalog.hypertable NOTICE: [db_dist_hypertable_2]: id|schema_name |table_name |associated_schema_name|associated_table_prefix|num_dimensions|chunk_sizing_func_schema|chunk_sizing_func_name |chunk_target_size|compression_state|compressed_hypertable_id|replication_factor --+-------------+---------------+----------------------+-----------------------+--------------+------------------------+------------------------+-----------------+-----------------+------------------------+------------------ - 1|public |disttable |_timescaledb_internal |_dist_hyper_1 | 2|_timescaledb_internal |calculate_chunk_interval| 0| 0| | -1 - 2|public |underreplicated|_timescaledb_internal |_dist_hyper_2 | 1|_timescaledb_internal |calculate_chunk_interval| 0| 0| | -1 - 4|Table\\Schema|Param_Table |T3sTSch |test*pre_ | 2|_timescaledb_internal |calculate_chunk_interval| 0| 0| | -1 + 1|public |disttable |_timescaledb_internal |_dist_hyper_1 | 2|_timescaledb_functions |calculate_chunk_interval| 0| 0| | -1 + 2|public |underreplicated|_timescaledb_internal |_dist_hyper_2 | 1|_timescaledb_functions |calculate_chunk_interval| 0| 0| | -1 + 4|Table\\Schema|Param_Table |T3sTSch |test*pre_ | 2|_timescaledb_functions |calculate_chunk_interval| 0| 0| | -1 (3 rows) @@ -2314,9 +2314,9 @@ SELECT * FROM _timescaledb_catalog.hypertable NOTICE: [db_dist_hypertable_3]: id|schema_name |table_name |associated_schema_name|associated_table_prefix|num_dimensions|chunk_sizing_func_schema|chunk_sizing_func_name |chunk_target_size|compression_state|compressed_hypertable_id|replication_factor --+-------------+---------------+----------------------+-----------------------+--------------+------------------------+------------------------+-----------------+-----------------+------------------------+------------------ - 1|public |disttable |_timescaledb_internal |_dist_hyper_1 | 2|_timescaledb_internal |calculate_chunk_interval| 0| 0| | -1 - 2|public |underreplicated|_timescaledb_internal |_dist_hyper_2 | 1|_timescaledb_internal |calculate_chunk_interval| 0| 0| | -1 - 3|Table\\Schema|Param_Table |T3sTSch |test*pre_ | 2|_timescaledb_internal |calculate_chunk_interval| 0| 0| | -1 + 1|public |disttable |_timescaledb_internal |_dist_hyper_1 | 2|_timescaledb_functions |calculate_chunk_interval| 0| 0| | -1 + 2|public |underreplicated|_timescaledb_internal |_dist_hyper_2 | 1|_timescaledb_functions |calculate_chunk_interval| 0| 0| | -1 + 3|Table\\Schema|Param_Table |T3sTSch |test*pre_ | 2|_timescaledb_functions |calculate_chunk_interval| 0| 0| | -1 (3 rows) @@ -2573,8 +2573,8 @@ SELECT * FROM disttable_replicated; EXPLAIN (VERBOSE, ANALYZE, COSTS FALSE, TIMING FALSE, SUMMARY FALSE) SELECT * FROM disttable_replicated; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Custom Scan (AsyncAppend) (actual rows=8 loops=1) Output: disttable_replicated."time", disttable_replicated.device, disttable_replicated.temp, disttable_replicated."Color" -> Append (actual rows=8 loops=1) @@ -2583,19 +2583,19 @@ SELECT * FROM disttable_replicated; Data node: db_dist_hypertable_1 Fetcher Type: COPY Chunks: _dist_hyper_6_12_chunk, _dist_hyper_6_15_chunk - Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) + Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) -> Custom Scan (DataNodeScan) on public.disttable_replicated disttable_replicated_2 (actual rows=2 loops=1) Output: disttable_replicated_2."time", disttable_replicated_2.device, disttable_replicated_2.temp, disttable_replicated_2."Color" Data node: db_dist_hypertable_2 Fetcher Type: COPY Chunks: _dist_hyper_6_13_chunk, _dist_hyper_6_16_chunk - Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) + Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) -> Custom Scan (DataNodeScan) on public.disttable_replicated disttable_replicated_3 (actual rows=2 loops=1) Output: disttable_replicated_3."time", disttable_replicated_3.device, disttable_replicated_3.temp, disttable_replicated_3."Color" Data node: db_dist_hypertable_3 Fetcher Type: COPY Chunks: _dist_hyper_6_14_chunk, _dist_hyper_6_17_chunk - Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) + Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) (21 rows) --guc disables the optimization @@ -2641,8 +2641,8 @@ SET timescaledb.enable_per_data_node_queries = TRUE; --test WHERE clause EXPLAIN (VERBOSE, ANALYZE, COSTS FALSE, TIMING FALSE, SUMMARY FALSE) SELECT * FROM disttable_replicated WHERE temp > 2.0; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=2 loops=1) Output: disttable_replicated."time", disttable_replicated.device, disttable_replicated.temp, disttable_replicated."Color" -> Append (actual rows=2 loops=1) @@ -2651,26 +2651,26 @@ SELECT * FROM disttable_replicated WHERE temp > 2.0; Data node: db_dist_hypertable_1 Fetcher Type: COPY Chunks: _dist_hyper_6_12_chunk, _dist_hyper_6_15_chunk - Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) AND ((temp > 2::double precision)) + Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) AND ((temp > 2::double precision)) -> Custom Scan (DataNodeScan) on public.disttable_replicated disttable_replicated_2 (actual rows=0 loops=1) Output: disttable_replicated_2."time", disttable_replicated_2.device, disttable_replicated_2.temp, disttable_replicated_2."Color" Data node: db_dist_hypertable_2 Fetcher Type: COPY Chunks: _dist_hyper_6_13_chunk, _dist_hyper_6_16_chunk - Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) AND ((temp > 2::double precision)) + Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) AND ((temp > 2::double precision)) -> Custom Scan (DataNodeScan) on public.disttable_replicated disttable_replicated_3 (actual rows=2 loops=1) Output: disttable_replicated_3."time", disttable_replicated_3.device, disttable_replicated_3.temp, disttable_replicated_3."Color" Data node: db_dist_hypertable_3 Fetcher Type: COPY Chunks: _dist_hyper_6_14_chunk, _dist_hyper_6_17_chunk - Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) AND ((temp > 2::double precision)) + Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) AND ((temp > 2::double precision)) (21 rows) --test OR EXPLAIN (VERBOSE, ANALYZE, COSTS FALSE, TIMING FALSE, SUMMARY FALSE) SELECT * FROM disttable_replicated WHERE temp > 2.0 or "Color" = 11; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=3 loops=1) Output: disttable_replicated."time", disttable_replicated.device, disttable_replicated.temp, disttable_replicated."Color" -> Append (actual rows=3 loops=1) @@ -2679,26 +2679,26 @@ SELECT * FROM disttable_replicated WHERE temp > 2.0 or "Color" = 11; Data node: db_dist_hypertable_1 Fetcher Type: COPY Chunks: _dist_hyper_6_12_chunk, _dist_hyper_6_15_chunk - Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) AND (((temp > 2::double precision) OR ("Color" = 11))) + Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) AND (((temp > 2::double precision) OR ("Color" = 11))) -> Custom Scan (DataNodeScan) on public.disttable_replicated disttable_replicated_2 (actual rows=0 loops=1) Output: disttable_replicated_2."time", disttable_replicated_2.device, disttable_replicated_2.temp, disttable_replicated_2."Color" Data node: db_dist_hypertable_2 Fetcher Type: COPY Chunks: _dist_hyper_6_13_chunk, _dist_hyper_6_16_chunk - Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) AND (((temp > 2::double precision) OR ("Color" = 11))) + Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) AND (((temp > 2::double precision) OR ("Color" = 11))) -> Custom Scan (DataNodeScan) on public.disttable_replicated disttable_replicated_3 (actual rows=2 loops=1) Output: disttable_replicated_3."time", disttable_replicated_3.device, disttable_replicated_3.temp, disttable_replicated_3."Color" Data node: db_dist_hypertable_3 Fetcher Type: COPY Chunks: _dist_hyper_6_14_chunk, _dist_hyper_6_17_chunk - Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) AND (((temp > 2::double precision) OR ("Color" = 11))) + Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) AND (((temp > 2::double precision) OR ("Color" = 11))) (21 rows) --test some chunks excluded EXPLAIN (VERBOSE, ANALYZE, COSTS FALSE, TIMING FALSE, SUMMARY FALSE) SELECT * FROM disttable_replicated WHERE time < '2018-01-01 09:11'; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=2 loops=1) Output: disttable_replicated."time", disttable_replicated.device, disttable_replicated.temp, disttable_replicated."Color" -> Append (actual rows=2 loops=1) @@ -2707,13 +2707,13 @@ SELECT * FROM disttable_replicated WHERE time < '2018-01-01 09:11'; Data node: db_dist_hypertable_1 Fetcher Type: COPY Chunks: _dist_hyper_6_12_chunk - Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6]) AND (("time" < '2018-01-01 09:11:00-08'::timestamp with time zone)) + Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6]) AND (("time" < '2018-01-01 09:11:00-08'::timestamp with time zone)) -> Custom Scan (DataNodeScan) on public.disttable_replicated disttable_replicated_2 (actual rows=0 loops=1) Output: disttable_replicated_2."time", disttable_replicated_2.device, disttable_replicated_2.temp, disttable_replicated_2."Color" Data node: db_dist_hypertable_2 Fetcher Type: COPY Chunks: _dist_hyper_6_13_chunk - Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6]) AND (("time" < '2018-01-01 09:11:00-08'::timestamp with time zone)) + Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6]) AND (("time" < '2018-01-01 09:11:00-08'::timestamp with time zone)) (15 rows) --test all chunks excluded @@ -2732,8 +2732,8 @@ WITH cte AS ( SELECT * FROM disttable_replicated ) SELECT * FROM cte; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Custom Scan (AsyncAppend) (actual rows=8 loops=1) Output: disttable_replicated."time", disttable_replicated.device, disttable_replicated.temp, disttable_replicated."Color" -> Append (actual rows=8 loops=1) @@ -2742,19 +2742,19 @@ SELECT * FROM cte; Data node: db_dist_hypertable_1 Fetcher Type: COPY Chunks: _dist_hyper_6_12_chunk, _dist_hyper_6_15_chunk - Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) + Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) -> Custom Scan (DataNodeScan) on public.disttable_replicated disttable_replicated_2 (actual rows=2 loops=1) Output: disttable_replicated_2."time", disttable_replicated_2.device, disttable_replicated_2.temp, disttable_replicated_2."Color" Data node: db_dist_hypertable_2 Fetcher Type: COPY Chunks: _dist_hyper_6_13_chunk, _dist_hyper_6_16_chunk - Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) + Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) -> Custom Scan (DataNodeScan) on public.disttable_replicated disttable_replicated_3 (actual rows=2 loops=1) Output: disttable_replicated_3."time", disttable_replicated_3.device, disttable_replicated_3.temp, disttable_replicated_3."Color" Data node: db_dist_hypertable_3 Fetcher Type: COPY Chunks: _dist_hyper_6_14_chunk, _dist_hyper_6_17_chunk - Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) + Remote SQL: SELECT "time", device, temp, "Color" FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) (21 rows) --queries that involve updates/inserts are not optimized @@ -2763,8 +2763,8 @@ WITH devices AS ( SELECT DISTINCT device FROM disttable_replicated ORDER BY device ) UPDATE disttable_replicated SET device = 2 WHERE device = (SELECT device FROM devices LIMIT 1); - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Update on public.disttable_replicated (actual rows=0 loops=1) Update on public.disttable_replicated disttable_replicated_1 Foreign Update on _timescaledb_internal._dist_hyper_6_12_chunk disttable_replicated_2 @@ -2793,19 +2793,19 @@ UPDATE disttable_replicated SET device = 2 WHERE device = (SELECT device FROM de Data node: db_dist_hypertable_1 Fetcher Type: Cursor Chunks: _dist_hyper_6_12_chunk, _dist_hyper_6_15_chunk - Remote SQL: SELECT DISTINCT device FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT DISTINCT device FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.disttable_replicated disttable_replicated_10 (actual rows=1 loops=1) Output: disttable_replicated_10.device Data node: db_dist_hypertable_2 Fetcher Type: Cursor Chunks: _dist_hyper_6_13_chunk, _dist_hyper_6_16_chunk - Remote SQL: SELECT DISTINCT device FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT DISTINCT device FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.disttable_replicated disttable_replicated_11 (actual rows=1 loops=1) Output: disttable_replicated_11.device Data node: db_dist_hypertable_3 Fetcher Type: Cursor Chunks: _dist_hyper_6_14_chunk, _dist_hyper_6_17_chunk - Remote SQL: SELECT DISTINCT device FROM public.disttable_replicated WHERE _timescaledb_internal.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT DISTINCT device FROM public.disttable_replicated WHERE _timescaledb_functions.chunks_in(public.disttable_replicated.*, ARRAY[6, 8]) ORDER BY device ASC NULLS LAST -> Result (actual rows=2 loops=1) Output: 2, disttable_replicated.tableoid, disttable_replicated.ctid, (NULL::record) -> Append (actual rows=2 loops=1) @@ -2996,8 +2996,8 @@ SET timescaledb.enable_remote_explain = ON; EXPLAIN (VERBOSE, COSTS OFF, TIMING OFF, SUMMARY OFF) SELECT * FROM twodim ORDER BY time; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: twodim."time", twodim."Color", twodim.temp -> Merge Append @@ -3006,7 +3006,7 @@ ORDER BY time; Output: twodim_1."time", twodim_1."Color", twodim_1.temp Data node: db_dist_hypertable_1 Chunks: _dist_hyper_7_18_chunk, _dist_hyper_7_22_chunk, _dist_hyper_7_25_chunk - Remote SQL: SELECT "time", "Color", temp FROM public.twodim WHERE _timescaledb_internal.chunks_in(public.twodim.*, ARRAY[10, 12, 14]) ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", "Color", temp FROM public.twodim WHERE _timescaledb_functions.chunks_in(public.twodim.*, ARRAY[10, 12, 14]) ORDER BY "time" ASC NULLS LAST Remote EXPLAIN: Custom Scan (ChunkAppend) on public.twodim Output: twodim."time", twodim."Color", twodim.temp @@ -3024,7 +3024,7 @@ ORDER BY time; Output: twodim_2."time", twodim_2."Color", twodim_2.temp Data node: db_dist_hypertable_2 Chunks: _dist_hyper_7_19_chunk, _dist_hyper_7_21_chunk, _dist_hyper_7_24_chunk - Remote SQL: SELECT "time", "Color", temp FROM public.twodim WHERE _timescaledb_internal.chunks_in(public.twodim.*, ARRAY[10, 11, 13]) ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", "Color", temp FROM public.twodim WHERE _timescaledb_functions.chunks_in(public.twodim.*, ARRAY[10, 11, 13]) ORDER BY "time" ASC NULLS LAST Remote EXPLAIN: Custom Scan (ChunkAppend) on public.twodim Output: twodim."time", twodim."Color", twodim.temp @@ -3042,7 +3042,7 @@ ORDER BY time; Output: twodim_3."time", twodim_3."Color", twodim_3.temp Data node: db_dist_hypertable_3 Chunks: _dist_hyper_7_20_chunk, _dist_hyper_7_23_chunk - Remote SQL: SELECT "time", "Color", temp FROM public.twodim WHERE _timescaledb_internal.chunks_in(public.twodim.*, ARRAY[10, 12]) ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", "Color", temp FROM public.twodim WHERE _timescaledb_functions.chunks_in(public.twodim.*, ARRAY[10, 12]) ORDER BY "time" ASC NULLS LAST Remote EXPLAIN: Custom Scan (ChunkAppend) on public.twodim Output: twodim."time", twodim."Color", twodim.temp @@ -3308,7 +3308,7 @@ INSERT INTO disttable_drop_chunks VALUES ('2018-07-01 09:11', 90, 2.7), ('2018-07-01 08:01', 29, 1.5); -- Show chunks on access node -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable_drop_chunks'); chunk_id | hypertable_id | schema_name | table_name | relkind | slices ----------+---------------+-----------------------+-------------------------+---------+--------------------------------------------------------------------------------------------- @@ -3322,11 +3322,11 @@ FROM show_chunks('disttable_drop_chunks'); -- Show chunks on data nodes SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable_drop_chunks'); $$); NOTICE: [db_dist_hypertable_1]: -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable_drop_chunks') NOTICE: [db_dist_hypertable_1]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -3339,7 +3339,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|sli NOTICE: [db_dist_hypertable_2]: -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable_drop_chunks') NOTICE: [db_dist_hypertable_2]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -3352,7 +3352,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|sli NOTICE: [db_dist_hypertable_3]: -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable_drop_chunks') NOTICE: [db_dist_hypertable_3]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -3386,7 +3386,7 @@ SELECT * FROM disttable_drop_chunks; Sun Jul 01 08:01:00 2018 PDT | 29 | 2 (4 rows) -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable_drop_chunks'); chunk_id | hypertable_id | schema_name | table_name | relkind | slices ----------+---------------+-----------------------+-------------------------+---------+--------------------------------------------------------------------------------------------- @@ -3396,11 +3396,11 @@ FROM show_chunks('disttable_drop_chunks'); (3 rows) SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable_drop_chunks'); $$); NOTICE: [db_dist_hypertable_1]: -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable_drop_chunks') NOTICE: [db_dist_hypertable_1]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -3411,7 +3411,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|sli NOTICE: [db_dist_hypertable_2]: -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable_drop_chunks') NOTICE: [db_dist_hypertable_2]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -3422,7 +3422,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|sli NOTICE: [db_dist_hypertable_3]: -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable_drop_chunks') NOTICE: [db_dist_hypertable_3]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -3789,13 +3789,13 @@ INSERT INTO dist_device VALUES ('2017-01-01 08:01', 1, 1.2); EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM dist_device; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------ Custom Scan (DataNodeScan) on public.dist_device Output: dist_device."time", dist_device.dist_device, dist_device.temp Data node: db_dist_hypertable_1 Chunks: _dist_hyper_15_37_chunk - Remote SQL: SELECT "time", dist_device, temp FROM public.dist_device WHERE _timescaledb_internal.chunks_in(public.dist_device.*, ARRAY[22]) + Remote SQL: SELECT "time", dist_device, temp FROM public.dist_device WHERE _timescaledb_functions.chunks_in(public.dist_device.*, ARRAY[22]) (5 rows) -- Check that datanodes use ChunkAppend plans with chunks_in function in the @@ -3803,13 +3803,13 @@ SELECT * FROM dist_device; SET timescaledb.enable_remote_explain = ON; EXPLAIN (VERBOSE, COSTS OFF, TIMING OFF, SUMMARY OFF) SELECT "time", dist_device, temp FROM public.dist_device ORDER BY "time" ASC NULLS LAST; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) on public.dist_device Output: dist_device."time", dist_device.dist_device, dist_device.temp Data node: db_dist_hypertable_1 Chunks: _dist_hyper_15_37_chunk - Remote SQL: SELECT "time", dist_device, temp FROM public.dist_device WHERE _timescaledb_internal.chunks_in(public.dist_device.*, ARRAY[22]) ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", dist_device, temp FROM public.dist_device WHERE _timescaledb_functions.chunks_in(public.dist_device.*, ARRAY[22]) ORDER BY "time" ASC NULLS LAST Remote EXPLAIN: Index Scan Backward using _dist_hyper_15_37_chunk_dist_device_time_idx on _timescaledb_internal._dist_hyper_15_37_chunk Output: _dist_hyper_15_37_chunk."time", _dist_hyper_15_37_chunk.dist_device, _dist_hyper_15_37_chunk.temp @@ -3964,11 +3964,11 @@ ERROR: [db_dist_hypertable_1]: insert or update on table "_dist_hyper_17_45_chu \set ON_ERROR_STOP 1 -- Test alter replication factor with data SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper'); $$); NOTICE: [db_dist_hypertable_1]: - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper') NOTICE: [db_dist_hypertable_1]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -3980,7 +3980,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|sli NOTICE: [db_dist_hypertable_2]: - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper') NOTICE: [db_dist_hypertable_2]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -3991,7 +3991,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|sli NOTICE: [db_dist_hypertable_3]: - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper') NOTICE: [db_dist_hypertable_3]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -4033,11 +4033,11 @@ SELECT * FROM hypertable_partitions WHERE table_name = 'hyper'; INSERT INTO hyper VALUES ('2017-01-02 07:11', 1, 1.7); SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper'); $$); NOTICE: [db_dist_hypertable_1]: - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper') NOTICE: [db_dist_hypertable_1]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -4049,7 +4049,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|sli NOTICE: [db_dist_hypertable_2]: - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper') NOTICE: [db_dist_hypertable_2]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -4060,7 +4060,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|sli NOTICE: [db_dist_hypertable_3]: - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper') NOTICE: [db_dist_hypertable_3]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -4077,11 +4077,11 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|sli INSERT INTO hyper VALUES ('2017-02-01 06:01', 1, 5.1); SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper'); $$); NOTICE: [db_dist_hypertable_1]: - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper') NOTICE: [db_dist_hypertable_1]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -4094,7 +4094,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|sli NOTICE: [db_dist_hypertable_2]: - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper') NOTICE: [db_dist_hypertable_2]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -4106,7 +4106,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|sli NOTICE: [db_dist_hypertable_3]: - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper') NOTICE: [db_dist_hypertable_3]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -4139,11 +4139,11 @@ SELECT * FROM hypertable_partitions WHERE table_name = 'hyper'; INSERT INTO hyper VALUES ('2017-03-01 06:01', 1, 15.1); SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper'); $$); NOTICE: [db_dist_hypertable_1]: - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper') NOTICE: [db_dist_hypertable_1]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -4157,7 +4157,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|sli NOTICE: [db_dist_hypertable_2]: - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper') NOTICE: [db_dist_hypertable_2]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -4170,7 +4170,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|sli NOTICE: [db_dist_hypertable_3]: - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper') NOTICE: [db_dist_hypertable_3]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -4195,11 +4195,11 @@ WARNING: hypertable "hyper" is under-replicated INSERT INTO hyper VALUES ('2017-04-01 06:01', 2, 45.1); SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper'); $$); NOTICE: [db_dist_hypertable_1]: - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper') NOTICE: [db_dist_hypertable_1]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -4213,7 +4213,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|sli NOTICE: [db_dist_hypertable_2]: - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper') NOTICE: [db_dist_hypertable_2]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -4227,7 +4227,7 @@ chunk_id|hypertable_id|schema_name |table_name |relkind|sli NOTICE: [db_dist_hypertable_3]: - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper') NOTICE: [db_dist_hypertable_3]: chunk_id|hypertable_id|schema_name |table_name |relkind|slices @@ -4318,7 +4318,7 @@ SELECT relname, reloptions FROM pg_class WHERE relname = 'disttable_with_relopts -- Ensure reloptions are not set for distributed hypertable chunks on the AN SELECT relname, reloptions FROM pg_class WHERE relname IN -(SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) +(SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname; relname | reloptions -------------------------+------------ @@ -4327,7 +4327,7 @@ ORDER BY relname; (2 rows) SELECT relname, reloptions FROM pg_class WHERE relname IN -(SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_2')) +(SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_2')) ORDER BY relname; relname | reloptions -------------------------+------------ @@ -4445,12 +4445,12 @@ disttable_with_relopts_3_idx|{fillfactor=20} -- Make sure chunks derive parent reloptions SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname; $$); NOTICE: [db_dist_hypertable_1]: SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname NOTICE: [db_dist_hypertable_1]: relname |reloptions @@ -4461,7 +4461,7 @@ _dist_hyper_18_55_chunk|{fillfactor=10} NOTICE: [db_dist_hypertable_2]: SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname NOTICE: [db_dist_hypertable_2]: relname |reloptions @@ -4472,7 +4472,7 @@ _dist_hyper_18_56_chunk|{fillfactor=10} NOTICE: [db_dist_hypertable_3]: SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname NOTICE: [db_dist_hypertable_3]: relname|reloptions @@ -4487,12 +4487,12 @@ relname|reloptions SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_2')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_2')) ORDER BY relname; $$); NOTICE: [db_dist_hypertable_1]: SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_2')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_2')) ORDER BY relname NOTICE: [db_dist_hypertable_1]: relname|reloptions @@ -4502,7 +4502,7 @@ relname|reloptions NOTICE: [db_dist_hypertable_2]: SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_2')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_2')) ORDER BY relname NOTICE: [db_dist_hypertable_2]: relname |reloptions @@ -4513,7 +4513,7 @@ _dist_hyper_19_57_chunk|{fillfactor=10,parallel_workers=1} NOTICE: [db_dist_hypertable_3]: SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_2')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_2')) ORDER BY relname NOTICE: [db_dist_hypertable_3]: relname |reloptions @@ -4539,7 +4539,7 @@ SELECT relname, reloptions FROM pg_class WHERE relname = 'disttable_with_relopts -- Ensure chunks are not affected on the AN SELECT relname, reloptions FROM pg_class WHERE relname IN -(SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) +(SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname; relname | reloptions -------------------------+------------ @@ -4550,12 +4550,12 @@ ORDER BY relname; -- Ensure data node chunks has proper options set SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname; $$); NOTICE: [db_dist_hypertable_1]: SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname NOTICE: [db_dist_hypertable_1]: relname |reloptions @@ -4566,7 +4566,7 @@ _dist_hyper_18_55_chunk|{fillfactor=40} NOTICE: [db_dist_hypertable_2]: SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname NOTICE: [db_dist_hypertable_2]: relname |reloptions @@ -4577,7 +4577,7 @@ _dist_hyper_18_56_chunk|{fillfactor=40} NOTICE: [db_dist_hypertable_3]: SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname NOTICE: [db_dist_hypertable_3]: relname|reloptions @@ -4600,7 +4600,7 @@ SELECT relname, reloptions FROM pg_class WHERE relname = 'disttable_with_relopts -- Ensure chunks are not affected on the AN SELECT relname, reloptions FROM pg_class WHERE relname IN -(SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) +(SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname; relname | reloptions -------------------------+------------ @@ -4611,12 +4611,12 @@ ORDER BY relname; -- Ensure data node chunks has proper options set SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname; $$); NOTICE: [db_dist_hypertable_1]: SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname NOTICE: [db_dist_hypertable_1]: relname |reloptions @@ -4627,7 +4627,7 @@ _dist_hyper_18_55_chunk| NOTICE: [db_dist_hypertable_2]: SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname NOTICE: [db_dist_hypertable_2]: relname |reloptions @@ -4638,7 +4638,7 @@ _dist_hyper_18_56_chunk| NOTICE: [db_dist_hypertable_3]: SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname NOTICE: [db_dist_hypertable_3]: relname|reloptions @@ -5729,8 +5729,8 @@ SELECT * FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz::times EXPLAIN (verbose, costs off) SELECT * FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz::timestamp; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: test_tz."time", test_tz.v -> Append @@ -5738,7 +5738,7 @@ SELECT * FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz::times Output: test_tz_1."time", test_tz_1.v Data node: db_dist_hypertable_1 Chunks: _dist_hyper_31_97_chunk - Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_internal.chunks_in(public.test_tz.*, ARRAY[45]) AND (("time" > '2018-01-02 12:00:00'::timestamp without time zone)) + Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_functions.chunks_in(public.test_tz.*, ARRAY[45]) AND (("time" > '2018-01-02 12:00:00'::timestamp without time zone)) Remote EXPLAIN: Index Scan using _dist_hyper_31_97_chunk_test_tz_time_idx on _timescaledb_internal._dist_hyper_31_97_chunk Output: _dist_hyper_31_97_chunk."time", _dist_hyper_31_97_chunk.v @@ -5748,7 +5748,7 @@ SELECT * FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz::times Output: test_tz_2."time", test_tz_2.v Data node: db_dist_hypertable_2 Chunks: _dist_hyper_31_95_chunk, _dist_hyper_31_96_chunk, _dist_hyper_31_98_chunk - Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_internal.chunks_in(public.test_tz.*, ARRAY[43, 44, 45]) AND (("time" > '2018-01-02 12:00:00'::timestamp without time zone)) + Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_functions.chunks_in(public.test_tz.*, ARRAY[43, 44, 45]) AND (("time" > '2018-01-02 12:00:00'::timestamp without time zone)) Remote EXPLAIN: Append -> Index Scan using _dist_hyper_31_95_chunk_test_tz_time_idx on _timescaledb_internal._dist_hyper_31_95_chunk @@ -5769,8 +5769,8 @@ SELECT count(*) FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz EXPLAIN (verbose, costs off) SELECT count(*) FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz::timestamp; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Aggregate Output: count(*) -> Custom Scan (AsyncAppend) @@ -5778,7 +5778,7 @@ SELECT count(*) FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz -> Custom Scan (DataNodeScan) on public.test_tz test_tz_1 Data node: db_dist_hypertable_1 Chunks: _dist_hyper_31_97_chunk - Remote SQL: SELECT NULL FROM public.test_tz WHERE _timescaledb_internal.chunks_in(public.test_tz.*, ARRAY[45]) AND (("time" > '2018-01-02 12:00:00'::timestamp without time zone)) + Remote SQL: SELECT NULL FROM public.test_tz WHERE _timescaledb_functions.chunks_in(public.test_tz.*, ARRAY[45]) AND (("time" > '2018-01-02 12:00:00'::timestamp without time zone)) Remote EXPLAIN: Result Output: NULL::text @@ -5788,7 +5788,7 @@ SELECT count(*) FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz -> Custom Scan (DataNodeScan) on public.test_tz test_tz_2 Data node: db_dist_hypertable_2 Chunks: _dist_hyper_31_95_chunk, _dist_hyper_31_96_chunk, _dist_hyper_31_98_chunk - Remote SQL: SELECT NULL FROM public.test_tz WHERE _timescaledb_internal.chunks_in(public.test_tz.*, ARRAY[43, 44, 45]) AND (("time" > '2018-01-02 12:00:00'::timestamp without time zone)) + Remote SQL: SELECT NULL FROM public.test_tz WHERE _timescaledb_functions.chunks_in(public.test_tz.*, ARRAY[43, 44, 45]) AND (("time" > '2018-01-02 12:00:00'::timestamp without time zone)) Remote EXPLAIN: Result Output: NULL::text @@ -5819,8 +5819,8 @@ SELECT * FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz::times EXPLAIN (verbose, costs off) SELECT * FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz::timestamp; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: test_tz."time", test_tz.v -> Append @@ -5828,7 +5828,7 @@ SELECT * FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz::times Output: test_tz_1."time", test_tz_1.v Data node: db_dist_hypertable_1 Chunks: _dist_hyper_31_97_chunk - Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_internal.chunks_in(public.test_tz.*, ARRAY[45]) AND (("time" > '2018-01-02 11:00:00'::timestamp without time zone)) + Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_functions.chunks_in(public.test_tz.*, ARRAY[45]) AND (("time" > '2018-01-02 11:00:00'::timestamp without time zone)) Remote EXPLAIN: Index Scan using _dist_hyper_31_97_chunk_test_tz_time_idx on _timescaledb_internal._dist_hyper_31_97_chunk Output: _dist_hyper_31_97_chunk."time", _dist_hyper_31_97_chunk.v @@ -5838,7 +5838,7 @@ SELECT * FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz::times Output: test_tz_2."time", test_tz_2.v Data node: db_dist_hypertable_2 Chunks: _dist_hyper_31_95_chunk, _dist_hyper_31_96_chunk, _dist_hyper_31_98_chunk - Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_internal.chunks_in(public.test_tz.*, ARRAY[43, 44, 45]) AND (("time" > '2018-01-02 11:00:00'::timestamp without time zone)) + Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_functions.chunks_in(public.test_tz.*, ARRAY[43, 44, 45]) AND (("time" > '2018-01-02 11:00:00'::timestamp without time zone)) Remote EXPLAIN: Append -> Index Scan using _dist_hyper_31_95_chunk_test_tz_time_idx on _timescaledb_internal._dist_hyper_31_95_chunk @@ -5861,8 +5861,8 @@ SELECT count(*) FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz EXPLAIN (verbose, costs off) SELECT count(*) FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz::timestamp; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Aggregate Output: count(*) -> Custom Scan (AsyncAppend) @@ -5870,7 +5870,7 @@ SELECT count(*) FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz -> Custom Scan (DataNodeScan) on public.test_tz test_tz_1 Data node: db_dist_hypertable_1 Chunks: _dist_hyper_31_97_chunk - Remote SQL: SELECT NULL FROM public.test_tz WHERE _timescaledb_internal.chunks_in(public.test_tz.*, ARRAY[45]) AND (("time" > '2018-01-02 11:00:00'::timestamp without time zone)) + Remote SQL: SELECT NULL FROM public.test_tz WHERE _timescaledb_functions.chunks_in(public.test_tz.*, ARRAY[45]) AND (("time" > '2018-01-02 11:00:00'::timestamp without time zone)) Remote EXPLAIN: Result Output: NULL::text @@ -5880,7 +5880,7 @@ SELECT count(*) FROM test_tz WHERE time > '2018-01-02 12:00:00 +00'::timestamptz -> Custom Scan (DataNodeScan) on public.test_tz test_tz_2 Data node: db_dist_hypertable_2 Chunks: _dist_hyper_31_95_chunk, _dist_hyper_31_96_chunk, _dist_hyper_31_98_chunk - Remote SQL: SELECT NULL FROM public.test_tz WHERE _timescaledb_internal.chunks_in(public.test_tz.*, ARRAY[43, 44, 45]) AND (("time" > '2018-01-02 11:00:00'::timestamp without time zone)) + Remote SQL: SELECT NULL FROM public.test_tz WHERE _timescaledb_functions.chunks_in(public.test_tz.*, ARRAY[43, 44, 45]) AND (("time" > '2018-01-02 11:00:00'::timestamp without time zone)) Remote EXPLAIN: Result Output: NULL::text @@ -5917,8 +5917,8 @@ WHERE time > x + (x = x)::int -- stable * (x = '2018-01-02 11:00:00'::timestamp)::int -- immutable * INTERVAL '1 hour'; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: test_tz."time", test_tz.v, (('Tue Jan 02 11:00:00 2018 -01'::timestamp with time zone)::timestamp without time zone) -> Append @@ -5928,7 +5928,7 @@ WHERE time > x Output: test_tz_1."time", test_tz_1.v Data node: db_dist_hypertable_1 Chunks: _dist_hyper_31_97_chunk - Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_internal.chunks_in(public.test_tz.*, ARRAY[45]) AND (("time" > '2018-01-02 12:00:00'::timestamp without time zone)) + Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_functions.chunks_in(public.test_tz.*, ARRAY[45]) AND (("time" > '2018-01-02 12:00:00'::timestamp without time zone)) Remote EXPLAIN: Index Scan using _dist_hyper_31_97_chunk_test_tz_time_idx on _timescaledb_internal._dist_hyper_31_97_chunk Output: _dist_hyper_31_97_chunk."time", _dist_hyper_31_97_chunk.v @@ -5940,7 +5940,7 @@ WHERE time > x Output: test_tz_2."time", test_tz_2.v Data node: db_dist_hypertable_2 Chunks: _dist_hyper_31_95_chunk, _dist_hyper_31_96_chunk, _dist_hyper_31_98_chunk - Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_internal.chunks_in(public.test_tz.*, ARRAY[43, 44, 45]) AND (("time" > '2018-01-02 12:00:00'::timestamp without time zone)) + Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_functions.chunks_in(public.test_tz.*, ARRAY[43, 44, 45]) AND (("time" > '2018-01-02 12:00:00'::timestamp without time zone)) Remote EXPLAIN: Append -> Index Scan using _dist_hyper_31_95_chunk_test_tz_time_idx on _timescaledb_internal._dist_hyper_31_95_chunk @@ -5966,8 +5966,8 @@ EXPLAIN (COSTS OFF, VERBOSE) SELECT * FROM test_tz WHERE date_trunc('month', time) > date_in('2021-01-01') AND time::time > '00:00:00'::time + (INTERVAL '1 hour') * date_part('hour', INTERVAL '1 hour'); - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: test_tz."time", test_tz.v -> Append @@ -5975,7 +5975,7 @@ SELECT * FROM test_tz WHERE date_trunc('month', time) > date_in('2021-01-01') Output: test_tz_1."time", test_tz_1.v Data node: db_dist_hypertable_1 Chunks: _dist_hyper_31_97_chunk - Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_internal.chunks_in(public.test_tz.*, ARRAY[45]) AND (("time"::time without time zone > '01:00:00'::time without time zone)) AND ((date_trunc('month'::text, "time") > '2021-01-01'::date)) + Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_functions.chunks_in(public.test_tz.*, ARRAY[45]) AND (("time"::time without time zone > '01:00:00'::time without time zone)) AND ((date_trunc('month'::text, "time") > '2021-01-01'::date)) Remote EXPLAIN: Seq Scan on _timescaledb_internal._dist_hyper_31_97_chunk Output: _dist_hyper_31_97_chunk."time", _dist_hyper_31_97_chunk.v @@ -5985,7 +5985,7 @@ SELECT * FROM test_tz WHERE date_trunc('month', time) > date_in('2021-01-01') Output: test_tz_2."time", test_tz_2.v Data node: db_dist_hypertable_2 Chunks: _dist_hyper_31_95_chunk, _dist_hyper_31_96_chunk, _dist_hyper_31_98_chunk - Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_internal.chunks_in(public.test_tz.*, ARRAY[43, 44, 45]) AND (("time"::time without time zone > '01:00:00'::time without time zone)) AND ((date_trunc('month'::text, "time") > '2021-01-01'::date)) + Remote SQL: SELECT "time", v FROM public.test_tz WHERE _timescaledb_functions.chunks_in(public.test_tz.*, ARRAY[43, 44, 45]) AND (("time"::time without time zone > '01:00:00'::time without time zone)) AND ((date_trunc('month'::text, "time") > '2021-01-01'::date)) Remote EXPLAIN: Append -> Seq Scan on _timescaledb_internal._dist_hyper_31_95_chunk @@ -6200,7 +6200,7 @@ WHERE hypertable_name = 'pruned_chunks_1' ORDER BY chunk_name LIMIT 1 \gset \set ON_ERROR_STOP 0 -SELECT _timescaledb_internal.freeze_chunk( :'CHNAME'); +SELECT _timescaledb_functions.freeze_chunk( :'CHNAME'); ERROR: operation not supported on distributed chunk or foreign table "_dist_hyper_36_107_chunk" \set ON_ERROR_STOP 1 --TEST freeze_chunk api for regular hypertables. Works only for >= PG14 @@ -6213,7 +6213,7 @@ SELECT table_name FROM create_hypertable('freeze_1', 'time'); INSERT INTO freeze_1 VALUES ('2020-12-09',1,32.2); \set ON_ERROR_STOP 0 -SELECT _timescaledb_internal.freeze_chunk( ch) FROM ( select show_chunks('freeze_1') ch ) q; +SELECT _timescaledb_functions.freeze_chunk( ch) FROM ( select show_chunks('freeze_1') ch ) q; freeze_chunk -------------- t diff --git a/tsl/test/expected/dist_param.out b/tsl/test/expected/dist_param.out index c8aaaa3c5f7..1530a9b0c3d 100644 --- a/tsl/test/expected/dist_param.out +++ b/tsl/test/expected/dist_param.out @@ -83,8 +83,8 @@ where id in (select id from metric_name where name like 'cpu%') group by id order by id ; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate Output: metric_dist.id, max(metric_dist.value), count(*) Group Key: metric_dist.id @@ -101,7 +101,7 @@ order by id Output: metric_dist.id, metric_dist.value Data node: data_node_1 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_16_chunk, _dist_hyper_1_20_chunk, _dist_hyper_1_37_chunk, _dist_hyper_1_52_chunk - Remote SQL: SELECT id, value FROM public.metric_dist WHERE _timescaledb_internal.chunks_in(public.metric_dist.*, ARRAY[3, 16, 20, 37, 52]) AND ((ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((ts <= '2022-03-02 15:02:02-08'::timestamp with time zone)) AND (($1::integer = id)) + Remote SQL: SELECT id, value FROM public.metric_dist WHERE _timescaledb_functions.chunks_in(public.metric_dist.*, ARRAY[3, 16, 20, 37, 52]) AND ((ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((ts <= '2022-03-02 15:02:02-08'::timestamp with time zone)) AND (($1::integer = id)) (17 rows) -- Check that the GUC to disable these plans works. Our cost model is very @@ -129,8 +129,8 @@ where id in (select id from metric_name where name like 'cpu%') group by id order by id ; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ GroupAggregate Output: metric_dist.id, max(metric_dist.value), count(*) Group Key: metric_dist.id @@ -145,7 +145,7 @@ order by id Output: metric_dist.id, metric_dist.value Data node: data_node_1 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_16_chunk, _dist_hyper_1_20_chunk, _dist_hyper_1_37_chunk, _dist_hyper_1_52_chunk - Remote SQL: SELECT id, value FROM public.metric_dist WHERE _timescaledb_internal.chunks_in(public.metric_dist.*, ARRAY[3, 16, 20, 37, 52]) AND ((ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((ts <= '2022-03-02 15:02:02-08'::timestamp with time zone)) ORDER BY id ASC NULLS LAST + Remote SQL: SELECT id, value FROM public.metric_dist WHERE _timescaledb_functions.chunks_in(public.metric_dist.*, ARRAY[3, 16, 20, 37, 52]) AND ((ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((ts <= '2022-03-02 15:02:02-08'::timestamp with time zone)) ORDER BY id ASC NULLS LAST -> Hash Output: metric_name.id -> Index Scan using metric_name_name on public.metric_name @@ -245,8 +245,8 @@ where id in (select id from metric_name where name like 'cpu%') group by id order by id ; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate (actual rows=3 loops=1) Output: metric_dist.id, max(metric_dist.value), count(*) Group Key: metric_dist.id @@ -265,7 +265,7 @@ order by id Data node: data_node_1 Fetcher Type: Prepared statement Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_16_chunk, _dist_hyper_1_20_chunk, _dist_hyper_1_37_chunk, _dist_hyper_1_52_chunk - Remote SQL: SELECT id, value FROM public.metric_dist WHERE _timescaledb_internal.chunks_in(public.metric_dist.*, ARRAY[3, 16, 20, 37, 52]) AND ((ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((ts <= '2022-03-02 15:02:02-08'::timestamp with time zone)) AND (($1::integer = id)) + Remote SQL: SELECT id, value FROM public.metric_dist WHERE _timescaledb_functions.chunks_in(public.metric_dist.*, ARRAY[3, 16, 20, 37, 52]) AND ((ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((ts <= '2022-03-02 15:02:02-08'::timestamp with time zone)) AND (($1::integer = id)) (19 rows) -- Should reset the prepared cache mode after using the prepared statement fetcher. @@ -294,8 +294,8 @@ where name like 'cpu%' group by name order by name ; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate Output: metric_name.name, max(metric_dist.value), count(*) Group Key: metric_name.name @@ -309,7 +309,7 @@ order by name Output: metric_dist.value, metric_dist.id Data node: data_node_1 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_16_chunk, _dist_hyper_1_20_chunk, _dist_hyper_1_37_chunk, _dist_hyper_1_52_chunk - Remote SQL: SELECT id, value FROM public.metric_dist WHERE _timescaledb_internal.chunks_in(public.metric_dist.*, ARRAY[3, 16, 20, 37, 52]) AND ((ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((ts <= '2022-03-02 15:02:02-08'::timestamp with time zone)) AND (($1::integer = id)) + Remote SQL: SELECT id, value FROM public.metric_dist WHERE _timescaledb_functions.chunks_in(public.metric_dist.*, ARRAY[3, 16, 20, 37, 52]) AND ((ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((ts <= '2022-03-02 15:02:02-08'::timestamp with time zone)) AND (($1::integer = id)) (14 rows) -- Shipping still might make sense if the local table is outer. @@ -321,8 +321,8 @@ where name like 'cpu%' group by name order by name ; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate Output: metric_name.name, max(metric_dist.value), count(*) Group Key: metric_name.name @@ -336,7 +336,7 @@ order by name Output: metric_dist.value, metric_dist.id Data node: data_node_1 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_16_chunk, _dist_hyper_1_20_chunk, _dist_hyper_1_37_chunk, _dist_hyper_1_52_chunk - Remote SQL: SELECT id, value FROM public.metric_dist WHERE _timescaledb_internal.chunks_in(public.metric_dist.*, ARRAY[3, 16, 20, 37, 52]) AND ((ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((ts <= '2022-03-02 15:02:02-08'::timestamp with time zone)) AND (($1::integer = id)) + Remote SQL: SELECT id, value FROM public.metric_dist WHERE _timescaledb_functions.chunks_in(public.metric_dist.*, ARRAY[3, 16, 20, 37, 52]) AND ((ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((ts <= '2022-03-02 15:02:02-08'::timestamp with time zone)) AND (($1::integer = id)) (14 rows) -- Shipping doesn't make sense if the distributed table is outer. @@ -348,8 +348,8 @@ where ts between '2022-02-02 02:02:02+03' and '2022-03-03 02:02:02+03' group by name order by name ; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate Output: metric_name.name, max(metric_dist.value), count(*) Group Key: metric_name.name @@ -364,7 +364,7 @@ order by name Output: metric_dist.value, metric_dist.id Data node: data_node_1 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_16_chunk, _dist_hyper_1_20_chunk, _dist_hyper_1_37_chunk, _dist_hyper_1_52_chunk - Remote SQL: SELECT id, value FROM public.metric_dist WHERE _timescaledb_internal.chunks_in(public.metric_dist.*, ARRAY[3, 16, 20, 37, 52]) AND ((ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((ts <= '2022-03-02 15:02:02-08'::timestamp with time zone)) + Remote SQL: SELECT id, value FROM public.metric_dist WHERE _timescaledb_functions.chunks_in(public.metric_dist.*, ARRAY[3, 16, 20, 37, 52]) AND ((ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((ts <= '2022-03-02 15:02:02-08'::timestamp with time zone)) -> Hash Output: metric_name.name, metric_name.id -> Index Scan using metric_name_name on public.metric_name @@ -382,8 +382,8 @@ where metric_name.name like 'cpu%' group by name order by name ; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate Output: metric_name.name, max(metric_dist.value), count(*) Group Key: metric_name.name @@ -398,7 +398,7 @@ order by name Output: metric_dist.value, metric_dist.id Data node: data_node_1 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_16_chunk, _dist_hyper_1_20_chunk, _dist_hyper_1_37_chunk, _dist_hyper_1_52_chunk - Remote SQL: SELECT id, value FROM public.metric_dist WHERE _timescaledb_internal.chunks_in(public.metric_dist.*, ARRAY[3, 16, 20, 37, 52]) AND ((ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((ts <= '2022-03-02 15:02:02-08'::timestamp with time zone)) + Remote SQL: SELECT id, value FROM public.metric_dist WHERE _timescaledb_functions.chunks_in(public.metric_dist.*, ARRAY[3, 16, 20, 37, 52]) AND ((ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((ts <= '2022-03-02 15:02:02-08'::timestamp with time zone)) -> Hash Output: metric_name.name -> Index Only Scan using metric_name_name on public.metric_name @@ -435,8 +435,8 @@ where metric_name.name like 'cpu%' group by name order by name ; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate Output: metric_name.name, max(metric_dist.value), count(*) Group Key: metric_name.name @@ -450,7 +450,7 @@ order by name Output: metric_dist.value, metric_dist.id Data node: data_node_1 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_16_chunk, _dist_hyper_1_20_chunk, _dist_hyper_1_37_chunk, _dist_hyper_1_52_chunk - Remote SQL: SELECT id, value FROM public.metric_dist WHERE _timescaledb_internal.chunks_in(public.metric_dist.*, ARRAY[3, 16, 20, 37, 52]) AND ((ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((ts <= '2022-03-02 15:02:02-08'::timestamp with time zone)) AND (texteq(('cpu'::text || textin(int4out(id))), $1::text)) + Remote SQL: SELECT id, value FROM public.metric_dist WHERE _timescaledb_functions.chunks_in(public.metric_dist.*, ARRAY[3, 16, 20, 37, 52]) AND ((ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((ts <= '2022-03-02 15:02:02-08'::timestamp with time zone)) AND (texteq(('cpu'::text || textin(int4out(id))), $1::text)) (14 rows) -- Non-shippable non-EC join. @@ -463,8 +463,8 @@ where metric_name.name like 'cpu%' group by name order by name ; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate Output: metric_name.name, max(metric_dist.value), count(*) Group Key: metric_name.name @@ -479,7 +479,7 @@ order by name Output: metric_dist.value, metric_dist.id Data node: data_node_1 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_16_chunk, _dist_hyper_1_20_chunk, _dist_hyper_1_37_chunk, _dist_hyper_1_52_chunk - Remote SQL: SELECT id, value FROM public.metric_dist WHERE _timescaledb_internal.chunks_in(public.metric_dist.*, ARRAY[3, 16, 20, 37, 52]) AND ((ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((ts <= '2022-03-02 15:02:02-08'::timestamp with time zone)) + Remote SQL: SELECT id, value FROM public.metric_dist WHERE _timescaledb_functions.chunks_in(public.metric_dist.*, ARRAY[3, 16, 20, 37, 52]) AND ((ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((ts <= '2022-03-02 15:02:02-08'::timestamp with time zone)) (15 rows) -- distinct on, order by, limit 1, with subquery @@ -505,8 +505,8 @@ where id in (select id from metric_name where name like 'cpu%') order by id, ts, value limit 1 ; - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: metric_dist.id, metric_dist.ts, metric_dist.value -> Unique @@ -524,7 +524,7 @@ limit 1 Output: metric_dist.id, metric_dist.ts, metric_dist.value Data node: data_node_1 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_16_chunk, _dist_hyper_1_20_chunk, _dist_hyper_1_37_chunk, _dist_hyper_1_52_chunk - Remote SQL: SELECT ts, id, value FROM public.metric_dist WHERE _timescaledb_internal.chunks_in(public.metric_dist.*, ARRAY[3, 16, 20, 37, 52]) AND ((ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((ts <= '2022-03-02 15:02:02-08'::timestamp with time zone)) AND (($1::integer = id)) + Remote SQL: SELECT ts, id, value FROM public.metric_dist WHERE _timescaledb_functions.chunks_in(public.metric_dist.*, ARRAY[3, 16, 20, 37, 52]) AND ((ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((ts <= '2022-03-02 15:02:02-08'::timestamp with time zone)) AND (($1::integer = id)) (18 rows) -- distinct on, order by, limit 1, with explicit join @@ -550,8 +550,8 @@ where name like 'cpu%' order by name, ts, value limit 1 ; - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: metric_name.name, metric_dist.ts, metric_dist.value -> Unique @@ -569,7 +569,7 @@ limit 1 Output: metric_dist.ts, metric_dist.value, metric_dist.id Data node: data_node_1 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_16_chunk, _dist_hyper_1_20_chunk, _dist_hyper_1_37_chunk, _dist_hyper_1_52_chunk - Remote SQL: SELECT ts, id, value FROM public.metric_dist WHERE _timescaledb_internal.chunks_in(public.metric_dist.*, ARRAY[3, 16, 20, 37, 52]) AND ((ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((ts <= '2022-03-02 15:02:02-08'::timestamp with time zone)) AND (($1::integer = id)) + Remote SQL: SELECT ts, id, value FROM public.metric_dist WHERE _timescaledb_functions.chunks_in(public.metric_dist.*, ARRAY[3, 16, 20, 37, 52]) AND ((ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((ts <= '2022-03-02 15:02:02-08'::timestamp with time zone)) AND (($1::integer = id)) (18 rows) -- If there are a lot of rows chosen from the local table, the parameterized @@ -584,8 +584,8 @@ where ts between '2022-02-02 02:02:02+03' and '2022-03-03 02:02:02+03' group by name order by name ; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate Output: metric_name.name, max(metric_dist.value), count(*) Group Key: metric_name.name @@ -600,7 +600,7 @@ order by name Output: metric_dist.value, metric_dist.id Data node: data_node_1 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_16_chunk, _dist_hyper_1_20_chunk, _dist_hyper_1_37_chunk, _dist_hyper_1_52_chunk - Remote SQL: SELECT id, value FROM public.metric_dist WHERE _timescaledb_internal.chunks_in(public.metric_dist.*, ARRAY[3, 16, 20, 37, 52]) AND ((ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((ts <= '2022-03-02 15:02:02-08'::timestamp with time zone)) + Remote SQL: SELECT id, value FROM public.metric_dist WHERE _timescaledb_functions.chunks_in(public.metric_dist.*, ARRAY[3, 16, 20, 37, 52]) AND ((ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((ts <= '2022-03-02 15:02:02-08'::timestamp with time zone)) -> Hash Output: metric_name.name, metric_name.id -> Seq Scan on public.metric_name @@ -619,8 +619,8 @@ where id = any((select array_agg(id) from metric_name where name like 'cpu%')::i group by id order by id ; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate Output: metric_dist.id, max(metric_dist.value) Group Key: metric_dist.id @@ -635,7 +635,7 @@ order by id Output: metric_dist.id, metric_dist.value Data node: data_node_1 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_16_chunk, _dist_hyper_1_20_chunk, _dist_hyper_1_37_chunk, _dist_hyper_1_52_chunk - Remote SQL: SELECT id, value FROM public.metric_dist WHERE _timescaledb_internal.chunks_in(public.metric_dist.*, ARRAY[3, 16, 20, 37, 52]) AND ((ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((ts <= '2022-03-02 15:02:02-08'::timestamp with time zone)) AND ((id = ANY ($1::integer[]))) ORDER BY id ASC NULLS LAST + Remote SQL: SELECT id, value FROM public.metric_dist WHERE _timescaledb_functions.chunks_in(public.metric_dist.*, ARRAY[3, 16, 20, 37, 52]) AND ((ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((ts <= '2022-03-02 15:02:02-08'::timestamp with time zone)) AND ((id = ANY ($1::integer[]))) ORDER BY id ASC NULLS LAST (15 rows) -- Multiple joins. Test both EC and non-EC (texteq) join in one query. @@ -660,8 +660,8 @@ where name like 'cpu%' and texteq(location, 'Yerevan') and ts between '2022-02-02 02:02:02+03' and '2022-03-03 02:02:02+03' group by id ; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate Output: metric_dist.id, max(metric_dist.value) Group Key: metric_dist.id @@ -685,7 +685,7 @@ group by id Output: metric_dist.id, metric_dist.value Data node: data_node_1 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_16_chunk, _dist_hyper_1_20_chunk, _dist_hyper_1_37_chunk, _dist_hyper_1_52_chunk - Remote SQL: SELECT id, value FROM public.metric_dist WHERE _timescaledb_internal.chunks_in(public.metric_dist.*, ARRAY[3, 16, 20, 37, 52]) AND ((ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((ts <= '2022-03-02 15:02:02-08'::timestamp with time zone)) AND (($1::integer = id)) + Remote SQL: SELECT id, value FROM public.metric_dist WHERE _timescaledb_functions.chunks_in(public.metric_dist.*, ARRAY[3, 16, 20, 37, 52]) AND ((ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((ts <= '2022-03-02 15:02:02-08'::timestamp with time zone)) AND (($1::integer = id)) (24 rows) -- Multiple joins on different variables. Use a table instead of a CTE for saner @@ -718,7 +718,7 @@ order by 1 Output: metric_dist.id, metric_dist.value, metric_dist.ts Data node: data_node_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_16_chunk, _dist_hyper_1_17_chunk, _dist_hyper_1_18_chunk, _dist_hyper_1_19_chunk, _dist_hyper_1_20_chunk, _dist_hyper_1_21_chunk, _dist_hyper_1_22_chunk, _dist_hyper_1_23_chunk, _dist_hyper_1_24_chunk, _dist_hyper_1_25_chunk, _dist_hyper_1_26_chunk, _dist_hyper_1_27_chunk, _dist_hyper_1_28_chunk, _dist_hyper_1_29_chunk, _dist_hyper_1_30_chunk, _dist_hyper_1_31_chunk, _dist_hyper_1_32_chunk, _dist_hyper_1_33_chunk, _dist_hyper_1_34_chunk, _dist_hyper_1_35_chunk, _dist_hyper_1_36_chunk, _dist_hyper_1_37_chunk, _dist_hyper_1_38_chunk, _dist_hyper_1_39_chunk, _dist_hyper_1_40_chunk, _dist_hyper_1_41_chunk, _dist_hyper_1_42_chunk, _dist_hyper_1_43_chunk, _dist_hyper_1_44_chunk, _dist_hyper_1_45_chunk, _dist_hyper_1_46_chunk, _dist_hyper_1_47_chunk, _dist_hyper_1_48_chunk, _dist_hyper_1_49_chunk, _dist_hyper_1_50_chunk, _dist_hyper_1_51_chunk, _dist_hyper_1_52_chunk, _dist_hyper_1_53_chunk - Remote SQL: SELECT ts, id, value FROM public.metric_dist WHERE _timescaledb_internal.chunks_in(public.metric_dist.*, ARRAY[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53]) AND (($1::timestamp with time zone = ts)) AND (($2::integer = id)) + Remote SQL: SELECT ts, id, value FROM public.metric_dist WHERE _timescaledb_functions.chunks_in(public.metric_dist.*, ARRAY[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53]) AND (($1::timestamp with time zone = ts)) AND (($2::integer = id)) (15 rows) -- Two distributed hypertables, each joined to reference and all joined together. @@ -748,7 +748,7 @@ where m1.id in (select id from metric_name where name = 'cpu1') Data node: data_node_1 Fetcher Type: Cursor Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_16_chunk, _dist_hyper_1_17_chunk, _dist_hyper_1_18_chunk, _dist_hyper_1_19_chunk, _dist_hyper_1_20_chunk, _dist_hyper_1_21_chunk, _dist_hyper_1_22_chunk, _dist_hyper_1_23_chunk, _dist_hyper_1_24_chunk, _dist_hyper_1_25_chunk, _dist_hyper_1_26_chunk, _dist_hyper_1_27_chunk, _dist_hyper_1_28_chunk, _dist_hyper_1_29_chunk, _dist_hyper_1_30_chunk, _dist_hyper_1_31_chunk, _dist_hyper_1_32_chunk, _dist_hyper_1_33_chunk, _dist_hyper_1_34_chunk, _dist_hyper_1_35_chunk, _dist_hyper_1_36_chunk, _dist_hyper_1_37_chunk, _dist_hyper_1_38_chunk, _dist_hyper_1_39_chunk, _dist_hyper_1_40_chunk, _dist_hyper_1_41_chunk, _dist_hyper_1_42_chunk, _dist_hyper_1_43_chunk, _dist_hyper_1_44_chunk, _dist_hyper_1_45_chunk, _dist_hyper_1_46_chunk, _dist_hyper_1_47_chunk, _dist_hyper_1_48_chunk, _dist_hyper_1_49_chunk, _dist_hyper_1_50_chunk, _dist_hyper_1_51_chunk, _dist_hyper_1_52_chunk, _dist_hyper_1_53_chunk - Remote SQL: SELECT ts, id, value FROM public.metric_dist WHERE _timescaledb_internal.chunks_in(public.metric_dist.*, ARRAY[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53]) AND (($1::integer = id)) + Remote SQL: SELECT ts, id, value FROM public.metric_dist WHERE _timescaledb_functions.chunks_in(public.metric_dist.*, ARRAY[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53]) AND (($1::integer = id)) -> Hash (actual rows=50101 loops=1) Output: m2.value, m2.ts Buckets: 65536 (originally 1024) Batches: 1 (originally 1) @@ -762,7 +762,7 @@ where m1.id in (select id from metric_name where name = 'cpu1') Data node: data_node_1 Fetcher Type: Cursor Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_16_chunk, _dist_hyper_1_17_chunk, _dist_hyper_1_18_chunk, _dist_hyper_1_19_chunk, _dist_hyper_1_20_chunk, _dist_hyper_1_21_chunk, _dist_hyper_1_22_chunk, _dist_hyper_1_23_chunk, _dist_hyper_1_24_chunk, _dist_hyper_1_25_chunk, _dist_hyper_1_26_chunk, _dist_hyper_1_27_chunk, _dist_hyper_1_28_chunk, _dist_hyper_1_29_chunk, _dist_hyper_1_30_chunk, _dist_hyper_1_31_chunk, _dist_hyper_1_32_chunk, _dist_hyper_1_33_chunk, _dist_hyper_1_34_chunk, _dist_hyper_1_35_chunk, _dist_hyper_1_36_chunk, _dist_hyper_1_37_chunk, _dist_hyper_1_38_chunk, _dist_hyper_1_39_chunk, _dist_hyper_1_40_chunk, _dist_hyper_1_41_chunk, _dist_hyper_1_42_chunk, _dist_hyper_1_43_chunk, _dist_hyper_1_44_chunk, _dist_hyper_1_45_chunk, _dist_hyper_1_46_chunk, _dist_hyper_1_47_chunk, _dist_hyper_1_48_chunk, _dist_hyper_1_49_chunk, _dist_hyper_1_50_chunk, _dist_hyper_1_51_chunk, _dist_hyper_1_52_chunk, _dist_hyper_1_53_chunk - Remote SQL: SELECT ts, id, value FROM public.metric_dist WHERE _timescaledb_internal.chunks_in(public.metric_dist.*, ARRAY[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53]) AND (($1::integer = id)) + Remote SQL: SELECT ts, id, value FROM public.metric_dist WHERE _timescaledb_functions.chunks_in(public.metric_dist.*, ARRAY[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53]) AND (($1::integer = id)) (30 rows) -- Should prefer reference table join pushdown to all other kinds of plans, @@ -788,7 +788,7 @@ order by name Output: metric_dist.value, metric_name.name Data node: data_node_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_16_chunk, _dist_hyper_1_17_chunk, _dist_hyper_1_18_chunk, _dist_hyper_1_19_chunk, _dist_hyper_1_20_chunk, _dist_hyper_1_21_chunk, _dist_hyper_1_22_chunk, _dist_hyper_1_23_chunk, _dist_hyper_1_24_chunk, _dist_hyper_1_25_chunk, _dist_hyper_1_26_chunk, _dist_hyper_1_27_chunk, _dist_hyper_1_28_chunk, _dist_hyper_1_29_chunk, _dist_hyper_1_30_chunk, _dist_hyper_1_31_chunk, _dist_hyper_1_32_chunk, _dist_hyper_1_33_chunk, _dist_hyper_1_34_chunk, _dist_hyper_1_35_chunk, _dist_hyper_1_36_chunk, _dist_hyper_1_37_chunk, _dist_hyper_1_38_chunk, _dist_hyper_1_39_chunk, _dist_hyper_1_40_chunk, _dist_hyper_1_41_chunk, _dist_hyper_1_42_chunk, _dist_hyper_1_43_chunk, _dist_hyper_1_44_chunk, _dist_hyper_1_45_chunk, _dist_hyper_1_46_chunk, _dist_hyper_1_47_chunk, _dist_hyper_1_48_chunk, _dist_hyper_1_49_chunk, _dist_hyper_1_50_chunk, _dist_hyper_1_51_chunk, _dist_hyper_1_52_chunk, _dist_hyper_1_53_chunk - Remote SQL: SELECT r57.value, r2.name FROM (public.metric_dist r57 INNER JOIN public.metric_name r2 ON (((r57.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r57, ARRAY[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53]) ORDER BY r2.name ASC NULLS LAST + Remote SQL: SELECT r57.value, r2.name FROM (public.metric_dist r57 INNER JOIN public.metric_name r2 ON (((r57.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r57, ARRAY[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53]) ORDER BY r2.name ASC NULLS LAST (10 rows) set timescaledb.enable_parameterized_data_node_scan to false; @@ -810,6 +810,6 @@ order by name Output: metric_dist.value, metric_name.name Data node: data_node_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_16_chunk, _dist_hyper_1_17_chunk, _dist_hyper_1_18_chunk, _dist_hyper_1_19_chunk, _dist_hyper_1_20_chunk, _dist_hyper_1_21_chunk, _dist_hyper_1_22_chunk, _dist_hyper_1_23_chunk, _dist_hyper_1_24_chunk, _dist_hyper_1_25_chunk, _dist_hyper_1_26_chunk, _dist_hyper_1_27_chunk, _dist_hyper_1_28_chunk, _dist_hyper_1_29_chunk, _dist_hyper_1_30_chunk, _dist_hyper_1_31_chunk, _dist_hyper_1_32_chunk, _dist_hyper_1_33_chunk, _dist_hyper_1_34_chunk, _dist_hyper_1_35_chunk, _dist_hyper_1_36_chunk, _dist_hyper_1_37_chunk, _dist_hyper_1_38_chunk, _dist_hyper_1_39_chunk, _dist_hyper_1_40_chunk, _dist_hyper_1_41_chunk, _dist_hyper_1_42_chunk, _dist_hyper_1_43_chunk, _dist_hyper_1_44_chunk, _dist_hyper_1_45_chunk, _dist_hyper_1_46_chunk, _dist_hyper_1_47_chunk, _dist_hyper_1_48_chunk, _dist_hyper_1_49_chunk, _dist_hyper_1_50_chunk, _dist_hyper_1_51_chunk, _dist_hyper_1_52_chunk, _dist_hyper_1_53_chunk - Remote SQL: SELECT r57.value, r2.name FROM (public.metric_dist r57 INNER JOIN public.metric_name r2 ON (((r57.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r57, ARRAY[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53]) ORDER BY r2.name ASC NULLS LAST + Remote SQL: SELECT r57.value, r2.name FROM (public.metric_dist r57 INNER JOIN public.metric_name r2 ON (((r57.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r57, ARRAY[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53]) ORDER BY r2.name ASC NULLS LAST (10 rows) diff --git a/tsl/test/expected/dist_partial_agg-13.out b/tsl/test/expected/dist_partial_agg-13.out index 9b42eaf2d4b..fec6815dd3b 100644 --- a/tsl/test/expected/dist_partial_agg-13.out +++ b/tsl/test/expected/dist_partial_agg-13.out @@ -186,19 +186,19 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT location, min(allnull), max(temperature), (sum(temperature) + sum(humidity)), avg(humidity), round(stddev(humidity::integer), 5), bit_and(bit_int), bit_or(bit_int), bool_and(good_life), every((temperature > 0::double precision)), bool_or(good_life), count(*), count(temperature), count(allnull), round(corr(temperature::integer, humidity::integer)::numeric, 5), round(covar_pop(temperature::integer, humidity::integer)::numeric, 5), round(covar_samp(temperature::integer, humidity::integer)::numeric, 5), round(regr_avgx(temperature::integer, humidity::integer)::numeric, 5), round(regr_avgy(temperature::integer, humidity::integer)::numeric, 5), round(regr_count(temperature::integer, humidity::integer)::numeric, 5), round(regr_intercept(temperature::integer, humidity::integer)::numeric, 5), round(regr_r2(temperature::integer, humidity::integer)::numeric, 5), round(regr_slope(temperature::integer, humidity::integer)::numeric, 5), round(regr_sxx(temperature::integer, humidity::integer)::numeric, 5), round(regr_sxy(temperature::integer, humidity::integer)::numeric, 5), round(regr_syy(temperature::integer, humidity::integer)::numeric, 5), round(stddev(temperature::integer), 5), round(stddev_pop(temperature::integer), 5), round(stddev_samp(temperature::integer), 5), round(variance(temperature::integer), 5), round(var_pop(temperature::integer), 5), round(var_samp(temperature::integer), 5), public.last(temperature, timec), public.histogram(temperature, 0::double precision, 100::double precision, 1), timec FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 35 ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT location, min(allnull), max(temperature), (sum(temperature) + sum(humidity)), avg(humidity), round(stddev(humidity::integer), 5), bit_and(bit_int), bit_or(bit_int), bool_and(good_life), every((temperature > 0::double precision)), bool_or(good_life), count(*), count(temperature), count(allnull), round(corr(temperature::integer, humidity::integer)::numeric, 5), round(covar_pop(temperature::integer, humidity::integer)::numeric, 5), round(covar_samp(temperature::integer, humidity::integer)::numeric, 5), round(regr_avgx(temperature::integer, humidity::integer)::numeric, 5), round(regr_avgy(temperature::integer, humidity::integer)::numeric, 5), round(regr_count(temperature::integer, humidity::integer)::numeric, 5), round(regr_intercept(temperature::integer, humidity::integer)::numeric, 5), round(regr_r2(temperature::integer, humidity::integer)::numeric, 5), round(regr_slope(temperature::integer, humidity::integer)::numeric, 5), round(regr_sxx(temperature::integer, humidity::integer)::numeric, 5), round(regr_sxy(temperature::integer, humidity::integer)::numeric, 5), round(regr_syy(temperature::integer, humidity::integer)::numeric, 5), round(stddev(temperature::integer), 5), round(stddev_pop(temperature::integer), 5), round(stddev_samp(temperature::integer), 5), round(variance(temperature::integer), 5), round(var_pop(temperature::integer), 5), round(var_samp(temperature::integer), 5), public.last(temperature, timec), public.histogram(temperature, 0::double precision, 100::double precision, 1), timec FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 35 ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: conditions_1.location, (min(conditions_1.allnull)), (max(conditions_1.temperature)), ((sum(conditions_1.temperature) + sum(conditions_1.humidity))), (avg(conditions_1.humidity)), (round(stddev((conditions_1.humidity)::integer), 5)), (bit_and(conditions_1.bit_int)), (bit_or(conditions_1.bit_int)), (bool_and(conditions_1.good_life)), (every((conditions_1.temperature > '0'::double precision))), (bool_or(conditions_1.good_life)), (count(*)), (count(conditions_1.temperature)), (count(conditions_1.allnull)), (round((corr(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision))::numeric, 5)), (round((covar_pop(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision))::numeric, 5)), (round((covar_samp(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision))::numeric, 5)), (round((regr_avgx(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision))::numeric, 5)), (round((regr_avgy(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision))::numeric, 5)), (round((regr_count(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision))::numeric, 5)), (round((regr_intercept(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision))::numeric, 5)), (round((regr_r2(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision))::numeric, 5)), (round((regr_slope(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision))::numeric, 5)), (round((regr_sxx(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision))::numeric, 5)), (round((regr_sxy(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision))::numeric, 5)), (round((regr_syy(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision))::numeric, 5)), (round(stddev((conditions_1.temperature)::integer), 5)), (round(stddev_pop((conditions_1.temperature)::integer), 5)), (round(stddev_samp((conditions_1.temperature)::integer), 5)), (round(variance((conditions_1.temperature)::integer), 5)), (round(var_pop((conditions_1.temperature)::integer), 5)), (round(var_samp((conditions_1.temperature)::integer), 5)), (last(conditions_1.temperature, conditions_1.timec)), (histogram(conditions_1.temperature, '0'::double precision, '100'::double precision, 1)), conditions_1.timec Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_2 Chunks: _dist_hyper_1_9_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_12_chunk - Remote SQL: SELECT location, min(allnull), max(temperature), (sum(temperature) + sum(humidity)), avg(humidity), round(stddev(humidity::integer), 5), bit_and(bit_int), bit_or(bit_int), bool_and(good_life), every((temperature > 0::double precision)), bool_or(good_life), count(*), count(temperature), count(allnull), round(corr(temperature::integer, humidity::integer)::numeric, 5), round(covar_pop(temperature::integer, humidity::integer)::numeric, 5), round(covar_samp(temperature::integer, humidity::integer)::numeric, 5), round(regr_avgx(temperature::integer, humidity::integer)::numeric, 5), round(regr_avgy(temperature::integer, humidity::integer)::numeric, 5), round(regr_count(temperature::integer, humidity::integer)::numeric, 5), round(regr_intercept(temperature::integer, humidity::integer)::numeric, 5), round(regr_r2(temperature::integer, humidity::integer)::numeric, 5), round(regr_slope(temperature::integer, humidity::integer)::numeric, 5), round(regr_sxx(temperature::integer, humidity::integer)::numeric, 5), round(regr_sxy(temperature::integer, humidity::integer)::numeric, 5), round(regr_syy(temperature::integer, humidity::integer)::numeric, 5), round(stddev(temperature::integer), 5), round(stddev_pop(temperature::integer), 5), round(stddev_samp(temperature::integer), 5), round(variance(temperature::integer), 5), round(var_pop(temperature::integer), 5), round(var_samp(temperature::integer), 5), public.last(temperature, timec), public.histogram(temperature, 0::double precision, 100::double precision, 1), timec FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 35 ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT location, min(allnull), max(temperature), (sum(temperature) + sum(humidity)), avg(humidity), round(stddev(humidity::integer), 5), bit_and(bit_int), bit_or(bit_int), bool_and(good_life), every((temperature > 0::double precision)), bool_or(good_life), count(*), count(temperature), count(allnull), round(corr(temperature::integer, humidity::integer)::numeric, 5), round(covar_pop(temperature::integer, humidity::integer)::numeric, 5), round(covar_samp(temperature::integer, humidity::integer)::numeric, 5), round(regr_avgx(temperature::integer, humidity::integer)::numeric, 5), round(regr_avgy(temperature::integer, humidity::integer)::numeric, 5), round(regr_count(temperature::integer, humidity::integer)::numeric, 5), round(regr_intercept(temperature::integer, humidity::integer)::numeric, 5), round(regr_r2(temperature::integer, humidity::integer)::numeric, 5), round(regr_slope(temperature::integer, humidity::integer)::numeric, 5), round(regr_sxx(temperature::integer, humidity::integer)::numeric, 5), round(regr_sxy(temperature::integer, humidity::integer)::numeric, 5), round(regr_syy(temperature::integer, humidity::integer)::numeric, 5), round(stddev(temperature::integer), 5), round(stddev_pop(temperature::integer), 5), round(stddev_samp(temperature::integer), 5), round(variance(temperature::integer), 5), round(var_pop(temperature::integer), 5), round(var_samp(temperature::integer), 5), public.last(temperature, timec), public.histogram(temperature, 0::double precision, 100::double precision, 1), timec FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 35 ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: conditions_2.location, (min(conditions_2.allnull)), (max(conditions_2.temperature)), ((sum(conditions_2.temperature) + sum(conditions_2.humidity))), (avg(conditions_2.humidity)), (round(stddev((conditions_2.humidity)::integer), 5)), (bit_and(conditions_2.bit_int)), (bit_or(conditions_2.bit_int)), (bool_and(conditions_2.good_life)), (every((conditions_2.temperature > '0'::double precision))), (bool_or(conditions_2.good_life)), (count(*)), (count(conditions_2.temperature)), (count(conditions_2.allnull)), (round((corr(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision))::numeric, 5)), (round((covar_pop(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision))::numeric, 5)), (round((covar_samp(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision))::numeric, 5)), (round((regr_avgx(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision))::numeric, 5)), (round((regr_avgy(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision))::numeric, 5)), (round((regr_count(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision))::numeric, 5)), (round((regr_intercept(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision))::numeric, 5)), (round((regr_r2(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision))::numeric, 5)), (round((regr_slope(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision))::numeric, 5)), (round((regr_sxx(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision))::numeric, 5)), (round((regr_sxy(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision))::numeric, 5)), (round((regr_syy(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision))::numeric, 5)), (round(stddev((conditions_2.temperature)::integer), 5)), (round(stddev_pop((conditions_2.temperature)::integer), 5)), (round(stddev_samp((conditions_2.temperature)::integer), 5)), (round(variance((conditions_2.temperature)::integer), 5)), (round(var_pop((conditions_2.temperature)::integer), 5)), (round(var_samp((conditions_2.temperature)::integer), 5)), (last(conditions_2.temperature, conditions_2.timec)), (histogram(conditions_2.temperature, '0'::double precision, '100'::double precision, 1)), conditions_2.timec Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_3 Chunks: _dist_hyper_1_5_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_8_chunk - Remote SQL: SELECT location, min(allnull), max(temperature), (sum(temperature) + sum(humidity)), avg(humidity), round(stddev(humidity::integer), 5), bit_and(bit_int), bit_or(bit_int), bool_and(good_life), every((temperature > 0::double precision)), bool_or(good_life), count(*), count(temperature), count(allnull), round(corr(temperature::integer, humidity::integer)::numeric, 5), round(covar_pop(temperature::integer, humidity::integer)::numeric, 5), round(covar_samp(temperature::integer, humidity::integer)::numeric, 5), round(regr_avgx(temperature::integer, humidity::integer)::numeric, 5), round(regr_avgy(temperature::integer, humidity::integer)::numeric, 5), round(regr_count(temperature::integer, humidity::integer)::numeric, 5), round(regr_intercept(temperature::integer, humidity::integer)::numeric, 5), round(regr_r2(temperature::integer, humidity::integer)::numeric, 5), round(regr_slope(temperature::integer, humidity::integer)::numeric, 5), round(regr_sxx(temperature::integer, humidity::integer)::numeric, 5), round(regr_sxy(temperature::integer, humidity::integer)::numeric, 5), round(regr_syy(temperature::integer, humidity::integer)::numeric, 5), round(stddev(temperature::integer), 5), round(stddev_pop(temperature::integer), 5), round(stddev_samp(temperature::integer), 5), round(variance(temperature::integer), 5), round(var_pop(temperature::integer), 5), round(var_samp(temperature::integer), 5), public.last(temperature, timec), public.histogram(temperature, 0::double precision, 100::double precision, 1), timec FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 35 ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT location, min(allnull), max(temperature), (sum(temperature) + sum(humidity)), avg(humidity), round(stddev(humidity::integer), 5), bit_and(bit_int), bit_or(bit_int), bool_and(good_life), every((temperature > 0::double precision)), bool_or(good_life), count(*), count(temperature), count(allnull), round(corr(temperature::integer, humidity::integer)::numeric, 5), round(covar_pop(temperature::integer, humidity::integer)::numeric, 5), round(covar_samp(temperature::integer, humidity::integer)::numeric, 5), round(regr_avgx(temperature::integer, humidity::integer)::numeric, 5), round(regr_avgy(temperature::integer, humidity::integer)::numeric, 5), round(regr_count(temperature::integer, humidity::integer)::numeric, 5), round(regr_intercept(temperature::integer, humidity::integer)::numeric, 5), round(regr_r2(temperature::integer, humidity::integer)::numeric, 5), round(regr_slope(temperature::integer, humidity::integer)::numeric, 5), round(regr_sxx(temperature::integer, humidity::integer)::numeric, 5), round(regr_sxy(temperature::integer, humidity::integer)::numeric, 5), round(regr_syy(temperature::integer, humidity::integer)::numeric, 5), round(stddev(temperature::integer), 5), round(stddev_pop(temperature::integer), 5), round(stddev_samp(temperature::integer), 5), round(variance(temperature::integer), 5), round(var_pop(temperature::integer), 5), round(var_samp(temperature::integer), 5), public.last(temperature, timec), public.histogram(temperature, 0::double precision, 100::double precision, 1), timec FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 35 ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST (22 rows) -- Aggregates on custom types are not yet pushed down @@ -208,8 +208,8 @@ SET timescaledb.remote_data_fetcher = 'cursor'; FROM :TEST_TABLE GROUP BY :GROUPING, timec ORDER BY :GROUPING, timec; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Merge Append Sort Key: conditions.location, conditions.timec -> GroupAggregate @@ -219,7 +219,7 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Output: conditions.location, conditions.timec, conditions.highlow Data node: db_dist_partial_agg_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT timec, location, highlow FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT timec, location, highlow FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST -> GroupAggregate Output: conditions_1.location, last(conditions_1.highlow, conditions_1.timec), first(conditions_1.highlow, conditions_1.timec), conditions_1.timec Group Key: conditions_1.location, conditions_1.timec @@ -227,7 +227,7 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Output: conditions_1.location, conditions_1.timec, conditions_1.highlow Data node: db_dist_partial_agg_2 Chunks: _dist_hyper_1_9_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_12_chunk - Remote SQL: SELECT timec, location, highlow FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT timec, location, highlow FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST -> GroupAggregate Output: conditions_2.location, last(conditions_2.highlow, conditions_2.timec), first(conditions_2.highlow, conditions_2.timec), conditions_2.timec Group Key: conditions_2.location, conditions_2.timec @@ -235,7 +235,7 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Output: conditions_2.location, conditions_2.timec, conditions_2.highlow Data node: db_dist_partial_agg_3 Chunks: _dist_hyper_1_5_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_8_chunk - Remote SQL: SELECT timec, location, highlow FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT timec, location, highlow FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST (26 rows) -- Mix of aggregates that push down and those that don't @@ -265,7 +265,7 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Output: conditions.location, conditions.timec, conditions.allnull, conditions.temperature, conditions.humidity, conditions.bit_int, conditions.good_life, conditions.highlow Data node: db_dist_partial_agg_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT timec, location, temperature, humidity, allnull, highlow, bit_int, good_life FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT timec, location, temperature, humidity, allnull, highlow, bit_int, good_life FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST -> GroupAggregate Output: conditions_1.location, min(conditions_1.allnull), max(conditions_1.temperature), (sum(conditions_1.temperature) + sum(conditions_1.humidity)), avg(conditions_1.humidity), round(stddev((conditions_1.humidity)::integer), 5), bit_and(conditions_1.bit_int), bit_or(conditions_1.bit_int), bool_and(conditions_1.good_life), every((conditions_1.temperature > '0'::double precision)), bool_or(conditions_1.good_life), first(conditions_1.highlow, conditions_1.timec), conditions_1.timec Group Key: conditions_1.location, conditions_1.timec @@ -273,7 +273,7 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Output: conditions_1.location, conditions_1.timec, conditions_1.allnull, conditions_1.temperature, conditions_1.humidity, conditions_1.bit_int, conditions_1.good_life, conditions_1.highlow Data node: db_dist_partial_agg_2 Chunks: _dist_hyper_1_9_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_12_chunk - Remote SQL: SELECT timec, location, temperature, humidity, allnull, highlow, bit_int, good_life FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT timec, location, temperature, humidity, allnull, highlow, bit_int, good_life FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST -> GroupAggregate Output: conditions_2.location, min(conditions_2.allnull), max(conditions_2.temperature), (sum(conditions_2.temperature) + sum(conditions_2.humidity)), avg(conditions_2.humidity), round(stddev((conditions_2.humidity)::integer), 5), bit_and(conditions_2.bit_int), bit_or(conditions_2.bit_int), bool_and(conditions_2.good_life), every((conditions_2.temperature > '0'::double precision)), bool_or(conditions_2.good_life), first(conditions_2.highlow, conditions_2.timec), conditions_2.timec Group Key: conditions_2.location, conditions_2.timec @@ -281,7 +281,7 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Output: conditions_2.location, conditions_2.timec, conditions_2.allnull, conditions_2.temperature, conditions_2.humidity, conditions_2.bit_int, conditions_2.good_life, conditions_2.highlow Data node: db_dist_partial_agg_3 Chunks: _dist_hyper_1_5_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_8_chunk - Remote SQL: SELECT timec, location, temperature, humidity, allnull, highlow, bit_int, good_life FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT timec, location, temperature, humidity, allnull, highlow, bit_int, good_life FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST (26 rows) -- Aggregates nested in expressions and no top-level aggregate #3672 @@ -290,8 +290,8 @@ SET timescaledb.remote_data_fetcher = 'cursor'; FROM :TEST_TABLE GROUP BY :GROUPING, timec ORDER BY :GROUPING, timec; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: location, ((sum(temperature) + sum(humidity))), timec -> Merge Append @@ -301,19 +301,19 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT location, (sum(temperature) + sum(humidity)), timec FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 3 ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT location, (sum(temperature) + sum(humidity)), timec FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 3 ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: conditions_1.location, ((sum(conditions_1.temperature) + sum(conditions_1.humidity))), conditions_1.timec Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_2 Chunks: _dist_hyper_1_9_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_12_chunk - Remote SQL: SELECT location, (sum(temperature) + sum(humidity)), timec FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 3 ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT location, (sum(temperature) + sum(humidity)), timec FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 3 ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: conditions_2.location, ((sum(conditions_2.temperature) + sum(conditions_2.humidity))), conditions_2.timec Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_3 Chunks: _dist_hyper_1_5_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_8_chunk - Remote SQL: SELECT location, (sum(temperature) + sum(humidity)), timec FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 3 ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT location, (sum(temperature) + sum(humidity)), timec FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 3 ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST (22 rows) -- Aggregates with no aggregate reference in targetlist #3664 @@ -322,8 +322,8 @@ SET timescaledb.remote_data_fetcher = 'cursor'; GROUP BY :GROUPING, timec HAVING avg(temperature) > 20 ORDER BY :GROUPING, timec; - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: location, timec -> Merge Append @@ -333,19 +333,19 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT location, timec FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2 HAVING ((avg(temperature) > 20::double precision)) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT location, timec FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2 HAVING ((avg(temperature) > 20::double precision)) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: conditions_1.location, conditions_1.timec Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_2 Chunks: _dist_hyper_1_9_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_12_chunk - Remote SQL: SELECT location, timec FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2 HAVING ((avg(temperature) > 20::double precision)) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT location, timec FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2 HAVING ((avg(temperature) > 20::double precision)) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: conditions_2.location, conditions_2.timec Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_3 Chunks: _dist_hyper_1_5_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_8_chunk - Remote SQL: SELECT location, timec FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2 HAVING ((avg(temperature) > 20::double precision)) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT location, timec FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2 HAVING ((avg(temperature) > 20::double precision)) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST (22 rows) \set GROUPING 'region, temperature' @@ -406,19 +406,19 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(min(allnull)), _timescaledb_internal.partialize_agg(max(temperature)), _timescaledb_internal.partialize_agg(sum(temperature)), _timescaledb_internal.partialize_agg(sum(humidity)), _timescaledb_internal.partialize_agg(avg(humidity)), _timescaledb_internal.partialize_agg(stddev(humidity::integer)), _timescaledb_internal.partialize_agg(bit_and(bit_int)), _timescaledb_internal.partialize_agg(bit_or(bit_int)), _timescaledb_internal.partialize_agg(bool_and(good_life)), _timescaledb_internal.partialize_agg(every((temperature > 0::double precision))), _timescaledb_internal.partialize_agg(bool_or(good_life)), _timescaledb_internal.partialize_agg(count(*)), _timescaledb_internal.partialize_agg(count(temperature)), _timescaledb_internal.partialize_agg(count(allnull)), _timescaledb_internal.partialize_agg(corr(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(covar_pop(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(covar_samp(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_avgx(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_avgy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_count(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_intercept(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_r2(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_slope(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_sxx(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_sxy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_syy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(stddev(temperature::integer)), _timescaledb_internal.partialize_agg(stddev_pop(temperature::integer)), _timescaledb_internal.partialize_agg(stddev_samp(temperature::integer)), _timescaledb_internal.partialize_agg(variance(temperature::integer)), _timescaledb_internal.partialize_agg(var_pop(temperature::integer)), _timescaledb_internal.partialize_agg(var_samp(temperature::integer)), _timescaledb_internal.partialize_agg(public.last(temperature, timec)), _timescaledb_internal.partialize_agg(public.histogram(temperature, 0::double precision, 100::double precision, 1)) FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(min(allnull)), _timescaledb_internal.partialize_agg(max(temperature)), _timescaledb_internal.partialize_agg(sum(temperature)), _timescaledb_internal.partialize_agg(sum(humidity)), _timescaledb_internal.partialize_agg(avg(humidity)), _timescaledb_internal.partialize_agg(stddev(humidity::integer)), _timescaledb_internal.partialize_agg(bit_and(bit_int)), _timescaledb_internal.partialize_agg(bit_or(bit_int)), _timescaledb_internal.partialize_agg(bool_and(good_life)), _timescaledb_internal.partialize_agg(every((temperature > 0::double precision))), _timescaledb_internal.partialize_agg(bool_or(good_life)), _timescaledb_internal.partialize_agg(count(*)), _timescaledb_internal.partialize_agg(count(temperature)), _timescaledb_internal.partialize_agg(count(allnull)), _timescaledb_internal.partialize_agg(corr(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(covar_pop(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(covar_samp(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_avgx(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_avgy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_count(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_intercept(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_r2(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_slope(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_sxx(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_sxy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_syy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(stddev(temperature::integer)), _timescaledb_internal.partialize_agg(stddev_pop(temperature::integer)), _timescaledb_internal.partialize_agg(stddev_samp(temperature::integer)), _timescaledb_internal.partialize_agg(variance(temperature::integer)), _timescaledb_internal.partialize_agg(var_pop(temperature::integer)), _timescaledb_internal.partialize_agg(var_samp(temperature::integer)), _timescaledb_internal.partialize_agg(public.last(temperature, timec)), _timescaledb_internal.partialize_agg(public.histogram(temperature, 0::double precision, 100::double precision, 1)) FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: conditions_1.region, conditions_1.temperature, conditions_1.timec, (PARTIAL min(conditions_1.allnull)), (PARTIAL max(conditions_1.temperature)), (PARTIAL sum(conditions_1.temperature)), (PARTIAL sum(conditions_1.humidity)), (PARTIAL avg(conditions_1.humidity)), (PARTIAL stddev((conditions_1.humidity)::integer)), (PARTIAL bit_and(conditions_1.bit_int)), (PARTIAL bit_or(conditions_1.bit_int)), (PARTIAL bool_and(conditions_1.good_life)), (PARTIAL every((conditions_1.temperature > '0'::double precision))), (PARTIAL bool_or(conditions_1.good_life)), (PARTIAL count(*)), (PARTIAL count(conditions_1.temperature)), (PARTIAL count(conditions_1.allnull)), (PARTIAL corr(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision)), (PARTIAL covar_pop(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision)), (PARTIAL covar_samp(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision)), (PARTIAL regr_avgx(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision)), (PARTIAL regr_avgy(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision)), (PARTIAL regr_count(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision)), (PARTIAL regr_intercept(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision)), (PARTIAL regr_r2(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision)), (PARTIAL regr_slope(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision)), (PARTIAL regr_sxx(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision)), (PARTIAL regr_sxy(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision)), (PARTIAL regr_syy(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision)), (PARTIAL stddev((conditions_1.temperature)::integer)), (PARTIAL stddev_pop((conditions_1.temperature)::integer)), (PARTIAL stddev_samp((conditions_1.temperature)::integer)), (PARTIAL variance((conditions_1.temperature)::integer)), (PARTIAL var_pop((conditions_1.temperature)::integer)), (PARTIAL var_samp((conditions_1.temperature)::integer)), (PARTIAL last(conditions_1.temperature, conditions_1.timec)), (PARTIAL histogram(conditions_1.temperature, '0'::double precision, '100'::double precision, 1)) Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_2 Chunks: _dist_hyper_1_9_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_12_chunk - Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(min(allnull)), _timescaledb_internal.partialize_agg(max(temperature)), _timescaledb_internal.partialize_agg(sum(temperature)), _timescaledb_internal.partialize_agg(sum(humidity)), _timescaledb_internal.partialize_agg(avg(humidity)), _timescaledb_internal.partialize_agg(stddev(humidity::integer)), _timescaledb_internal.partialize_agg(bit_and(bit_int)), _timescaledb_internal.partialize_agg(bit_or(bit_int)), _timescaledb_internal.partialize_agg(bool_and(good_life)), _timescaledb_internal.partialize_agg(every((temperature > 0::double precision))), _timescaledb_internal.partialize_agg(bool_or(good_life)), _timescaledb_internal.partialize_agg(count(*)), _timescaledb_internal.partialize_agg(count(temperature)), _timescaledb_internal.partialize_agg(count(allnull)), _timescaledb_internal.partialize_agg(corr(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(covar_pop(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(covar_samp(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_avgx(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_avgy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_count(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_intercept(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_r2(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_slope(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_sxx(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_sxy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_syy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(stddev(temperature::integer)), _timescaledb_internal.partialize_agg(stddev_pop(temperature::integer)), _timescaledb_internal.partialize_agg(stddev_samp(temperature::integer)), _timescaledb_internal.partialize_agg(variance(temperature::integer)), _timescaledb_internal.partialize_agg(var_pop(temperature::integer)), _timescaledb_internal.partialize_agg(var_samp(temperature::integer)), _timescaledb_internal.partialize_agg(public.last(temperature, timec)), _timescaledb_internal.partialize_agg(public.histogram(temperature, 0::double precision, 100::double precision, 1)) FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(min(allnull)), _timescaledb_internal.partialize_agg(max(temperature)), _timescaledb_internal.partialize_agg(sum(temperature)), _timescaledb_internal.partialize_agg(sum(humidity)), _timescaledb_internal.partialize_agg(avg(humidity)), _timescaledb_internal.partialize_agg(stddev(humidity::integer)), _timescaledb_internal.partialize_agg(bit_and(bit_int)), _timescaledb_internal.partialize_agg(bit_or(bit_int)), _timescaledb_internal.partialize_agg(bool_and(good_life)), _timescaledb_internal.partialize_agg(every((temperature > 0::double precision))), _timescaledb_internal.partialize_agg(bool_or(good_life)), _timescaledb_internal.partialize_agg(count(*)), _timescaledb_internal.partialize_agg(count(temperature)), _timescaledb_internal.partialize_agg(count(allnull)), _timescaledb_internal.partialize_agg(corr(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(covar_pop(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(covar_samp(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_avgx(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_avgy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_count(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_intercept(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_r2(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_slope(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_sxx(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_sxy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_syy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(stddev(temperature::integer)), _timescaledb_internal.partialize_agg(stddev_pop(temperature::integer)), _timescaledb_internal.partialize_agg(stddev_samp(temperature::integer)), _timescaledb_internal.partialize_agg(variance(temperature::integer)), _timescaledb_internal.partialize_agg(var_pop(temperature::integer)), _timescaledb_internal.partialize_agg(var_samp(temperature::integer)), _timescaledb_internal.partialize_agg(public.last(temperature, timec)), _timescaledb_internal.partialize_agg(public.histogram(temperature, 0::double precision, 100::double precision, 1)) FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: conditions_2.region, conditions_2.temperature, conditions_2.timec, (PARTIAL min(conditions_2.allnull)), (PARTIAL max(conditions_2.temperature)), (PARTIAL sum(conditions_2.temperature)), (PARTIAL sum(conditions_2.humidity)), (PARTIAL avg(conditions_2.humidity)), (PARTIAL stddev((conditions_2.humidity)::integer)), (PARTIAL bit_and(conditions_2.bit_int)), (PARTIAL bit_or(conditions_2.bit_int)), (PARTIAL bool_and(conditions_2.good_life)), (PARTIAL every((conditions_2.temperature > '0'::double precision))), (PARTIAL bool_or(conditions_2.good_life)), (PARTIAL count(*)), (PARTIAL count(conditions_2.temperature)), (PARTIAL count(conditions_2.allnull)), (PARTIAL corr(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision)), (PARTIAL covar_pop(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision)), (PARTIAL covar_samp(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision)), (PARTIAL regr_avgx(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision)), (PARTIAL regr_avgy(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision)), (PARTIAL regr_count(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision)), (PARTIAL regr_intercept(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision)), (PARTIAL regr_r2(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision)), (PARTIAL regr_slope(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision)), (PARTIAL regr_sxx(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision)), (PARTIAL regr_sxy(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision)), (PARTIAL regr_syy(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision)), (PARTIAL stddev((conditions_2.temperature)::integer)), (PARTIAL stddev_pop((conditions_2.temperature)::integer)), (PARTIAL stddev_samp((conditions_2.temperature)::integer)), (PARTIAL variance((conditions_2.temperature)::integer)), (PARTIAL var_pop((conditions_2.temperature)::integer)), (PARTIAL var_samp((conditions_2.temperature)::integer)), (PARTIAL last(conditions_2.temperature, conditions_2.timec)), (PARTIAL histogram(conditions_2.temperature, '0'::double precision, '100'::double precision, 1)) Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_3 Chunks: _dist_hyper_1_5_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_8_chunk - Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(min(allnull)), _timescaledb_internal.partialize_agg(max(temperature)), _timescaledb_internal.partialize_agg(sum(temperature)), _timescaledb_internal.partialize_agg(sum(humidity)), _timescaledb_internal.partialize_agg(avg(humidity)), _timescaledb_internal.partialize_agg(stddev(humidity::integer)), _timescaledb_internal.partialize_agg(bit_and(bit_int)), _timescaledb_internal.partialize_agg(bit_or(bit_int)), _timescaledb_internal.partialize_agg(bool_and(good_life)), _timescaledb_internal.partialize_agg(every((temperature > 0::double precision))), _timescaledb_internal.partialize_agg(bool_or(good_life)), _timescaledb_internal.partialize_agg(count(*)), _timescaledb_internal.partialize_agg(count(temperature)), _timescaledb_internal.partialize_agg(count(allnull)), _timescaledb_internal.partialize_agg(corr(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(covar_pop(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(covar_samp(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_avgx(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_avgy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_count(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_intercept(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_r2(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_slope(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_sxx(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_sxy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_syy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(stddev(temperature::integer)), _timescaledb_internal.partialize_agg(stddev_pop(temperature::integer)), _timescaledb_internal.partialize_agg(stddev_samp(temperature::integer)), _timescaledb_internal.partialize_agg(variance(temperature::integer)), _timescaledb_internal.partialize_agg(var_pop(temperature::integer)), _timescaledb_internal.partialize_agg(var_samp(temperature::integer)), _timescaledb_internal.partialize_agg(public.last(temperature, timec)), _timescaledb_internal.partialize_agg(public.histogram(temperature, 0::double precision, 100::double precision, 1)) FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(min(allnull)), _timescaledb_internal.partialize_agg(max(temperature)), _timescaledb_internal.partialize_agg(sum(temperature)), _timescaledb_internal.partialize_agg(sum(humidity)), _timescaledb_internal.partialize_agg(avg(humidity)), _timescaledb_internal.partialize_agg(stddev(humidity::integer)), _timescaledb_internal.partialize_agg(bit_and(bit_int)), _timescaledb_internal.partialize_agg(bit_or(bit_int)), _timescaledb_internal.partialize_agg(bool_and(good_life)), _timescaledb_internal.partialize_agg(every((temperature > 0::double precision))), _timescaledb_internal.partialize_agg(bool_or(good_life)), _timescaledb_internal.partialize_agg(count(*)), _timescaledb_internal.partialize_agg(count(temperature)), _timescaledb_internal.partialize_agg(count(allnull)), _timescaledb_internal.partialize_agg(corr(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(covar_pop(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(covar_samp(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_avgx(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_avgy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_count(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_intercept(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_r2(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_slope(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_sxx(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_sxy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_syy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(stddev(temperature::integer)), _timescaledb_internal.partialize_agg(stddev_pop(temperature::integer)), _timescaledb_internal.partialize_agg(stddev_samp(temperature::integer)), _timescaledb_internal.partialize_agg(variance(temperature::integer)), _timescaledb_internal.partialize_agg(var_pop(temperature::integer)), _timescaledb_internal.partialize_agg(var_samp(temperature::integer)), _timescaledb_internal.partialize_agg(public.last(temperature, timec)), _timescaledb_internal.partialize_agg(public.histogram(temperature, 0::double precision, 100::double precision, 1)) FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST (25 rows) -- Aggregates on custom types are not yet pushed down @@ -428,8 +428,8 @@ SET timescaledb.remote_data_fetcher = 'cursor'; FROM :TEST_TABLE GROUP BY :GROUPING, timec ORDER BY :GROUPING, timec; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: conditions.region, conditions.temperature, last(conditions.highlow, conditions.timec), first(conditions.highlow, conditions.timec), conditions.timec Group Key: conditions.region, conditions.temperature, conditions.timec @@ -442,7 +442,7 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Output: conditions.region, conditions.temperature, conditions.timec, conditions.highlow Data node: db_dist_partial_agg_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT timec, region, temperature, highlow FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT timec, region, temperature, highlow FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST -> Partial GroupAggregate Output: conditions_1.region, conditions_1.temperature, conditions_1.timec, PARTIAL last(conditions_1.highlow, conditions_1.timec), PARTIAL first(conditions_1.highlow, conditions_1.timec) Group Key: conditions_1.region, conditions_1.temperature, conditions_1.timec @@ -450,7 +450,7 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Output: conditions_1.region, conditions_1.temperature, conditions_1.timec, conditions_1.highlow Data node: db_dist_partial_agg_2 Chunks: _dist_hyper_1_9_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_12_chunk - Remote SQL: SELECT timec, region, temperature, highlow FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT timec, region, temperature, highlow FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST -> Partial GroupAggregate Output: conditions_2.region, conditions_2.temperature, conditions_2.timec, PARTIAL last(conditions_2.highlow, conditions_2.timec), PARTIAL first(conditions_2.highlow, conditions_2.timec) Group Key: conditions_2.region, conditions_2.temperature, conditions_2.timec @@ -458,7 +458,7 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Output: conditions_2.region, conditions_2.temperature, conditions_2.timec, conditions_2.highlow Data node: db_dist_partial_agg_3 Chunks: _dist_hyper_1_5_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_8_chunk - Remote SQL: SELECT timec, region, temperature, highlow FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT timec, region, temperature, highlow FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST (29 rows) -- Mix of aggregates that push down and those that don't @@ -491,7 +491,7 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Output: conditions.region, conditions.temperature, conditions.timec, conditions.allnull, conditions.humidity, conditions.bit_int, conditions.good_life, conditions.highlow Data node: db_dist_partial_agg_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT timec, region, temperature, humidity, allnull, highlow, bit_int, good_life FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT timec, region, temperature, humidity, allnull, highlow, bit_int, good_life FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST -> Partial GroupAggregate Output: conditions_1.region, conditions_1.temperature, conditions_1.timec, PARTIAL min(conditions_1.allnull), PARTIAL max(conditions_1.temperature), PARTIAL sum(conditions_1.temperature), PARTIAL sum(conditions_1.humidity), PARTIAL avg(conditions_1.humidity), PARTIAL stddev((conditions_1.humidity)::integer), PARTIAL bit_and(conditions_1.bit_int), PARTIAL bit_or(conditions_1.bit_int), PARTIAL bool_and(conditions_1.good_life), PARTIAL every((conditions_1.temperature > '0'::double precision)), PARTIAL bool_or(conditions_1.good_life), PARTIAL first(conditions_1.highlow, conditions_1.timec) Group Key: conditions_1.region, conditions_1.temperature, conditions_1.timec @@ -499,7 +499,7 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Output: conditions_1.region, conditions_1.temperature, conditions_1.timec, conditions_1.allnull, conditions_1.humidity, conditions_1.bit_int, conditions_1.good_life, conditions_1.highlow Data node: db_dist_partial_agg_2 Chunks: _dist_hyper_1_9_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_12_chunk - Remote SQL: SELECT timec, region, temperature, humidity, allnull, highlow, bit_int, good_life FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT timec, region, temperature, humidity, allnull, highlow, bit_int, good_life FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST -> Partial GroupAggregate Output: conditions_2.region, conditions_2.temperature, conditions_2.timec, PARTIAL min(conditions_2.allnull), PARTIAL max(conditions_2.temperature), PARTIAL sum(conditions_2.temperature), PARTIAL sum(conditions_2.humidity), PARTIAL avg(conditions_2.humidity), PARTIAL stddev((conditions_2.humidity)::integer), PARTIAL bit_and(conditions_2.bit_int), PARTIAL bit_or(conditions_2.bit_int), PARTIAL bool_and(conditions_2.good_life), PARTIAL every((conditions_2.temperature > '0'::double precision)), PARTIAL bool_or(conditions_2.good_life), PARTIAL first(conditions_2.highlow, conditions_2.timec) Group Key: conditions_2.region, conditions_2.temperature, conditions_2.timec @@ -507,7 +507,7 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Output: conditions_2.region, conditions_2.temperature, conditions_2.timec, conditions_2.allnull, conditions_2.humidity, conditions_2.bit_int, conditions_2.good_life, conditions_2.highlow Data node: db_dist_partial_agg_3 Chunks: _dist_hyper_1_5_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_8_chunk - Remote SQL: SELECT timec, region, temperature, humidity, allnull, highlow, bit_int, good_life FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT timec, region, temperature, humidity, allnull, highlow, bit_int, good_life FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST (29 rows) -- Aggregates nested in expressions and no top-level aggregate #3672 @@ -516,8 +516,8 @@ SET timescaledb.remote_data_fetcher = 'cursor'; FROM :TEST_TABLE GROUP BY :GROUPING, timec ORDER BY :GROUPING, timec; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: region, temperature, (sum(temperature) + sum(humidity)), timec Group Key: region, temperature, timec @@ -530,19 +530,19 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(sum(temperature)), _timescaledb_internal.partialize_agg(sum(humidity)) FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(sum(temperature)), _timescaledb_internal.partialize_agg(sum(humidity)) FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: conditions_1.region, conditions_1.temperature, conditions_1.timec, (PARTIAL sum(conditions_1.temperature)), (PARTIAL sum(conditions_1.humidity)) Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_2 Chunks: _dist_hyper_1_9_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_12_chunk - Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(sum(temperature)), _timescaledb_internal.partialize_agg(sum(humidity)) FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(sum(temperature)), _timescaledb_internal.partialize_agg(sum(humidity)) FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: conditions_2.region, conditions_2.temperature, conditions_2.timec, (PARTIAL sum(conditions_2.temperature)), (PARTIAL sum(conditions_2.humidity)) Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_3 Chunks: _dist_hyper_1_5_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_8_chunk - Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(sum(temperature)), _timescaledb_internal.partialize_agg(sum(humidity)) FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(sum(temperature)), _timescaledb_internal.partialize_agg(sum(humidity)) FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST (25 rows) -- Aggregates with no aggregate reference in targetlist #3664 @@ -551,8 +551,8 @@ SET timescaledb.remote_data_fetcher = 'cursor'; GROUP BY :GROUPING, timec HAVING avg(temperature) > 20 ORDER BY :GROUPING, timec; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: region, temperature, timec Group Key: region, temperature, timec @@ -566,19 +566,19 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(avg(temperature)) FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(avg(temperature)) FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: conditions_1.region, conditions_1.temperature, conditions_1.timec, (PARTIAL avg(conditions_1.temperature)) Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_2 Chunks: _dist_hyper_1_9_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_12_chunk - Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(avg(temperature)) FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(avg(temperature)) FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: conditions_2.region, conditions_2.temperature, conditions_2.timec, (PARTIAL avg(conditions_2.temperature)) Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_3 Chunks: _dist_hyper_1_5_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_8_chunk - Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(avg(temperature)) FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(avg(temperature)) FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST (26 rows) -- Full aggregate pushdown correctness check, compare location grouped query results with partionwise aggregates on and off diff --git a/tsl/test/expected/dist_partial_agg-14.out b/tsl/test/expected/dist_partial_agg-14.out index 9b42eaf2d4b..fec6815dd3b 100644 --- a/tsl/test/expected/dist_partial_agg-14.out +++ b/tsl/test/expected/dist_partial_agg-14.out @@ -186,19 +186,19 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT location, min(allnull), max(temperature), (sum(temperature) + sum(humidity)), avg(humidity), round(stddev(humidity::integer), 5), bit_and(bit_int), bit_or(bit_int), bool_and(good_life), every((temperature > 0::double precision)), bool_or(good_life), count(*), count(temperature), count(allnull), round(corr(temperature::integer, humidity::integer)::numeric, 5), round(covar_pop(temperature::integer, humidity::integer)::numeric, 5), round(covar_samp(temperature::integer, humidity::integer)::numeric, 5), round(regr_avgx(temperature::integer, humidity::integer)::numeric, 5), round(regr_avgy(temperature::integer, humidity::integer)::numeric, 5), round(regr_count(temperature::integer, humidity::integer)::numeric, 5), round(regr_intercept(temperature::integer, humidity::integer)::numeric, 5), round(regr_r2(temperature::integer, humidity::integer)::numeric, 5), round(regr_slope(temperature::integer, humidity::integer)::numeric, 5), round(regr_sxx(temperature::integer, humidity::integer)::numeric, 5), round(regr_sxy(temperature::integer, humidity::integer)::numeric, 5), round(regr_syy(temperature::integer, humidity::integer)::numeric, 5), round(stddev(temperature::integer), 5), round(stddev_pop(temperature::integer), 5), round(stddev_samp(temperature::integer), 5), round(variance(temperature::integer), 5), round(var_pop(temperature::integer), 5), round(var_samp(temperature::integer), 5), public.last(temperature, timec), public.histogram(temperature, 0::double precision, 100::double precision, 1), timec FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 35 ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT location, min(allnull), max(temperature), (sum(temperature) + sum(humidity)), avg(humidity), round(stddev(humidity::integer), 5), bit_and(bit_int), bit_or(bit_int), bool_and(good_life), every((temperature > 0::double precision)), bool_or(good_life), count(*), count(temperature), count(allnull), round(corr(temperature::integer, humidity::integer)::numeric, 5), round(covar_pop(temperature::integer, humidity::integer)::numeric, 5), round(covar_samp(temperature::integer, humidity::integer)::numeric, 5), round(regr_avgx(temperature::integer, humidity::integer)::numeric, 5), round(regr_avgy(temperature::integer, humidity::integer)::numeric, 5), round(regr_count(temperature::integer, humidity::integer)::numeric, 5), round(regr_intercept(temperature::integer, humidity::integer)::numeric, 5), round(regr_r2(temperature::integer, humidity::integer)::numeric, 5), round(regr_slope(temperature::integer, humidity::integer)::numeric, 5), round(regr_sxx(temperature::integer, humidity::integer)::numeric, 5), round(regr_sxy(temperature::integer, humidity::integer)::numeric, 5), round(regr_syy(temperature::integer, humidity::integer)::numeric, 5), round(stddev(temperature::integer), 5), round(stddev_pop(temperature::integer), 5), round(stddev_samp(temperature::integer), 5), round(variance(temperature::integer), 5), round(var_pop(temperature::integer), 5), round(var_samp(temperature::integer), 5), public.last(temperature, timec), public.histogram(temperature, 0::double precision, 100::double precision, 1), timec FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 35 ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: conditions_1.location, (min(conditions_1.allnull)), (max(conditions_1.temperature)), ((sum(conditions_1.temperature) + sum(conditions_1.humidity))), (avg(conditions_1.humidity)), (round(stddev((conditions_1.humidity)::integer), 5)), (bit_and(conditions_1.bit_int)), (bit_or(conditions_1.bit_int)), (bool_and(conditions_1.good_life)), (every((conditions_1.temperature > '0'::double precision))), (bool_or(conditions_1.good_life)), (count(*)), (count(conditions_1.temperature)), (count(conditions_1.allnull)), (round((corr(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision))::numeric, 5)), (round((covar_pop(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision))::numeric, 5)), (round((covar_samp(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision))::numeric, 5)), (round((regr_avgx(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision))::numeric, 5)), (round((regr_avgy(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision))::numeric, 5)), (round((regr_count(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision))::numeric, 5)), (round((regr_intercept(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision))::numeric, 5)), (round((regr_r2(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision))::numeric, 5)), (round((regr_slope(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision))::numeric, 5)), (round((regr_sxx(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision))::numeric, 5)), (round((regr_sxy(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision))::numeric, 5)), (round((regr_syy(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision))::numeric, 5)), (round(stddev((conditions_1.temperature)::integer), 5)), (round(stddev_pop((conditions_1.temperature)::integer), 5)), (round(stddev_samp((conditions_1.temperature)::integer), 5)), (round(variance((conditions_1.temperature)::integer), 5)), (round(var_pop((conditions_1.temperature)::integer), 5)), (round(var_samp((conditions_1.temperature)::integer), 5)), (last(conditions_1.temperature, conditions_1.timec)), (histogram(conditions_1.temperature, '0'::double precision, '100'::double precision, 1)), conditions_1.timec Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_2 Chunks: _dist_hyper_1_9_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_12_chunk - Remote SQL: SELECT location, min(allnull), max(temperature), (sum(temperature) + sum(humidity)), avg(humidity), round(stddev(humidity::integer), 5), bit_and(bit_int), bit_or(bit_int), bool_and(good_life), every((temperature > 0::double precision)), bool_or(good_life), count(*), count(temperature), count(allnull), round(corr(temperature::integer, humidity::integer)::numeric, 5), round(covar_pop(temperature::integer, humidity::integer)::numeric, 5), round(covar_samp(temperature::integer, humidity::integer)::numeric, 5), round(regr_avgx(temperature::integer, humidity::integer)::numeric, 5), round(regr_avgy(temperature::integer, humidity::integer)::numeric, 5), round(regr_count(temperature::integer, humidity::integer)::numeric, 5), round(regr_intercept(temperature::integer, humidity::integer)::numeric, 5), round(regr_r2(temperature::integer, humidity::integer)::numeric, 5), round(regr_slope(temperature::integer, humidity::integer)::numeric, 5), round(regr_sxx(temperature::integer, humidity::integer)::numeric, 5), round(regr_sxy(temperature::integer, humidity::integer)::numeric, 5), round(regr_syy(temperature::integer, humidity::integer)::numeric, 5), round(stddev(temperature::integer), 5), round(stddev_pop(temperature::integer), 5), round(stddev_samp(temperature::integer), 5), round(variance(temperature::integer), 5), round(var_pop(temperature::integer), 5), round(var_samp(temperature::integer), 5), public.last(temperature, timec), public.histogram(temperature, 0::double precision, 100::double precision, 1), timec FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 35 ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT location, min(allnull), max(temperature), (sum(temperature) + sum(humidity)), avg(humidity), round(stddev(humidity::integer), 5), bit_and(bit_int), bit_or(bit_int), bool_and(good_life), every((temperature > 0::double precision)), bool_or(good_life), count(*), count(temperature), count(allnull), round(corr(temperature::integer, humidity::integer)::numeric, 5), round(covar_pop(temperature::integer, humidity::integer)::numeric, 5), round(covar_samp(temperature::integer, humidity::integer)::numeric, 5), round(regr_avgx(temperature::integer, humidity::integer)::numeric, 5), round(regr_avgy(temperature::integer, humidity::integer)::numeric, 5), round(regr_count(temperature::integer, humidity::integer)::numeric, 5), round(regr_intercept(temperature::integer, humidity::integer)::numeric, 5), round(regr_r2(temperature::integer, humidity::integer)::numeric, 5), round(regr_slope(temperature::integer, humidity::integer)::numeric, 5), round(regr_sxx(temperature::integer, humidity::integer)::numeric, 5), round(regr_sxy(temperature::integer, humidity::integer)::numeric, 5), round(regr_syy(temperature::integer, humidity::integer)::numeric, 5), round(stddev(temperature::integer), 5), round(stddev_pop(temperature::integer), 5), round(stddev_samp(temperature::integer), 5), round(variance(temperature::integer), 5), round(var_pop(temperature::integer), 5), round(var_samp(temperature::integer), 5), public.last(temperature, timec), public.histogram(temperature, 0::double precision, 100::double precision, 1), timec FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 35 ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: conditions_2.location, (min(conditions_2.allnull)), (max(conditions_2.temperature)), ((sum(conditions_2.temperature) + sum(conditions_2.humidity))), (avg(conditions_2.humidity)), (round(stddev((conditions_2.humidity)::integer), 5)), (bit_and(conditions_2.bit_int)), (bit_or(conditions_2.bit_int)), (bool_and(conditions_2.good_life)), (every((conditions_2.temperature > '0'::double precision))), (bool_or(conditions_2.good_life)), (count(*)), (count(conditions_2.temperature)), (count(conditions_2.allnull)), (round((corr(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision))::numeric, 5)), (round((covar_pop(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision))::numeric, 5)), (round((covar_samp(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision))::numeric, 5)), (round((regr_avgx(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision))::numeric, 5)), (round((regr_avgy(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision))::numeric, 5)), (round((regr_count(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision))::numeric, 5)), (round((regr_intercept(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision))::numeric, 5)), (round((regr_r2(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision))::numeric, 5)), (round((regr_slope(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision))::numeric, 5)), (round((regr_sxx(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision))::numeric, 5)), (round((regr_sxy(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision))::numeric, 5)), (round((regr_syy(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision))::numeric, 5)), (round(stddev((conditions_2.temperature)::integer), 5)), (round(stddev_pop((conditions_2.temperature)::integer), 5)), (round(stddev_samp((conditions_2.temperature)::integer), 5)), (round(variance((conditions_2.temperature)::integer), 5)), (round(var_pop((conditions_2.temperature)::integer), 5)), (round(var_samp((conditions_2.temperature)::integer), 5)), (last(conditions_2.temperature, conditions_2.timec)), (histogram(conditions_2.temperature, '0'::double precision, '100'::double precision, 1)), conditions_2.timec Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_3 Chunks: _dist_hyper_1_5_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_8_chunk - Remote SQL: SELECT location, min(allnull), max(temperature), (sum(temperature) + sum(humidity)), avg(humidity), round(stddev(humidity::integer), 5), bit_and(bit_int), bit_or(bit_int), bool_and(good_life), every((temperature > 0::double precision)), bool_or(good_life), count(*), count(temperature), count(allnull), round(corr(temperature::integer, humidity::integer)::numeric, 5), round(covar_pop(temperature::integer, humidity::integer)::numeric, 5), round(covar_samp(temperature::integer, humidity::integer)::numeric, 5), round(regr_avgx(temperature::integer, humidity::integer)::numeric, 5), round(regr_avgy(temperature::integer, humidity::integer)::numeric, 5), round(regr_count(temperature::integer, humidity::integer)::numeric, 5), round(regr_intercept(temperature::integer, humidity::integer)::numeric, 5), round(regr_r2(temperature::integer, humidity::integer)::numeric, 5), round(regr_slope(temperature::integer, humidity::integer)::numeric, 5), round(regr_sxx(temperature::integer, humidity::integer)::numeric, 5), round(regr_sxy(temperature::integer, humidity::integer)::numeric, 5), round(regr_syy(temperature::integer, humidity::integer)::numeric, 5), round(stddev(temperature::integer), 5), round(stddev_pop(temperature::integer), 5), round(stddev_samp(temperature::integer), 5), round(variance(temperature::integer), 5), round(var_pop(temperature::integer), 5), round(var_samp(temperature::integer), 5), public.last(temperature, timec), public.histogram(temperature, 0::double precision, 100::double precision, 1), timec FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 35 ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT location, min(allnull), max(temperature), (sum(temperature) + sum(humidity)), avg(humidity), round(stddev(humidity::integer), 5), bit_and(bit_int), bit_or(bit_int), bool_and(good_life), every((temperature > 0::double precision)), bool_or(good_life), count(*), count(temperature), count(allnull), round(corr(temperature::integer, humidity::integer)::numeric, 5), round(covar_pop(temperature::integer, humidity::integer)::numeric, 5), round(covar_samp(temperature::integer, humidity::integer)::numeric, 5), round(regr_avgx(temperature::integer, humidity::integer)::numeric, 5), round(regr_avgy(temperature::integer, humidity::integer)::numeric, 5), round(regr_count(temperature::integer, humidity::integer)::numeric, 5), round(regr_intercept(temperature::integer, humidity::integer)::numeric, 5), round(regr_r2(temperature::integer, humidity::integer)::numeric, 5), round(regr_slope(temperature::integer, humidity::integer)::numeric, 5), round(regr_sxx(temperature::integer, humidity::integer)::numeric, 5), round(regr_sxy(temperature::integer, humidity::integer)::numeric, 5), round(regr_syy(temperature::integer, humidity::integer)::numeric, 5), round(stddev(temperature::integer), 5), round(stddev_pop(temperature::integer), 5), round(stddev_samp(temperature::integer), 5), round(variance(temperature::integer), 5), round(var_pop(temperature::integer), 5), round(var_samp(temperature::integer), 5), public.last(temperature, timec), public.histogram(temperature, 0::double precision, 100::double precision, 1), timec FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 35 ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST (22 rows) -- Aggregates on custom types are not yet pushed down @@ -208,8 +208,8 @@ SET timescaledb.remote_data_fetcher = 'cursor'; FROM :TEST_TABLE GROUP BY :GROUPING, timec ORDER BY :GROUPING, timec; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Merge Append Sort Key: conditions.location, conditions.timec -> GroupAggregate @@ -219,7 +219,7 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Output: conditions.location, conditions.timec, conditions.highlow Data node: db_dist_partial_agg_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT timec, location, highlow FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT timec, location, highlow FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST -> GroupAggregate Output: conditions_1.location, last(conditions_1.highlow, conditions_1.timec), first(conditions_1.highlow, conditions_1.timec), conditions_1.timec Group Key: conditions_1.location, conditions_1.timec @@ -227,7 +227,7 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Output: conditions_1.location, conditions_1.timec, conditions_1.highlow Data node: db_dist_partial_agg_2 Chunks: _dist_hyper_1_9_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_12_chunk - Remote SQL: SELECT timec, location, highlow FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT timec, location, highlow FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST -> GroupAggregate Output: conditions_2.location, last(conditions_2.highlow, conditions_2.timec), first(conditions_2.highlow, conditions_2.timec), conditions_2.timec Group Key: conditions_2.location, conditions_2.timec @@ -235,7 +235,7 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Output: conditions_2.location, conditions_2.timec, conditions_2.highlow Data node: db_dist_partial_agg_3 Chunks: _dist_hyper_1_5_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_8_chunk - Remote SQL: SELECT timec, location, highlow FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT timec, location, highlow FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST (26 rows) -- Mix of aggregates that push down and those that don't @@ -265,7 +265,7 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Output: conditions.location, conditions.timec, conditions.allnull, conditions.temperature, conditions.humidity, conditions.bit_int, conditions.good_life, conditions.highlow Data node: db_dist_partial_agg_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT timec, location, temperature, humidity, allnull, highlow, bit_int, good_life FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT timec, location, temperature, humidity, allnull, highlow, bit_int, good_life FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST -> GroupAggregate Output: conditions_1.location, min(conditions_1.allnull), max(conditions_1.temperature), (sum(conditions_1.temperature) + sum(conditions_1.humidity)), avg(conditions_1.humidity), round(stddev((conditions_1.humidity)::integer), 5), bit_and(conditions_1.bit_int), bit_or(conditions_1.bit_int), bool_and(conditions_1.good_life), every((conditions_1.temperature > '0'::double precision)), bool_or(conditions_1.good_life), first(conditions_1.highlow, conditions_1.timec), conditions_1.timec Group Key: conditions_1.location, conditions_1.timec @@ -273,7 +273,7 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Output: conditions_1.location, conditions_1.timec, conditions_1.allnull, conditions_1.temperature, conditions_1.humidity, conditions_1.bit_int, conditions_1.good_life, conditions_1.highlow Data node: db_dist_partial_agg_2 Chunks: _dist_hyper_1_9_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_12_chunk - Remote SQL: SELECT timec, location, temperature, humidity, allnull, highlow, bit_int, good_life FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT timec, location, temperature, humidity, allnull, highlow, bit_int, good_life FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST -> GroupAggregate Output: conditions_2.location, min(conditions_2.allnull), max(conditions_2.temperature), (sum(conditions_2.temperature) + sum(conditions_2.humidity)), avg(conditions_2.humidity), round(stddev((conditions_2.humidity)::integer), 5), bit_and(conditions_2.bit_int), bit_or(conditions_2.bit_int), bool_and(conditions_2.good_life), every((conditions_2.temperature > '0'::double precision)), bool_or(conditions_2.good_life), first(conditions_2.highlow, conditions_2.timec), conditions_2.timec Group Key: conditions_2.location, conditions_2.timec @@ -281,7 +281,7 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Output: conditions_2.location, conditions_2.timec, conditions_2.allnull, conditions_2.temperature, conditions_2.humidity, conditions_2.bit_int, conditions_2.good_life, conditions_2.highlow Data node: db_dist_partial_agg_3 Chunks: _dist_hyper_1_5_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_8_chunk - Remote SQL: SELECT timec, location, temperature, humidity, allnull, highlow, bit_int, good_life FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT timec, location, temperature, humidity, allnull, highlow, bit_int, good_life FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST (26 rows) -- Aggregates nested in expressions and no top-level aggregate #3672 @@ -290,8 +290,8 @@ SET timescaledb.remote_data_fetcher = 'cursor'; FROM :TEST_TABLE GROUP BY :GROUPING, timec ORDER BY :GROUPING, timec; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: location, ((sum(temperature) + sum(humidity))), timec -> Merge Append @@ -301,19 +301,19 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT location, (sum(temperature) + sum(humidity)), timec FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 3 ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT location, (sum(temperature) + sum(humidity)), timec FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 3 ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: conditions_1.location, ((sum(conditions_1.temperature) + sum(conditions_1.humidity))), conditions_1.timec Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_2 Chunks: _dist_hyper_1_9_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_12_chunk - Remote SQL: SELECT location, (sum(temperature) + sum(humidity)), timec FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 3 ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT location, (sum(temperature) + sum(humidity)), timec FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 3 ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: conditions_2.location, ((sum(conditions_2.temperature) + sum(conditions_2.humidity))), conditions_2.timec Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_3 Chunks: _dist_hyper_1_5_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_8_chunk - Remote SQL: SELECT location, (sum(temperature) + sum(humidity)), timec FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 3 ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT location, (sum(temperature) + sum(humidity)), timec FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 3 ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST (22 rows) -- Aggregates with no aggregate reference in targetlist #3664 @@ -322,8 +322,8 @@ SET timescaledb.remote_data_fetcher = 'cursor'; GROUP BY :GROUPING, timec HAVING avg(temperature) > 20 ORDER BY :GROUPING, timec; - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: location, timec -> Merge Append @@ -333,19 +333,19 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT location, timec FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2 HAVING ((avg(temperature) > 20::double precision)) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT location, timec FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2 HAVING ((avg(temperature) > 20::double precision)) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: conditions_1.location, conditions_1.timec Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_2 Chunks: _dist_hyper_1_9_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_12_chunk - Remote SQL: SELECT location, timec FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2 HAVING ((avg(temperature) > 20::double precision)) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT location, timec FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2 HAVING ((avg(temperature) > 20::double precision)) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: conditions_2.location, conditions_2.timec Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_3 Chunks: _dist_hyper_1_5_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_8_chunk - Remote SQL: SELECT location, timec FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2 HAVING ((avg(temperature) > 20::double precision)) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT location, timec FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2 HAVING ((avg(temperature) > 20::double precision)) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST (22 rows) \set GROUPING 'region, temperature' @@ -406,19 +406,19 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(min(allnull)), _timescaledb_internal.partialize_agg(max(temperature)), _timescaledb_internal.partialize_agg(sum(temperature)), _timescaledb_internal.partialize_agg(sum(humidity)), _timescaledb_internal.partialize_agg(avg(humidity)), _timescaledb_internal.partialize_agg(stddev(humidity::integer)), _timescaledb_internal.partialize_agg(bit_and(bit_int)), _timescaledb_internal.partialize_agg(bit_or(bit_int)), _timescaledb_internal.partialize_agg(bool_and(good_life)), _timescaledb_internal.partialize_agg(every((temperature > 0::double precision))), _timescaledb_internal.partialize_agg(bool_or(good_life)), _timescaledb_internal.partialize_agg(count(*)), _timescaledb_internal.partialize_agg(count(temperature)), _timescaledb_internal.partialize_agg(count(allnull)), _timescaledb_internal.partialize_agg(corr(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(covar_pop(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(covar_samp(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_avgx(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_avgy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_count(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_intercept(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_r2(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_slope(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_sxx(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_sxy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_syy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(stddev(temperature::integer)), _timescaledb_internal.partialize_agg(stddev_pop(temperature::integer)), _timescaledb_internal.partialize_agg(stddev_samp(temperature::integer)), _timescaledb_internal.partialize_agg(variance(temperature::integer)), _timescaledb_internal.partialize_agg(var_pop(temperature::integer)), _timescaledb_internal.partialize_agg(var_samp(temperature::integer)), _timescaledb_internal.partialize_agg(public.last(temperature, timec)), _timescaledb_internal.partialize_agg(public.histogram(temperature, 0::double precision, 100::double precision, 1)) FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(min(allnull)), _timescaledb_internal.partialize_agg(max(temperature)), _timescaledb_internal.partialize_agg(sum(temperature)), _timescaledb_internal.partialize_agg(sum(humidity)), _timescaledb_internal.partialize_agg(avg(humidity)), _timescaledb_internal.partialize_agg(stddev(humidity::integer)), _timescaledb_internal.partialize_agg(bit_and(bit_int)), _timescaledb_internal.partialize_agg(bit_or(bit_int)), _timescaledb_internal.partialize_agg(bool_and(good_life)), _timescaledb_internal.partialize_agg(every((temperature > 0::double precision))), _timescaledb_internal.partialize_agg(bool_or(good_life)), _timescaledb_internal.partialize_agg(count(*)), _timescaledb_internal.partialize_agg(count(temperature)), _timescaledb_internal.partialize_agg(count(allnull)), _timescaledb_internal.partialize_agg(corr(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(covar_pop(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(covar_samp(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_avgx(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_avgy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_count(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_intercept(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_r2(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_slope(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_sxx(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_sxy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_syy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(stddev(temperature::integer)), _timescaledb_internal.partialize_agg(stddev_pop(temperature::integer)), _timescaledb_internal.partialize_agg(stddev_samp(temperature::integer)), _timescaledb_internal.partialize_agg(variance(temperature::integer)), _timescaledb_internal.partialize_agg(var_pop(temperature::integer)), _timescaledb_internal.partialize_agg(var_samp(temperature::integer)), _timescaledb_internal.partialize_agg(public.last(temperature, timec)), _timescaledb_internal.partialize_agg(public.histogram(temperature, 0::double precision, 100::double precision, 1)) FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: conditions_1.region, conditions_1.temperature, conditions_1.timec, (PARTIAL min(conditions_1.allnull)), (PARTIAL max(conditions_1.temperature)), (PARTIAL sum(conditions_1.temperature)), (PARTIAL sum(conditions_1.humidity)), (PARTIAL avg(conditions_1.humidity)), (PARTIAL stddev((conditions_1.humidity)::integer)), (PARTIAL bit_and(conditions_1.bit_int)), (PARTIAL bit_or(conditions_1.bit_int)), (PARTIAL bool_and(conditions_1.good_life)), (PARTIAL every((conditions_1.temperature > '0'::double precision))), (PARTIAL bool_or(conditions_1.good_life)), (PARTIAL count(*)), (PARTIAL count(conditions_1.temperature)), (PARTIAL count(conditions_1.allnull)), (PARTIAL corr(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision)), (PARTIAL covar_pop(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision)), (PARTIAL covar_samp(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision)), (PARTIAL regr_avgx(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision)), (PARTIAL regr_avgy(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision)), (PARTIAL regr_count(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision)), (PARTIAL regr_intercept(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision)), (PARTIAL regr_r2(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision)), (PARTIAL regr_slope(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision)), (PARTIAL regr_sxx(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision)), (PARTIAL regr_sxy(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision)), (PARTIAL regr_syy(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision)), (PARTIAL stddev((conditions_1.temperature)::integer)), (PARTIAL stddev_pop((conditions_1.temperature)::integer)), (PARTIAL stddev_samp((conditions_1.temperature)::integer)), (PARTIAL variance((conditions_1.temperature)::integer)), (PARTIAL var_pop((conditions_1.temperature)::integer)), (PARTIAL var_samp((conditions_1.temperature)::integer)), (PARTIAL last(conditions_1.temperature, conditions_1.timec)), (PARTIAL histogram(conditions_1.temperature, '0'::double precision, '100'::double precision, 1)) Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_2 Chunks: _dist_hyper_1_9_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_12_chunk - Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(min(allnull)), _timescaledb_internal.partialize_agg(max(temperature)), _timescaledb_internal.partialize_agg(sum(temperature)), _timescaledb_internal.partialize_agg(sum(humidity)), _timescaledb_internal.partialize_agg(avg(humidity)), _timescaledb_internal.partialize_agg(stddev(humidity::integer)), _timescaledb_internal.partialize_agg(bit_and(bit_int)), _timescaledb_internal.partialize_agg(bit_or(bit_int)), _timescaledb_internal.partialize_agg(bool_and(good_life)), _timescaledb_internal.partialize_agg(every((temperature > 0::double precision))), _timescaledb_internal.partialize_agg(bool_or(good_life)), _timescaledb_internal.partialize_agg(count(*)), _timescaledb_internal.partialize_agg(count(temperature)), _timescaledb_internal.partialize_agg(count(allnull)), _timescaledb_internal.partialize_agg(corr(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(covar_pop(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(covar_samp(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_avgx(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_avgy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_count(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_intercept(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_r2(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_slope(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_sxx(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_sxy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_syy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(stddev(temperature::integer)), _timescaledb_internal.partialize_agg(stddev_pop(temperature::integer)), _timescaledb_internal.partialize_agg(stddev_samp(temperature::integer)), _timescaledb_internal.partialize_agg(variance(temperature::integer)), _timescaledb_internal.partialize_agg(var_pop(temperature::integer)), _timescaledb_internal.partialize_agg(var_samp(temperature::integer)), _timescaledb_internal.partialize_agg(public.last(temperature, timec)), _timescaledb_internal.partialize_agg(public.histogram(temperature, 0::double precision, 100::double precision, 1)) FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(min(allnull)), _timescaledb_internal.partialize_agg(max(temperature)), _timescaledb_internal.partialize_agg(sum(temperature)), _timescaledb_internal.partialize_agg(sum(humidity)), _timescaledb_internal.partialize_agg(avg(humidity)), _timescaledb_internal.partialize_agg(stddev(humidity::integer)), _timescaledb_internal.partialize_agg(bit_and(bit_int)), _timescaledb_internal.partialize_agg(bit_or(bit_int)), _timescaledb_internal.partialize_agg(bool_and(good_life)), _timescaledb_internal.partialize_agg(every((temperature > 0::double precision))), _timescaledb_internal.partialize_agg(bool_or(good_life)), _timescaledb_internal.partialize_agg(count(*)), _timescaledb_internal.partialize_agg(count(temperature)), _timescaledb_internal.partialize_agg(count(allnull)), _timescaledb_internal.partialize_agg(corr(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(covar_pop(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(covar_samp(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_avgx(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_avgy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_count(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_intercept(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_r2(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_slope(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_sxx(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_sxy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_syy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(stddev(temperature::integer)), _timescaledb_internal.partialize_agg(stddev_pop(temperature::integer)), _timescaledb_internal.partialize_agg(stddev_samp(temperature::integer)), _timescaledb_internal.partialize_agg(variance(temperature::integer)), _timescaledb_internal.partialize_agg(var_pop(temperature::integer)), _timescaledb_internal.partialize_agg(var_samp(temperature::integer)), _timescaledb_internal.partialize_agg(public.last(temperature, timec)), _timescaledb_internal.partialize_agg(public.histogram(temperature, 0::double precision, 100::double precision, 1)) FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: conditions_2.region, conditions_2.temperature, conditions_2.timec, (PARTIAL min(conditions_2.allnull)), (PARTIAL max(conditions_2.temperature)), (PARTIAL sum(conditions_2.temperature)), (PARTIAL sum(conditions_2.humidity)), (PARTIAL avg(conditions_2.humidity)), (PARTIAL stddev((conditions_2.humidity)::integer)), (PARTIAL bit_and(conditions_2.bit_int)), (PARTIAL bit_or(conditions_2.bit_int)), (PARTIAL bool_and(conditions_2.good_life)), (PARTIAL every((conditions_2.temperature > '0'::double precision))), (PARTIAL bool_or(conditions_2.good_life)), (PARTIAL count(*)), (PARTIAL count(conditions_2.temperature)), (PARTIAL count(conditions_2.allnull)), (PARTIAL corr(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision)), (PARTIAL covar_pop(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision)), (PARTIAL covar_samp(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision)), (PARTIAL regr_avgx(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision)), (PARTIAL regr_avgy(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision)), (PARTIAL regr_count(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision)), (PARTIAL regr_intercept(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision)), (PARTIAL regr_r2(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision)), (PARTIAL regr_slope(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision)), (PARTIAL regr_sxx(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision)), (PARTIAL regr_sxy(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision)), (PARTIAL regr_syy(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision)), (PARTIAL stddev((conditions_2.temperature)::integer)), (PARTIAL stddev_pop((conditions_2.temperature)::integer)), (PARTIAL stddev_samp((conditions_2.temperature)::integer)), (PARTIAL variance((conditions_2.temperature)::integer)), (PARTIAL var_pop((conditions_2.temperature)::integer)), (PARTIAL var_samp((conditions_2.temperature)::integer)), (PARTIAL last(conditions_2.temperature, conditions_2.timec)), (PARTIAL histogram(conditions_2.temperature, '0'::double precision, '100'::double precision, 1)) Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_3 Chunks: _dist_hyper_1_5_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_8_chunk - Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(min(allnull)), _timescaledb_internal.partialize_agg(max(temperature)), _timescaledb_internal.partialize_agg(sum(temperature)), _timescaledb_internal.partialize_agg(sum(humidity)), _timescaledb_internal.partialize_agg(avg(humidity)), _timescaledb_internal.partialize_agg(stddev(humidity::integer)), _timescaledb_internal.partialize_agg(bit_and(bit_int)), _timescaledb_internal.partialize_agg(bit_or(bit_int)), _timescaledb_internal.partialize_agg(bool_and(good_life)), _timescaledb_internal.partialize_agg(every((temperature > 0::double precision))), _timescaledb_internal.partialize_agg(bool_or(good_life)), _timescaledb_internal.partialize_agg(count(*)), _timescaledb_internal.partialize_agg(count(temperature)), _timescaledb_internal.partialize_agg(count(allnull)), _timescaledb_internal.partialize_agg(corr(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(covar_pop(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(covar_samp(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_avgx(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_avgy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_count(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_intercept(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_r2(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_slope(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_sxx(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_sxy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_syy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(stddev(temperature::integer)), _timescaledb_internal.partialize_agg(stddev_pop(temperature::integer)), _timescaledb_internal.partialize_agg(stddev_samp(temperature::integer)), _timescaledb_internal.partialize_agg(variance(temperature::integer)), _timescaledb_internal.partialize_agg(var_pop(temperature::integer)), _timescaledb_internal.partialize_agg(var_samp(temperature::integer)), _timescaledb_internal.partialize_agg(public.last(temperature, timec)), _timescaledb_internal.partialize_agg(public.histogram(temperature, 0::double precision, 100::double precision, 1)) FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(min(allnull)), _timescaledb_internal.partialize_agg(max(temperature)), _timescaledb_internal.partialize_agg(sum(temperature)), _timescaledb_internal.partialize_agg(sum(humidity)), _timescaledb_internal.partialize_agg(avg(humidity)), _timescaledb_internal.partialize_agg(stddev(humidity::integer)), _timescaledb_internal.partialize_agg(bit_and(bit_int)), _timescaledb_internal.partialize_agg(bit_or(bit_int)), _timescaledb_internal.partialize_agg(bool_and(good_life)), _timescaledb_internal.partialize_agg(every((temperature > 0::double precision))), _timescaledb_internal.partialize_agg(bool_or(good_life)), _timescaledb_internal.partialize_agg(count(*)), _timescaledb_internal.partialize_agg(count(temperature)), _timescaledb_internal.partialize_agg(count(allnull)), _timescaledb_internal.partialize_agg(corr(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(covar_pop(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(covar_samp(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_avgx(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_avgy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_count(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_intercept(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_r2(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_slope(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_sxx(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_sxy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_syy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(stddev(temperature::integer)), _timescaledb_internal.partialize_agg(stddev_pop(temperature::integer)), _timescaledb_internal.partialize_agg(stddev_samp(temperature::integer)), _timescaledb_internal.partialize_agg(variance(temperature::integer)), _timescaledb_internal.partialize_agg(var_pop(temperature::integer)), _timescaledb_internal.partialize_agg(var_samp(temperature::integer)), _timescaledb_internal.partialize_agg(public.last(temperature, timec)), _timescaledb_internal.partialize_agg(public.histogram(temperature, 0::double precision, 100::double precision, 1)) FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST (25 rows) -- Aggregates on custom types are not yet pushed down @@ -428,8 +428,8 @@ SET timescaledb.remote_data_fetcher = 'cursor'; FROM :TEST_TABLE GROUP BY :GROUPING, timec ORDER BY :GROUPING, timec; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: conditions.region, conditions.temperature, last(conditions.highlow, conditions.timec), first(conditions.highlow, conditions.timec), conditions.timec Group Key: conditions.region, conditions.temperature, conditions.timec @@ -442,7 +442,7 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Output: conditions.region, conditions.temperature, conditions.timec, conditions.highlow Data node: db_dist_partial_agg_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT timec, region, temperature, highlow FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT timec, region, temperature, highlow FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST -> Partial GroupAggregate Output: conditions_1.region, conditions_1.temperature, conditions_1.timec, PARTIAL last(conditions_1.highlow, conditions_1.timec), PARTIAL first(conditions_1.highlow, conditions_1.timec) Group Key: conditions_1.region, conditions_1.temperature, conditions_1.timec @@ -450,7 +450,7 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Output: conditions_1.region, conditions_1.temperature, conditions_1.timec, conditions_1.highlow Data node: db_dist_partial_agg_2 Chunks: _dist_hyper_1_9_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_12_chunk - Remote SQL: SELECT timec, region, temperature, highlow FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT timec, region, temperature, highlow FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST -> Partial GroupAggregate Output: conditions_2.region, conditions_2.temperature, conditions_2.timec, PARTIAL last(conditions_2.highlow, conditions_2.timec), PARTIAL first(conditions_2.highlow, conditions_2.timec) Group Key: conditions_2.region, conditions_2.temperature, conditions_2.timec @@ -458,7 +458,7 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Output: conditions_2.region, conditions_2.temperature, conditions_2.timec, conditions_2.highlow Data node: db_dist_partial_agg_3 Chunks: _dist_hyper_1_5_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_8_chunk - Remote SQL: SELECT timec, region, temperature, highlow FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT timec, region, temperature, highlow FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST (29 rows) -- Mix of aggregates that push down and those that don't @@ -491,7 +491,7 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Output: conditions.region, conditions.temperature, conditions.timec, conditions.allnull, conditions.humidity, conditions.bit_int, conditions.good_life, conditions.highlow Data node: db_dist_partial_agg_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT timec, region, temperature, humidity, allnull, highlow, bit_int, good_life FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT timec, region, temperature, humidity, allnull, highlow, bit_int, good_life FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST -> Partial GroupAggregate Output: conditions_1.region, conditions_1.temperature, conditions_1.timec, PARTIAL min(conditions_1.allnull), PARTIAL max(conditions_1.temperature), PARTIAL sum(conditions_1.temperature), PARTIAL sum(conditions_1.humidity), PARTIAL avg(conditions_1.humidity), PARTIAL stddev((conditions_1.humidity)::integer), PARTIAL bit_and(conditions_1.bit_int), PARTIAL bit_or(conditions_1.bit_int), PARTIAL bool_and(conditions_1.good_life), PARTIAL every((conditions_1.temperature > '0'::double precision)), PARTIAL bool_or(conditions_1.good_life), PARTIAL first(conditions_1.highlow, conditions_1.timec) Group Key: conditions_1.region, conditions_1.temperature, conditions_1.timec @@ -499,7 +499,7 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Output: conditions_1.region, conditions_1.temperature, conditions_1.timec, conditions_1.allnull, conditions_1.humidity, conditions_1.bit_int, conditions_1.good_life, conditions_1.highlow Data node: db_dist_partial_agg_2 Chunks: _dist_hyper_1_9_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_12_chunk - Remote SQL: SELECT timec, region, temperature, humidity, allnull, highlow, bit_int, good_life FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT timec, region, temperature, humidity, allnull, highlow, bit_int, good_life FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST -> Partial GroupAggregate Output: conditions_2.region, conditions_2.temperature, conditions_2.timec, PARTIAL min(conditions_2.allnull), PARTIAL max(conditions_2.temperature), PARTIAL sum(conditions_2.temperature), PARTIAL sum(conditions_2.humidity), PARTIAL avg(conditions_2.humidity), PARTIAL stddev((conditions_2.humidity)::integer), PARTIAL bit_and(conditions_2.bit_int), PARTIAL bit_or(conditions_2.bit_int), PARTIAL bool_and(conditions_2.good_life), PARTIAL every((conditions_2.temperature > '0'::double precision)), PARTIAL bool_or(conditions_2.good_life), PARTIAL first(conditions_2.highlow, conditions_2.timec) Group Key: conditions_2.region, conditions_2.temperature, conditions_2.timec @@ -507,7 +507,7 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Output: conditions_2.region, conditions_2.temperature, conditions_2.timec, conditions_2.allnull, conditions_2.humidity, conditions_2.bit_int, conditions_2.good_life, conditions_2.highlow Data node: db_dist_partial_agg_3 Chunks: _dist_hyper_1_5_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_8_chunk - Remote SQL: SELECT timec, region, temperature, humidity, allnull, highlow, bit_int, good_life FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT timec, region, temperature, humidity, allnull, highlow, bit_int, good_life FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST (29 rows) -- Aggregates nested in expressions and no top-level aggregate #3672 @@ -516,8 +516,8 @@ SET timescaledb.remote_data_fetcher = 'cursor'; FROM :TEST_TABLE GROUP BY :GROUPING, timec ORDER BY :GROUPING, timec; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: region, temperature, (sum(temperature) + sum(humidity)), timec Group Key: region, temperature, timec @@ -530,19 +530,19 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(sum(temperature)), _timescaledb_internal.partialize_agg(sum(humidity)) FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(sum(temperature)), _timescaledb_internal.partialize_agg(sum(humidity)) FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: conditions_1.region, conditions_1.temperature, conditions_1.timec, (PARTIAL sum(conditions_1.temperature)), (PARTIAL sum(conditions_1.humidity)) Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_2 Chunks: _dist_hyper_1_9_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_12_chunk - Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(sum(temperature)), _timescaledb_internal.partialize_agg(sum(humidity)) FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(sum(temperature)), _timescaledb_internal.partialize_agg(sum(humidity)) FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: conditions_2.region, conditions_2.temperature, conditions_2.timec, (PARTIAL sum(conditions_2.temperature)), (PARTIAL sum(conditions_2.humidity)) Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_3 Chunks: _dist_hyper_1_5_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_8_chunk - Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(sum(temperature)), _timescaledb_internal.partialize_agg(sum(humidity)) FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(sum(temperature)), _timescaledb_internal.partialize_agg(sum(humidity)) FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST (25 rows) -- Aggregates with no aggregate reference in targetlist #3664 @@ -551,8 +551,8 @@ SET timescaledb.remote_data_fetcher = 'cursor'; GROUP BY :GROUPING, timec HAVING avg(temperature) > 20 ORDER BY :GROUPING, timec; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: region, temperature, timec Group Key: region, temperature, timec @@ -566,19 +566,19 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(avg(temperature)) FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(avg(temperature)) FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: conditions_1.region, conditions_1.temperature, conditions_1.timec, (PARTIAL avg(conditions_1.temperature)) Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_2 Chunks: _dist_hyper_1_9_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_12_chunk - Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(avg(temperature)) FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(avg(temperature)) FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: conditions_2.region, conditions_2.temperature, conditions_2.timec, (PARTIAL avg(conditions_2.temperature)) Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_3 Chunks: _dist_hyper_1_5_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_8_chunk - Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(avg(temperature)) FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(avg(temperature)) FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST (26 rows) -- Full aggregate pushdown correctness check, compare location grouped query results with partionwise aggregates on and off diff --git a/tsl/test/expected/dist_partial_agg-15.out b/tsl/test/expected/dist_partial_agg-15.out index 2713b21bbbf..f46cb7e58ca 100644 --- a/tsl/test/expected/dist_partial_agg-15.out +++ b/tsl/test/expected/dist_partial_agg-15.out @@ -186,19 +186,19 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT location, min(allnull), max(temperature), (sum(temperature) + sum(humidity)), avg(humidity), round(stddev(humidity::integer), 5), bit_and(bit_int), bit_or(bit_int), bool_and(good_life), every((temperature > 0::double precision)), bool_or(good_life), count(*), count(temperature), count(allnull), round(corr(temperature::integer, humidity::integer)::numeric, 5), round(covar_pop(temperature::integer, humidity::integer)::numeric, 5), round(covar_samp(temperature::integer, humidity::integer)::numeric, 5), round(regr_avgx(temperature::integer, humidity::integer)::numeric, 5), round(regr_avgy(temperature::integer, humidity::integer)::numeric, 5), round(regr_count(temperature::integer, humidity::integer)::numeric, 5), round(regr_intercept(temperature::integer, humidity::integer)::numeric, 5), round(regr_r2(temperature::integer, humidity::integer)::numeric, 5), round(regr_slope(temperature::integer, humidity::integer)::numeric, 5), round(regr_sxx(temperature::integer, humidity::integer)::numeric, 5), round(regr_sxy(temperature::integer, humidity::integer)::numeric, 5), round(regr_syy(temperature::integer, humidity::integer)::numeric, 5), round(stddev(temperature::integer), 5), round(stddev_pop(temperature::integer), 5), round(stddev_samp(temperature::integer), 5), round(variance(temperature::integer), 5), round(var_pop(temperature::integer), 5), round(var_samp(temperature::integer), 5), public.last(temperature, timec), public.histogram(temperature, 0::double precision, 100::double precision, 1), timec FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 35 ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT location, min(allnull), max(temperature), (sum(temperature) + sum(humidity)), avg(humidity), round(stddev(humidity::integer), 5), bit_and(bit_int), bit_or(bit_int), bool_and(good_life), every((temperature > 0::double precision)), bool_or(good_life), count(*), count(temperature), count(allnull), round(corr(temperature::integer, humidity::integer)::numeric, 5), round(covar_pop(temperature::integer, humidity::integer)::numeric, 5), round(covar_samp(temperature::integer, humidity::integer)::numeric, 5), round(regr_avgx(temperature::integer, humidity::integer)::numeric, 5), round(regr_avgy(temperature::integer, humidity::integer)::numeric, 5), round(regr_count(temperature::integer, humidity::integer)::numeric, 5), round(regr_intercept(temperature::integer, humidity::integer)::numeric, 5), round(regr_r2(temperature::integer, humidity::integer)::numeric, 5), round(regr_slope(temperature::integer, humidity::integer)::numeric, 5), round(regr_sxx(temperature::integer, humidity::integer)::numeric, 5), round(regr_sxy(temperature::integer, humidity::integer)::numeric, 5), round(regr_syy(temperature::integer, humidity::integer)::numeric, 5), round(stddev(temperature::integer), 5), round(stddev_pop(temperature::integer), 5), round(stddev_samp(temperature::integer), 5), round(variance(temperature::integer), 5), round(var_pop(temperature::integer), 5), round(var_samp(temperature::integer), 5), public.last(temperature, timec), public.histogram(temperature, 0::double precision, 100::double precision, 1), timec FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 35 ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: conditions_1.location, (min(conditions_1.allnull)), (max(conditions_1.temperature)), ((sum(conditions_1.temperature) + sum(conditions_1.humidity))), (avg(conditions_1.humidity)), (round(stddev((conditions_1.humidity)::integer), 5)), (bit_and(conditions_1.bit_int)), (bit_or(conditions_1.bit_int)), (bool_and(conditions_1.good_life)), (every((conditions_1.temperature > '0'::double precision))), (bool_or(conditions_1.good_life)), (count(*)), (count(conditions_1.temperature)), (count(conditions_1.allnull)), (round((corr(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision))::numeric, 5)), (round((covar_pop(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision))::numeric, 5)), (round((covar_samp(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision))::numeric, 5)), (round((regr_avgx(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision))::numeric, 5)), (round((regr_avgy(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision))::numeric, 5)), (round((regr_count(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision))::numeric, 5)), (round((regr_intercept(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision))::numeric, 5)), (round((regr_r2(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision))::numeric, 5)), (round((regr_slope(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision))::numeric, 5)), (round((regr_sxx(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision))::numeric, 5)), (round((regr_sxy(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision))::numeric, 5)), (round((regr_syy(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision))::numeric, 5)), (round(stddev((conditions_1.temperature)::integer), 5)), (round(stddev_pop((conditions_1.temperature)::integer), 5)), (round(stddev_samp((conditions_1.temperature)::integer), 5)), (round(variance((conditions_1.temperature)::integer), 5)), (round(var_pop((conditions_1.temperature)::integer), 5)), (round(var_samp((conditions_1.temperature)::integer), 5)), (last(conditions_1.temperature, conditions_1.timec)), (histogram(conditions_1.temperature, '0'::double precision, '100'::double precision, 1)), conditions_1.timec Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_2 Chunks: _dist_hyper_1_9_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_12_chunk - Remote SQL: SELECT location, min(allnull), max(temperature), (sum(temperature) + sum(humidity)), avg(humidity), round(stddev(humidity::integer), 5), bit_and(bit_int), bit_or(bit_int), bool_and(good_life), every((temperature > 0::double precision)), bool_or(good_life), count(*), count(temperature), count(allnull), round(corr(temperature::integer, humidity::integer)::numeric, 5), round(covar_pop(temperature::integer, humidity::integer)::numeric, 5), round(covar_samp(temperature::integer, humidity::integer)::numeric, 5), round(regr_avgx(temperature::integer, humidity::integer)::numeric, 5), round(regr_avgy(temperature::integer, humidity::integer)::numeric, 5), round(regr_count(temperature::integer, humidity::integer)::numeric, 5), round(regr_intercept(temperature::integer, humidity::integer)::numeric, 5), round(regr_r2(temperature::integer, humidity::integer)::numeric, 5), round(regr_slope(temperature::integer, humidity::integer)::numeric, 5), round(regr_sxx(temperature::integer, humidity::integer)::numeric, 5), round(regr_sxy(temperature::integer, humidity::integer)::numeric, 5), round(regr_syy(temperature::integer, humidity::integer)::numeric, 5), round(stddev(temperature::integer), 5), round(stddev_pop(temperature::integer), 5), round(stddev_samp(temperature::integer), 5), round(variance(temperature::integer), 5), round(var_pop(temperature::integer), 5), round(var_samp(temperature::integer), 5), public.last(temperature, timec), public.histogram(temperature, 0::double precision, 100::double precision, 1), timec FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 35 ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT location, min(allnull), max(temperature), (sum(temperature) + sum(humidity)), avg(humidity), round(stddev(humidity::integer), 5), bit_and(bit_int), bit_or(bit_int), bool_and(good_life), every((temperature > 0::double precision)), bool_or(good_life), count(*), count(temperature), count(allnull), round(corr(temperature::integer, humidity::integer)::numeric, 5), round(covar_pop(temperature::integer, humidity::integer)::numeric, 5), round(covar_samp(temperature::integer, humidity::integer)::numeric, 5), round(regr_avgx(temperature::integer, humidity::integer)::numeric, 5), round(regr_avgy(temperature::integer, humidity::integer)::numeric, 5), round(regr_count(temperature::integer, humidity::integer)::numeric, 5), round(regr_intercept(temperature::integer, humidity::integer)::numeric, 5), round(regr_r2(temperature::integer, humidity::integer)::numeric, 5), round(regr_slope(temperature::integer, humidity::integer)::numeric, 5), round(regr_sxx(temperature::integer, humidity::integer)::numeric, 5), round(regr_sxy(temperature::integer, humidity::integer)::numeric, 5), round(regr_syy(temperature::integer, humidity::integer)::numeric, 5), round(stddev(temperature::integer), 5), round(stddev_pop(temperature::integer), 5), round(stddev_samp(temperature::integer), 5), round(variance(temperature::integer), 5), round(var_pop(temperature::integer), 5), round(var_samp(temperature::integer), 5), public.last(temperature, timec), public.histogram(temperature, 0::double precision, 100::double precision, 1), timec FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 35 ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: conditions_2.location, (min(conditions_2.allnull)), (max(conditions_2.temperature)), ((sum(conditions_2.temperature) + sum(conditions_2.humidity))), (avg(conditions_2.humidity)), (round(stddev((conditions_2.humidity)::integer), 5)), (bit_and(conditions_2.bit_int)), (bit_or(conditions_2.bit_int)), (bool_and(conditions_2.good_life)), (every((conditions_2.temperature > '0'::double precision))), (bool_or(conditions_2.good_life)), (count(*)), (count(conditions_2.temperature)), (count(conditions_2.allnull)), (round((corr(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision))::numeric, 5)), (round((covar_pop(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision))::numeric, 5)), (round((covar_samp(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision))::numeric, 5)), (round((regr_avgx(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision))::numeric, 5)), (round((regr_avgy(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision))::numeric, 5)), (round((regr_count(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision))::numeric, 5)), (round((regr_intercept(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision))::numeric, 5)), (round((regr_r2(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision))::numeric, 5)), (round((regr_slope(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision))::numeric, 5)), (round((regr_sxx(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision))::numeric, 5)), (round((regr_sxy(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision))::numeric, 5)), (round((regr_syy(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision))::numeric, 5)), (round(stddev((conditions_2.temperature)::integer), 5)), (round(stddev_pop((conditions_2.temperature)::integer), 5)), (round(stddev_samp((conditions_2.temperature)::integer), 5)), (round(variance((conditions_2.temperature)::integer), 5)), (round(var_pop((conditions_2.temperature)::integer), 5)), (round(var_samp((conditions_2.temperature)::integer), 5)), (last(conditions_2.temperature, conditions_2.timec)), (histogram(conditions_2.temperature, '0'::double precision, '100'::double precision, 1)), conditions_2.timec Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_3 Chunks: _dist_hyper_1_5_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_8_chunk - Remote SQL: SELECT location, min(allnull), max(temperature), (sum(temperature) + sum(humidity)), avg(humidity), round(stddev(humidity::integer), 5), bit_and(bit_int), bit_or(bit_int), bool_and(good_life), every((temperature > 0::double precision)), bool_or(good_life), count(*), count(temperature), count(allnull), round(corr(temperature::integer, humidity::integer)::numeric, 5), round(covar_pop(temperature::integer, humidity::integer)::numeric, 5), round(covar_samp(temperature::integer, humidity::integer)::numeric, 5), round(regr_avgx(temperature::integer, humidity::integer)::numeric, 5), round(regr_avgy(temperature::integer, humidity::integer)::numeric, 5), round(regr_count(temperature::integer, humidity::integer)::numeric, 5), round(regr_intercept(temperature::integer, humidity::integer)::numeric, 5), round(regr_r2(temperature::integer, humidity::integer)::numeric, 5), round(regr_slope(temperature::integer, humidity::integer)::numeric, 5), round(regr_sxx(temperature::integer, humidity::integer)::numeric, 5), round(regr_sxy(temperature::integer, humidity::integer)::numeric, 5), round(regr_syy(temperature::integer, humidity::integer)::numeric, 5), round(stddev(temperature::integer), 5), round(stddev_pop(temperature::integer), 5), round(stddev_samp(temperature::integer), 5), round(variance(temperature::integer), 5), round(var_pop(temperature::integer), 5), round(var_samp(temperature::integer), 5), public.last(temperature, timec), public.histogram(temperature, 0::double precision, 100::double precision, 1), timec FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 35 ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT location, min(allnull), max(temperature), (sum(temperature) + sum(humidity)), avg(humidity), round(stddev(humidity::integer), 5), bit_and(bit_int), bit_or(bit_int), bool_and(good_life), every((temperature > 0::double precision)), bool_or(good_life), count(*), count(temperature), count(allnull), round(corr(temperature::integer, humidity::integer)::numeric, 5), round(covar_pop(temperature::integer, humidity::integer)::numeric, 5), round(covar_samp(temperature::integer, humidity::integer)::numeric, 5), round(regr_avgx(temperature::integer, humidity::integer)::numeric, 5), round(regr_avgy(temperature::integer, humidity::integer)::numeric, 5), round(regr_count(temperature::integer, humidity::integer)::numeric, 5), round(regr_intercept(temperature::integer, humidity::integer)::numeric, 5), round(regr_r2(temperature::integer, humidity::integer)::numeric, 5), round(regr_slope(temperature::integer, humidity::integer)::numeric, 5), round(regr_sxx(temperature::integer, humidity::integer)::numeric, 5), round(regr_sxy(temperature::integer, humidity::integer)::numeric, 5), round(regr_syy(temperature::integer, humidity::integer)::numeric, 5), round(stddev(temperature::integer), 5), round(stddev_pop(temperature::integer), 5), round(stddev_samp(temperature::integer), 5), round(variance(temperature::integer), 5), round(var_pop(temperature::integer), 5), round(var_samp(temperature::integer), 5), public.last(temperature, timec), public.histogram(temperature, 0::double precision, 100::double precision, 1), timec FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 35 ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST (22 rows) -- Aggregates on custom types are not yet pushed down @@ -208,8 +208,8 @@ SET timescaledb.remote_data_fetcher = 'cursor'; FROM :TEST_TABLE GROUP BY :GROUPING, timec ORDER BY :GROUPING, timec; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Merge Append Sort Key: conditions.location, conditions.timec -> GroupAggregate @@ -221,7 +221,7 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Output: conditions.location, conditions.highlow, conditions.timec Data node: db_dist_partial_agg_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT timec, location, highlow FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT timec, location, highlow FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST -> GroupAggregate Output: conditions_1.location, last(conditions_1.highlow, conditions_1.timec), first(conditions_1.highlow, conditions_1.timec), conditions_1.timec Group Key: conditions_1.location, conditions_1.timec @@ -231,7 +231,7 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Output: conditions_1.location, conditions_1.highlow, conditions_1.timec Data node: db_dist_partial_agg_2 Chunks: _dist_hyper_1_9_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_12_chunk - Remote SQL: SELECT timec, location, highlow FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT timec, location, highlow FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST -> GroupAggregate Output: conditions_2.location, last(conditions_2.highlow, conditions_2.timec), first(conditions_2.highlow, conditions_2.timec), conditions_2.timec Group Key: conditions_2.location, conditions_2.timec @@ -241,7 +241,7 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Output: conditions_2.location, conditions_2.highlow, conditions_2.timec Data node: db_dist_partial_agg_3 Chunks: _dist_hyper_1_5_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_8_chunk - Remote SQL: SELECT timec, location, highlow FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT timec, location, highlow FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST (32 rows) -- Mix of aggregates that push down and those that don't @@ -273,7 +273,7 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Output: conditions.location, conditions.allnull, conditions.temperature, conditions.humidity, conditions.bit_int, conditions.good_life, conditions.highlow, conditions.timec Data node: db_dist_partial_agg_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT timec, location, temperature, humidity, allnull, highlow, bit_int, good_life FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT timec, location, temperature, humidity, allnull, highlow, bit_int, good_life FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST -> GroupAggregate Output: conditions_1.location, min(conditions_1.allnull), max(conditions_1.temperature), (sum(conditions_1.temperature) + sum(conditions_1.humidity)), avg(conditions_1.humidity), round(stddev((conditions_1.humidity)::integer), 5), bit_and(conditions_1.bit_int), bit_or(conditions_1.bit_int), bool_and(conditions_1.good_life), every((conditions_1.temperature > '0'::double precision)), bool_or(conditions_1.good_life), first(conditions_1.highlow, conditions_1.timec), conditions_1.timec Group Key: conditions_1.location, conditions_1.timec @@ -283,7 +283,7 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Output: conditions_1.location, conditions_1.allnull, conditions_1.temperature, conditions_1.humidity, conditions_1.bit_int, conditions_1.good_life, conditions_1.highlow, conditions_1.timec Data node: db_dist_partial_agg_2 Chunks: _dist_hyper_1_9_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_12_chunk - Remote SQL: SELECT timec, location, temperature, humidity, allnull, highlow, bit_int, good_life FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT timec, location, temperature, humidity, allnull, highlow, bit_int, good_life FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST -> GroupAggregate Output: conditions_2.location, min(conditions_2.allnull), max(conditions_2.temperature), (sum(conditions_2.temperature) + sum(conditions_2.humidity)), avg(conditions_2.humidity), round(stddev((conditions_2.humidity)::integer), 5), bit_and(conditions_2.bit_int), bit_or(conditions_2.bit_int), bool_and(conditions_2.good_life), every((conditions_2.temperature > '0'::double precision)), bool_or(conditions_2.good_life), first(conditions_2.highlow, conditions_2.timec), conditions_2.timec Group Key: conditions_2.location, conditions_2.timec @@ -293,7 +293,7 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Output: conditions_2.location, conditions_2.allnull, conditions_2.temperature, conditions_2.humidity, conditions_2.bit_int, conditions_2.good_life, conditions_2.highlow, conditions_2.timec Data node: db_dist_partial_agg_3 Chunks: _dist_hyper_1_5_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_8_chunk - Remote SQL: SELECT timec, location, temperature, humidity, allnull, highlow, bit_int, good_life FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT timec, location, temperature, humidity, allnull, highlow, bit_int, good_life FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST (32 rows) -- Aggregates nested in expressions and no top-level aggregate #3672 @@ -302,8 +302,8 @@ SET timescaledb.remote_data_fetcher = 'cursor'; FROM :TEST_TABLE GROUP BY :GROUPING, timec ORDER BY :GROUPING, timec; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: location, ((sum(temperature) + sum(humidity))), timec -> Merge Append @@ -313,19 +313,19 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT location, (sum(temperature) + sum(humidity)), timec FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 3 ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT location, (sum(temperature) + sum(humidity)), timec FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 3 ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: conditions_1.location, ((sum(conditions_1.temperature) + sum(conditions_1.humidity))), conditions_1.timec Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_2 Chunks: _dist_hyper_1_9_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_12_chunk - Remote SQL: SELECT location, (sum(temperature) + sum(humidity)), timec FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 3 ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT location, (sum(temperature) + sum(humidity)), timec FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 3 ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: conditions_2.location, ((sum(conditions_2.temperature) + sum(conditions_2.humidity))), conditions_2.timec Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_3 Chunks: _dist_hyper_1_5_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_8_chunk - Remote SQL: SELECT location, (sum(temperature) + sum(humidity)), timec FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 3 ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT location, (sum(temperature) + sum(humidity)), timec FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 3 ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST (22 rows) -- Aggregates with no aggregate reference in targetlist #3664 @@ -334,8 +334,8 @@ SET timescaledb.remote_data_fetcher = 'cursor'; GROUP BY :GROUPING, timec HAVING avg(temperature) > 20 ORDER BY :GROUPING, timec; - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: location, timec -> Merge Append @@ -345,19 +345,19 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT location, timec FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2 HAVING ((avg(temperature) > 20::double precision)) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT location, timec FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2 HAVING ((avg(temperature) > 20::double precision)) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: conditions_1.location, conditions_1.timec Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_2 Chunks: _dist_hyper_1_9_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_12_chunk - Remote SQL: SELECT location, timec FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2 HAVING ((avg(temperature) > 20::double precision)) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT location, timec FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2 HAVING ((avg(temperature) > 20::double precision)) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: conditions_2.location, conditions_2.timec Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_3 Chunks: _dist_hyper_1_5_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_8_chunk - Remote SQL: SELECT location, timec FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2 HAVING ((avg(temperature) > 20::double precision)) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT location, timec FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2 HAVING ((avg(temperature) > 20::double precision)) ORDER BY location ASC NULLS LAST, timec ASC NULLS LAST (22 rows) \set GROUPING 'region, temperature' @@ -418,19 +418,19 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(min(allnull)), _timescaledb_internal.partialize_agg(max(temperature)), _timescaledb_internal.partialize_agg(sum(temperature)), _timescaledb_internal.partialize_agg(sum(humidity)), _timescaledb_internal.partialize_agg(avg(humidity)), _timescaledb_internal.partialize_agg(stddev(humidity::integer)), _timescaledb_internal.partialize_agg(bit_and(bit_int)), _timescaledb_internal.partialize_agg(bit_or(bit_int)), _timescaledb_internal.partialize_agg(bool_and(good_life)), _timescaledb_internal.partialize_agg(every((temperature > 0::double precision))), _timescaledb_internal.partialize_agg(bool_or(good_life)), _timescaledb_internal.partialize_agg(count(*)), _timescaledb_internal.partialize_agg(count(temperature)), _timescaledb_internal.partialize_agg(count(allnull)), _timescaledb_internal.partialize_agg(corr(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(covar_pop(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(covar_samp(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_avgx(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_avgy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_count(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_intercept(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_r2(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_slope(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_sxx(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_sxy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_syy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(stddev(temperature::integer)), _timescaledb_internal.partialize_agg(stddev_pop(temperature::integer)), _timescaledb_internal.partialize_agg(stddev_samp(temperature::integer)), _timescaledb_internal.partialize_agg(variance(temperature::integer)), _timescaledb_internal.partialize_agg(var_pop(temperature::integer)), _timescaledb_internal.partialize_agg(var_samp(temperature::integer)), _timescaledb_internal.partialize_agg(public.last(temperature, timec)), _timescaledb_internal.partialize_agg(public.histogram(temperature, 0::double precision, 100::double precision, 1)) FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(min(allnull)), _timescaledb_internal.partialize_agg(max(temperature)), _timescaledb_internal.partialize_agg(sum(temperature)), _timescaledb_internal.partialize_agg(sum(humidity)), _timescaledb_internal.partialize_agg(avg(humidity)), _timescaledb_internal.partialize_agg(stddev(humidity::integer)), _timescaledb_internal.partialize_agg(bit_and(bit_int)), _timescaledb_internal.partialize_agg(bit_or(bit_int)), _timescaledb_internal.partialize_agg(bool_and(good_life)), _timescaledb_internal.partialize_agg(every((temperature > 0::double precision))), _timescaledb_internal.partialize_agg(bool_or(good_life)), _timescaledb_internal.partialize_agg(count(*)), _timescaledb_internal.partialize_agg(count(temperature)), _timescaledb_internal.partialize_agg(count(allnull)), _timescaledb_internal.partialize_agg(corr(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(covar_pop(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(covar_samp(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_avgx(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_avgy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_count(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_intercept(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_r2(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_slope(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_sxx(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_sxy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_syy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(stddev(temperature::integer)), _timescaledb_internal.partialize_agg(stddev_pop(temperature::integer)), _timescaledb_internal.partialize_agg(stddev_samp(temperature::integer)), _timescaledb_internal.partialize_agg(variance(temperature::integer)), _timescaledb_internal.partialize_agg(var_pop(temperature::integer)), _timescaledb_internal.partialize_agg(var_samp(temperature::integer)), _timescaledb_internal.partialize_agg(public.last(temperature, timec)), _timescaledb_internal.partialize_agg(public.histogram(temperature, 0::double precision, 100::double precision, 1)) FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: conditions_1.region, conditions_1.temperature, conditions_1.timec, (PARTIAL min(conditions_1.allnull)), (PARTIAL max(conditions_1.temperature)), (PARTIAL sum(conditions_1.temperature)), (PARTIAL sum(conditions_1.humidity)), (PARTIAL avg(conditions_1.humidity)), (PARTIAL stddev((conditions_1.humidity)::integer)), (PARTIAL bit_and(conditions_1.bit_int)), (PARTIAL bit_or(conditions_1.bit_int)), (PARTIAL bool_and(conditions_1.good_life)), (PARTIAL every((conditions_1.temperature > '0'::double precision))), (PARTIAL bool_or(conditions_1.good_life)), (PARTIAL count(*)), (PARTIAL count(conditions_1.temperature)), (PARTIAL count(conditions_1.allnull)), (PARTIAL corr(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision)), (PARTIAL covar_pop(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision)), (PARTIAL covar_samp(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision)), (PARTIAL regr_avgx(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision)), (PARTIAL regr_avgy(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision)), (PARTIAL regr_count(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision)), (PARTIAL regr_intercept(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision)), (PARTIAL regr_r2(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision)), (PARTIAL regr_slope(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision)), (PARTIAL regr_sxx(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision)), (PARTIAL regr_sxy(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision)), (PARTIAL regr_syy(((conditions_1.temperature)::integer)::double precision, ((conditions_1.humidity)::integer)::double precision)), (PARTIAL stddev((conditions_1.temperature)::integer)), (PARTIAL stddev_pop((conditions_1.temperature)::integer)), (PARTIAL stddev_samp((conditions_1.temperature)::integer)), (PARTIAL variance((conditions_1.temperature)::integer)), (PARTIAL var_pop((conditions_1.temperature)::integer)), (PARTIAL var_samp((conditions_1.temperature)::integer)), (PARTIAL last(conditions_1.temperature, conditions_1.timec)), (PARTIAL histogram(conditions_1.temperature, '0'::double precision, '100'::double precision, 1)) Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_2 Chunks: _dist_hyper_1_9_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_12_chunk - Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(min(allnull)), _timescaledb_internal.partialize_agg(max(temperature)), _timescaledb_internal.partialize_agg(sum(temperature)), _timescaledb_internal.partialize_agg(sum(humidity)), _timescaledb_internal.partialize_agg(avg(humidity)), _timescaledb_internal.partialize_agg(stddev(humidity::integer)), _timescaledb_internal.partialize_agg(bit_and(bit_int)), _timescaledb_internal.partialize_agg(bit_or(bit_int)), _timescaledb_internal.partialize_agg(bool_and(good_life)), _timescaledb_internal.partialize_agg(every((temperature > 0::double precision))), _timescaledb_internal.partialize_agg(bool_or(good_life)), _timescaledb_internal.partialize_agg(count(*)), _timescaledb_internal.partialize_agg(count(temperature)), _timescaledb_internal.partialize_agg(count(allnull)), _timescaledb_internal.partialize_agg(corr(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(covar_pop(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(covar_samp(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_avgx(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_avgy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_count(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_intercept(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_r2(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_slope(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_sxx(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_sxy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_syy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(stddev(temperature::integer)), _timescaledb_internal.partialize_agg(stddev_pop(temperature::integer)), _timescaledb_internal.partialize_agg(stddev_samp(temperature::integer)), _timescaledb_internal.partialize_agg(variance(temperature::integer)), _timescaledb_internal.partialize_agg(var_pop(temperature::integer)), _timescaledb_internal.partialize_agg(var_samp(temperature::integer)), _timescaledb_internal.partialize_agg(public.last(temperature, timec)), _timescaledb_internal.partialize_agg(public.histogram(temperature, 0::double precision, 100::double precision, 1)) FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(min(allnull)), _timescaledb_internal.partialize_agg(max(temperature)), _timescaledb_internal.partialize_agg(sum(temperature)), _timescaledb_internal.partialize_agg(sum(humidity)), _timescaledb_internal.partialize_agg(avg(humidity)), _timescaledb_internal.partialize_agg(stddev(humidity::integer)), _timescaledb_internal.partialize_agg(bit_and(bit_int)), _timescaledb_internal.partialize_agg(bit_or(bit_int)), _timescaledb_internal.partialize_agg(bool_and(good_life)), _timescaledb_internal.partialize_agg(every((temperature > 0::double precision))), _timescaledb_internal.partialize_agg(bool_or(good_life)), _timescaledb_internal.partialize_agg(count(*)), _timescaledb_internal.partialize_agg(count(temperature)), _timescaledb_internal.partialize_agg(count(allnull)), _timescaledb_internal.partialize_agg(corr(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(covar_pop(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(covar_samp(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_avgx(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_avgy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_count(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_intercept(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_r2(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_slope(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_sxx(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_sxy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_syy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(stddev(temperature::integer)), _timescaledb_internal.partialize_agg(stddev_pop(temperature::integer)), _timescaledb_internal.partialize_agg(stddev_samp(temperature::integer)), _timescaledb_internal.partialize_agg(variance(temperature::integer)), _timescaledb_internal.partialize_agg(var_pop(temperature::integer)), _timescaledb_internal.partialize_agg(var_samp(temperature::integer)), _timescaledb_internal.partialize_agg(public.last(temperature, timec)), _timescaledb_internal.partialize_agg(public.histogram(temperature, 0::double precision, 100::double precision, 1)) FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: conditions_2.region, conditions_2.temperature, conditions_2.timec, (PARTIAL min(conditions_2.allnull)), (PARTIAL max(conditions_2.temperature)), (PARTIAL sum(conditions_2.temperature)), (PARTIAL sum(conditions_2.humidity)), (PARTIAL avg(conditions_2.humidity)), (PARTIAL stddev((conditions_2.humidity)::integer)), (PARTIAL bit_and(conditions_2.bit_int)), (PARTIAL bit_or(conditions_2.bit_int)), (PARTIAL bool_and(conditions_2.good_life)), (PARTIAL every((conditions_2.temperature > '0'::double precision))), (PARTIAL bool_or(conditions_2.good_life)), (PARTIAL count(*)), (PARTIAL count(conditions_2.temperature)), (PARTIAL count(conditions_2.allnull)), (PARTIAL corr(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision)), (PARTIAL covar_pop(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision)), (PARTIAL covar_samp(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision)), (PARTIAL regr_avgx(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision)), (PARTIAL regr_avgy(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision)), (PARTIAL regr_count(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision)), (PARTIAL regr_intercept(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision)), (PARTIAL regr_r2(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision)), (PARTIAL regr_slope(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision)), (PARTIAL regr_sxx(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision)), (PARTIAL regr_sxy(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision)), (PARTIAL regr_syy(((conditions_2.temperature)::integer)::double precision, ((conditions_2.humidity)::integer)::double precision)), (PARTIAL stddev((conditions_2.temperature)::integer)), (PARTIAL stddev_pop((conditions_2.temperature)::integer)), (PARTIAL stddev_samp((conditions_2.temperature)::integer)), (PARTIAL variance((conditions_2.temperature)::integer)), (PARTIAL var_pop((conditions_2.temperature)::integer)), (PARTIAL var_samp((conditions_2.temperature)::integer)), (PARTIAL last(conditions_2.temperature, conditions_2.timec)), (PARTIAL histogram(conditions_2.temperature, '0'::double precision, '100'::double precision, 1)) Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_3 Chunks: _dist_hyper_1_5_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_8_chunk - Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(min(allnull)), _timescaledb_internal.partialize_agg(max(temperature)), _timescaledb_internal.partialize_agg(sum(temperature)), _timescaledb_internal.partialize_agg(sum(humidity)), _timescaledb_internal.partialize_agg(avg(humidity)), _timescaledb_internal.partialize_agg(stddev(humidity::integer)), _timescaledb_internal.partialize_agg(bit_and(bit_int)), _timescaledb_internal.partialize_agg(bit_or(bit_int)), _timescaledb_internal.partialize_agg(bool_and(good_life)), _timescaledb_internal.partialize_agg(every((temperature > 0::double precision))), _timescaledb_internal.partialize_agg(bool_or(good_life)), _timescaledb_internal.partialize_agg(count(*)), _timescaledb_internal.partialize_agg(count(temperature)), _timescaledb_internal.partialize_agg(count(allnull)), _timescaledb_internal.partialize_agg(corr(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(covar_pop(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(covar_samp(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_avgx(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_avgy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_count(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_intercept(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_r2(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_slope(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_sxx(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_sxy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_syy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(stddev(temperature::integer)), _timescaledb_internal.partialize_agg(stddev_pop(temperature::integer)), _timescaledb_internal.partialize_agg(stddev_samp(temperature::integer)), _timescaledb_internal.partialize_agg(variance(temperature::integer)), _timescaledb_internal.partialize_agg(var_pop(temperature::integer)), _timescaledb_internal.partialize_agg(var_samp(temperature::integer)), _timescaledb_internal.partialize_agg(public.last(temperature, timec)), _timescaledb_internal.partialize_agg(public.histogram(temperature, 0::double precision, 100::double precision, 1)) FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(min(allnull)), _timescaledb_internal.partialize_agg(max(temperature)), _timescaledb_internal.partialize_agg(sum(temperature)), _timescaledb_internal.partialize_agg(sum(humidity)), _timescaledb_internal.partialize_agg(avg(humidity)), _timescaledb_internal.partialize_agg(stddev(humidity::integer)), _timescaledb_internal.partialize_agg(bit_and(bit_int)), _timescaledb_internal.partialize_agg(bit_or(bit_int)), _timescaledb_internal.partialize_agg(bool_and(good_life)), _timescaledb_internal.partialize_agg(every((temperature > 0::double precision))), _timescaledb_internal.partialize_agg(bool_or(good_life)), _timescaledb_internal.partialize_agg(count(*)), _timescaledb_internal.partialize_agg(count(temperature)), _timescaledb_internal.partialize_agg(count(allnull)), _timescaledb_internal.partialize_agg(corr(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(covar_pop(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(covar_samp(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_avgx(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_avgy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_count(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_intercept(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_r2(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_slope(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_sxx(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_sxy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(regr_syy(temperature::integer, humidity::integer)), _timescaledb_internal.partialize_agg(stddev(temperature::integer)), _timescaledb_internal.partialize_agg(stddev_pop(temperature::integer)), _timescaledb_internal.partialize_agg(stddev_samp(temperature::integer)), _timescaledb_internal.partialize_agg(variance(temperature::integer)), _timescaledb_internal.partialize_agg(var_pop(temperature::integer)), _timescaledb_internal.partialize_agg(var_samp(temperature::integer)), _timescaledb_internal.partialize_agg(public.last(temperature, timec)), _timescaledb_internal.partialize_agg(public.histogram(temperature, 0::double precision, 100::double precision, 1)) FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST (25 rows) -- Aggregates on custom types are not yet pushed down @@ -440,8 +440,8 @@ SET timescaledb.remote_data_fetcher = 'cursor'; FROM :TEST_TABLE GROUP BY :GROUPING, timec ORDER BY :GROUPING, timec; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: conditions.region, conditions.temperature, last(conditions.highlow, conditions.timec), first(conditions.highlow, conditions.timec), conditions.timec Group Key: conditions.region, conditions.temperature, conditions.timec @@ -456,7 +456,7 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Output: conditions.region, conditions.temperature, conditions.highlow, conditions.timec Data node: db_dist_partial_agg_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT timec, region, temperature, highlow FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT timec, region, temperature, highlow FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST -> Partial GroupAggregate Output: conditions_1.region, conditions_1.temperature, conditions_1.timec, PARTIAL last(conditions_1.highlow, conditions_1.timec), PARTIAL first(conditions_1.highlow, conditions_1.timec) Group Key: conditions_1.region, conditions_1.temperature, conditions_1.timec @@ -466,7 +466,7 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Output: conditions_1.region, conditions_1.temperature, conditions_1.highlow, conditions_1.timec Data node: db_dist_partial_agg_2 Chunks: _dist_hyper_1_9_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_12_chunk - Remote SQL: SELECT timec, region, temperature, highlow FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT timec, region, temperature, highlow FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST -> Partial GroupAggregate Output: conditions_2.region, conditions_2.temperature, conditions_2.timec, PARTIAL last(conditions_2.highlow, conditions_2.timec), PARTIAL first(conditions_2.highlow, conditions_2.timec) Group Key: conditions_2.region, conditions_2.temperature, conditions_2.timec @@ -476,7 +476,7 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Output: conditions_2.region, conditions_2.temperature, conditions_2.highlow, conditions_2.timec Data node: db_dist_partial_agg_3 Chunks: _dist_hyper_1_5_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_8_chunk - Remote SQL: SELECT timec, region, temperature, highlow FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT timec, region, temperature, highlow FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST (35 rows) -- Mix of aggregates that push down and those that don't @@ -511,7 +511,7 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Output: conditions.region, conditions.temperature, conditions.allnull, conditions.humidity, conditions.bit_int, conditions.good_life, conditions.highlow, conditions.timec Data node: db_dist_partial_agg_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT timec, region, temperature, humidity, allnull, highlow, bit_int, good_life FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT timec, region, temperature, humidity, allnull, highlow, bit_int, good_life FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST -> Partial GroupAggregate Output: conditions_1.region, conditions_1.temperature, conditions_1.timec, PARTIAL min(conditions_1.allnull), PARTIAL max(conditions_1.temperature), PARTIAL sum(conditions_1.temperature), PARTIAL sum(conditions_1.humidity), PARTIAL avg(conditions_1.humidity), PARTIAL stddev((conditions_1.humidity)::integer), PARTIAL bit_and(conditions_1.bit_int), PARTIAL bit_or(conditions_1.bit_int), PARTIAL bool_and(conditions_1.good_life), PARTIAL every((conditions_1.temperature > '0'::double precision)), PARTIAL bool_or(conditions_1.good_life), PARTIAL first(conditions_1.highlow, conditions_1.timec) Group Key: conditions_1.region, conditions_1.temperature, conditions_1.timec @@ -521,7 +521,7 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Output: conditions_1.region, conditions_1.temperature, conditions_1.allnull, conditions_1.humidity, conditions_1.bit_int, conditions_1.good_life, conditions_1.highlow, conditions_1.timec Data node: db_dist_partial_agg_2 Chunks: _dist_hyper_1_9_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_12_chunk - Remote SQL: SELECT timec, region, temperature, humidity, allnull, highlow, bit_int, good_life FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT timec, region, temperature, humidity, allnull, highlow, bit_int, good_life FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST -> Partial GroupAggregate Output: conditions_2.region, conditions_2.temperature, conditions_2.timec, PARTIAL min(conditions_2.allnull), PARTIAL max(conditions_2.temperature), PARTIAL sum(conditions_2.temperature), PARTIAL sum(conditions_2.humidity), PARTIAL avg(conditions_2.humidity), PARTIAL stddev((conditions_2.humidity)::integer), PARTIAL bit_and(conditions_2.bit_int), PARTIAL bit_or(conditions_2.bit_int), PARTIAL bool_and(conditions_2.good_life), PARTIAL every((conditions_2.temperature > '0'::double precision)), PARTIAL bool_or(conditions_2.good_life), PARTIAL first(conditions_2.highlow, conditions_2.timec) Group Key: conditions_2.region, conditions_2.temperature, conditions_2.timec @@ -531,7 +531,7 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Output: conditions_2.region, conditions_2.temperature, conditions_2.allnull, conditions_2.humidity, conditions_2.bit_int, conditions_2.good_life, conditions_2.highlow, conditions_2.timec Data node: db_dist_partial_agg_3 Chunks: _dist_hyper_1_5_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_8_chunk - Remote SQL: SELECT timec, region, temperature, humidity, allnull, highlow, bit_int, good_life FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT timec, region, temperature, humidity, allnull, highlow, bit_int, good_life FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST (35 rows) -- Aggregates nested in expressions and no top-level aggregate #3672 @@ -540,8 +540,8 @@ SET timescaledb.remote_data_fetcher = 'cursor'; FROM :TEST_TABLE GROUP BY :GROUPING, timec ORDER BY :GROUPING, timec; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: region, temperature, (sum(temperature) + sum(humidity)), timec Group Key: region, temperature, timec @@ -554,19 +554,19 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(sum(temperature)), _timescaledb_internal.partialize_agg(sum(humidity)) FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(sum(temperature)), _timescaledb_internal.partialize_agg(sum(humidity)) FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: conditions_1.region, conditions_1.temperature, conditions_1.timec, (PARTIAL sum(conditions_1.temperature)), (PARTIAL sum(conditions_1.humidity)) Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_2 Chunks: _dist_hyper_1_9_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_12_chunk - Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(sum(temperature)), _timescaledb_internal.partialize_agg(sum(humidity)) FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(sum(temperature)), _timescaledb_internal.partialize_agg(sum(humidity)) FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: conditions_2.region, conditions_2.temperature, conditions_2.timec, (PARTIAL sum(conditions_2.temperature)), (PARTIAL sum(conditions_2.humidity)) Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_3 Chunks: _dist_hyper_1_5_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_8_chunk - Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(sum(temperature)), _timescaledb_internal.partialize_agg(sum(humidity)) FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(sum(temperature)), _timescaledb_internal.partialize_agg(sum(humidity)) FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST (25 rows) -- Aggregates with no aggregate reference in targetlist #3664 @@ -575,8 +575,8 @@ SET timescaledb.remote_data_fetcher = 'cursor'; GROUP BY :GROUPING, timec HAVING avg(temperature) > 20 ORDER BY :GROUPING, timec; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: region, temperature, timec Group Key: region, temperature, timec @@ -590,19 +590,19 @@ SET timescaledb.remote_data_fetcher = 'cursor'; Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk, _dist_hyper_1_4_chunk - Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(avg(temperature)) FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(avg(temperature)) FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: conditions_1.region, conditions_1.temperature, conditions_1.timec, (PARTIAL avg(conditions_1.temperature)) Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_2 Chunks: _dist_hyper_1_9_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_12_chunk - Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(avg(temperature)) FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(avg(temperature)) FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: conditions_2.region, conditions_2.temperature, conditions_2.timec, (PARTIAL avg(conditions_2.temperature)) Relations: Aggregate on (public.conditions) Data node: db_dist_partial_agg_3 Chunks: _dist_hyper_1_5_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_8_chunk - Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(avg(temperature)) FROM public.conditions WHERE _timescaledb_internal.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST + Remote SQL: SELECT region, temperature, timec, _timescaledb_internal.partialize_agg(avg(temperature)) FROM public.conditions WHERE _timescaledb_functions.chunks_in(public.conditions.*, ARRAY[1, 2, 3, 4]) GROUP BY 1, 2, 3 ORDER BY region ASC NULLS LAST, temperature ASC NULLS LAST, timec ASC NULLS LAST (26 rows) -- Full aggregate pushdown correctness check, compare location grouped query results with partionwise aggregates on and off diff --git a/tsl/test/expected/dist_query-13.out b/tsl/test/expected/dist_query-13.out index 2957b8a5213..75d1e8c774b 100644 --- a/tsl/test/expected/dist_query-13.out +++ b/tsl/test/expected/dist_query-13.out @@ -194,8 +194,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: "time", avg(temp) Group Key: "time" @@ -210,19 +210,19 @@ GROUP BY 1 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 -> Custom Scan (DataNodeScan) Output: hyper_1."time", (PARTIAL avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 -> Custom Scan (DataNodeScan) Output: hyper_2."time", (PARTIAL avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 (27 rows) @@ -235,8 +235,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: (time_bucket('@ 2 days'::interval, "time")), avg(temp) Group Key: (time_bucket('@ 2 days'::interval, "time")) @@ -251,19 +251,19 @@ GROUP BY 1 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), (PARTIAL avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), (PARTIAL avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 (27 rows) @@ -276,8 +276,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Append @@ -286,19 +286,19 @@ GROUP BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 (21 rows) @@ -311,8 +311,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: (time_bucket('@ 2 days'::interval, "time")), device, (avg(temp)) -> Append @@ -321,19 +321,19 @@ GROUP BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 (21 rows) @@ -346,8 +346,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: (date_trunc('month'::text, "time")), device, (avg(temp)) -> Append @@ -356,19 +356,19 @@ GROUP BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: (date_trunc('month'::text, hyper_1."time")), hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: (date_trunc('month'::text, hyper_2."time")), hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 (21 rows) @@ -382,8 +382,8 @@ GROUP BY 1,2 HAVING device > 4 - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: (time_bucket('@ 2 days'::interval, "time")), device, (avg(temp)) -> Append @@ -392,19 +392,19 @@ HAVING device > 4 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 (21 rows) EXPLAIN (verbose, costs off) @@ -415,8 +415,8 @@ GROUP BY 1,2 HAVING avg(temp) > 40 AND max(temp) < 70 - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: (time_bucket('@ 2 days'::interval, "time")), device, (avg(temp)) -> Append @@ -425,19 +425,19 @@ HAVING avg(temp) > 40 AND max(temp) < 70 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) (21 rows) @@ -450,8 +450,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1 - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: device, (avg(temp)) -> Append @@ -460,19 +460,19 @@ GROUP BY 1 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 -> Custom Scan (DataNodeScan) Output: hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 -> Custom Scan (DataNodeScan) Output: hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 (21 rows) @@ -485,8 +485,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND (temp * random() >= 0 GROUP BY 1 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate Output: hyper.location, avg(hyper.temp) Group Key: hyper.location @@ -499,19 +499,19 @@ GROUP BY 1 Filter: ((hyper_1.temp * random()) >= '0'::double precision) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.location, hyper_2.temp Filter: ((hyper_2.temp * random()) >= '0'::double precision) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.location, hyper_3.temp Filter: ((hyper_3.temp * random()) >= '0'::double precision) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST (25 rows) @@ -524,8 +524,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Append -> GroupAggregate Output: (time_bucket('@ 2 days'::interval, hyper."time")), hyper.device, avg(hyper.temp), sum((hyper.temp * (((random() <= '1'::double precision))::integer)::double precision)) @@ -534,7 +534,7 @@ GROUP BY 1,2 Output: time_bucket('@ 2 days'::interval, hyper."time"), hyper.device, hyper.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> GroupAggregate Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), hyper_1.device, avg(hyper_1.temp), sum((hyper_1.temp * (((random() <= '1'::double precision))::integer)::double precision)) Group Key: time_bucket('@ 2 days'::interval, hyper_1."time"), hyper_1.device @@ -542,7 +542,7 @@ GROUP BY 1,2 Output: time_bucket('@ 2 days'::interval, hyper_1."time"), hyper_1.device, hyper_1.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> GroupAggregate Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), hyper_2.device, avg(hyper_2.temp), sum((hyper_2.temp * (((random() <= '1'::double precision))::integer)::double precision)) Group Key: time_bucket('@ 2 days'::interval, hyper_2."time"), hyper_2.device @@ -550,7 +550,7 @@ GROUP BY 1,2 Output: time_bucket('@ 2 days'::interval, hyper_2."time"), hyper_2.device, hyper_2.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (25 rows) @@ -564,8 +564,8 @@ GROUP BY 1,2 HAVING avg(temp) * custom_sum(device) > 0.8 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Append @@ -577,7 +577,7 @@ HAVING avg(temp) * custom_sum(device) > 0.8 Output: hyper."time", hyper.device, hyper.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> GroupAggregate Output: hyper_1."time", hyper_1.device, avg(hyper_1.temp) Group Key: hyper_1."time", hyper_1.device @@ -586,7 +586,7 @@ HAVING avg(temp) * custom_sum(device) > 0.8 Output: hyper_1."time", hyper_1.device, hyper_1.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> GroupAggregate Output: hyper_2."time", hyper_2.device, avg(hyper_2.temp) Group Key: hyper_2."time", hyper_2.device @@ -595,7 +595,7 @@ HAVING avg(temp) * custom_sum(device) > 0.8 Output: hyper_2."time", hyper_2.device, hyper_2.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (30 rows) @@ -608,8 +608,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)), (custom_sum(device)) -> Append @@ -620,7 +620,7 @@ GROUP BY 1,2 Output: hyper."time", hyper.device, hyper.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> GroupAggregate Output: hyper_1."time", hyper_1.device, avg(hyper_1.temp), custom_sum(hyper_1.device) Group Key: hyper_1."time", hyper_1.device @@ -628,7 +628,7 @@ GROUP BY 1,2 Output: hyper_1."time", hyper_1.device, hyper_1.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> GroupAggregate Output: hyper_2."time", hyper_2.device, avg(hyper_2.temp), custom_sum(hyper_2.device) Group Key: hyper_2."time", hyper_2.device @@ -636,7 +636,7 @@ GROUP BY 1,2 Output: hyper_2."time", hyper_2.device, hyper_2.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (27 rows) @@ -647,8 +647,8 @@ GROUP BY 1,2 (1 row) - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Append @@ -657,23 +657,23 @@ GROUP BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 (21 rows) - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Append @@ -682,19 +682,19 @@ GROUP BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 (21 rows) tsl_override_current_timestamptz @@ -702,8 +702,8 @@ GROUP BY 1,2 (1 row) - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Append @@ -712,19 +712,19 @@ GROUP BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 (21 rows) @@ -746,17 +746,17 @@ LIMIT 10 Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) LIMIT 10 (20 rows) @@ -779,17 +779,17 @@ OFFSET 5 Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) LIMIT 10 (20 rows) @@ -811,17 +811,17 @@ LIMIT 0 Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 1 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 1 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) LIMIT 1 (20 rows) @@ -843,17 +843,17 @@ LIMIT extract(year from date '2000-01-01') Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 2000 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 2000 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) LIMIT 2000 (20 rows) @@ -875,17 +875,17 @@ LIMIT greatest(random(), 10.0) Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) (20 rows) @@ -910,17 +910,17 @@ LIMIT 10 Output: hyper_1.device, hyper_1."time", hyper_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.device, hyper_2."time", hyper_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.device, hyper_3."time", hyper_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST (23 rows) @@ -931,8 +931,8 @@ SELECT DISTINCT device, time FROM hyper LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper.device, hyper."time" -> Unique @@ -945,17 +945,17 @@ LIMIT 10 Output: hyper_1.device, hyper_1."time" Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.device, hyper_2."time" Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.device, hyper_3."time" Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST (23 rows) @@ -966,8 +966,8 @@ SELECT DISTINCT ON (device) device, time FROM hyper LIMIT 10 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper.device, hyper."time" -> Unique @@ -980,17 +980,17 @@ LIMIT 10 Output: hyper_1.device, hyper_1."time" Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.device, hyper_2."time" Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.device, hyper_3."time" Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST (23 rows) @@ -1010,17 +1010,17 @@ LIMIT 10 Output: t_1."time", t_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) -> Custom Scan (DataNodeScan) on public.hyper t_2 Output: t_2."time", t_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) -> Custom Scan (DataNodeScan) on public.hyper t_3 Output: t_3."time", t_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) -> Materialize Output: join_test.device -> Seq Scan on public.join_test @@ -1044,8 +1044,8 @@ FROM hyper INNER JOIN top_n USING (device) WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ GroupAggregate Output: (time_bucket('@ 1 min'::interval, hyper."time")), hyper.device, avg(hyper.temp) Group Key: time_bucket('@ 1 min'::interval, hyper."time"), hyper.device @@ -1061,17 +1061,17 @@ ORDER BY 1,2 Output: hyper_1."time", hyper_1.device, hyper_1.temp, time_bucket('@ 1 min'::interval, hyper_1."time") Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device, hyper_2.temp, time_bucket('@ 1 min'::interval, hyper_2."time") Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device, hyper_3.temp, time_bucket('@ 1 min'::interval, hyper_3."time") Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Materialize Output: top_n.device -> Subquery Scan on top_n @@ -1089,19 +1089,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_5.device, (avg(hyper_5.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_6.device, (avg(hyper_6.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST (56 rows) @@ -1114,8 +1114,8 @@ WHERE h1.time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND h2.time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ GroupAggregate Output: (time_bucket('@ 1 min'::interval, h1."time")), h1.device, avg(h1.temp), max(h2.temp) Group Key: time_bucket('@ 1 min'::interval, h1."time"), h1.device @@ -1126,7 +1126,7 @@ ORDER BY 1,2 Output: h2.temp, h2."time", h2.device, time_bucket('@ 1 min'::interval, h2."time") Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Materialize Output: h1."time", h1.device, h1.temp -> Custom Scan (AsyncAppend) @@ -1136,17 +1136,17 @@ ORDER BY 1,2 Output: h1_1."time", h1_1.device, h1_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper h1_2 Output: h1_2."time", h1_2.device, h1_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper h1_3 Output: h1_3."time", h1_3.device, h1_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (31 rows) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -1172,8 +1172,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1 ORDER BY 1 - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: "time", avg(temp) Group Key: "time" @@ -1186,19 +1186,19 @@ ORDER BY 1 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1."time", (PARTIAL avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2."time", (PARTIAL avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST (25 rows) @@ -1211,8 +1211,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1 ORDER BY 1 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: (time_bucket('@ 2 days'::interval, "time")), avg(temp) Group Key: (time_bucket('@ 2 days'::interval, "time")) @@ -1225,19 +1225,19 @@ ORDER BY 1 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), (PARTIAL avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), (PARTIAL avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST (25 rows) @@ -1250,8 +1250,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Merge Append @@ -1261,19 +1261,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (22 rows) @@ -1286,8 +1286,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: (time_bucket('@ 2 days'::interval, "time")), device, (avg(temp)) -> Merge Append @@ -1297,19 +1297,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (22 rows) @@ -1322,8 +1322,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: (date_trunc('month'::text, "time")), device, (avg(temp)) -> Merge Append @@ -1333,19 +1333,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (date_trunc('month'::text, hyper_1."time")), hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (date_trunc('month'::text, hyper_2."time")), hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST (22 rows) @@ -1359,8 +1359,8 @@ GROUP BY 1,2 HAVING device > 4 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Custom Scan (AsyncAppend) Output: (time_bucket('@ 2 days'::interval, "time")), device, (avg(temp)) -> Merge Append @@ -1370,19 +1370,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (22 rows) EXPLAIN (verbose, costs off) @@ -1393,8 +1393,8 @@ GROUP BY 1,2 HAVING avg(temp) > 40 AND max(temp) < 70 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Sort Output: (time_bucket('@ 2 days'::interval, "time")), device, (avg(temp)) Sort Key: (time_bucket('@ 2 days'::interval, "time")), device @@ -1406,19 +1406,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (24 rows) @@ -1431,8 +1431,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1 ORDER BY 1 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: device, (avg(temp)) -> Merge Append @@ -1442,19 +1442,19 @@ ORDER BY 1 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST (22 rows) @@ -1467,8 +1467,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND (temp * random() >= 0 GROUP BY 1 ORDER BY 1 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate Output: hyper.location, avg(hyper.temp) Group Key: hyper.location @@ -1481,19 +1481,19 @@ ORDER BY 1 Filter: ((hyper_1.temp * random()) >= '0'::double precision) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.location, hyper_2.temp Filter: ((hyper_2.temp * random()) >= '0'::double precision) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.location, hyper_3.temp Filter: ((hyper_3.temp * random()) >= '0'::double precision) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST (25 rows) @@ -1506,8 +1506,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate Output: (time_bucket('@ 2 days'::interval, hyper."time")), hyper.device, avg(hyper.temp), sum((hyper.temp * (((random() <= '1'::double precision))::integer)::double precision)) Group Key: (time_bucket('@ 2 days'::interval, hyper."time")), hyper.device @@ -1519,17 +1519,17 @@ ORDER BY 1,2 Output: time_bucket('@ 2 days'::interval, hyper_1."time"), hyper_1.device, hyper_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: time_bucket('@ 2 days'::interval, hyper_2."time"), hyper_2.device, hyper_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: time_bucket('@ 2 days'::interval, hyper_3."time"), hyper_3.device, hyper_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (22 rows) @@ -1543,8 +1543,8 @@ GROUP BY 1,2 HAVING avg(temp) * custom_sum(device) > 0.8 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ GroupAggregate Output: hyper."time", hyper.device, avg(hyper.temp) Group Key: hyper."time", hyper.device @@ -1557,17 +1557,17 @@ ORDER BY 1,2 Output: hyper_1."time", hyper_1.device, hyper_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device, hyper_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device, hyper_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (23 rows) @@ -1580,8 +1580,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ GroupAggregate Output: hyper."time", hyper.device, avg(hyper.temp), custom_sum(hyper.device) Group Key: hyper."time", hyper.device @@ -1593,17 +1593,17 @@ ORDER BY 1,2 Output: hyper_1."time", hyper_1.device, hyper_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device, hyper_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device, hyper_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (22 rows) @@ -1614,8 +1614,8 @@ ORDER BY 1,2 (1 row) - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Merge Append @@ -1625,23 +1625,23 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (22 rows) - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Merge Append @@ -1651,19 +1651,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (22 rows) tsl_override_current_timestamptz @@ -1671,8 +1671,8 @@ ORDER BY 1,2 (1 row) - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Merge Append @@ -1682,19 +1682,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (22 rows) @@ -1705,8 +1705,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -1717,17 +1717,17 @@ LIMIT 10 Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 (21 rows) @@ -1739,8 +1739,8 @@ FROM hyper ORDER BY 1,2 LIMIT 5 OFFSET 5 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -1751,17 +1751,17 @@ OFFSET 5 Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 (21 rows) @@ -1772,8 +1772,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT 0 - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -1784,17 +1784,17 @@ LIMIT 0 Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 (21 rows) @@ -1805,8 +1805,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT extract(year from date '2000-01-01') - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -1817,17 +1817,17 @@ LIMIT extract(year from date '2000-01-01') Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 (21 rows) @@ -1838,8 +1838,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT greatest(random(), 10.0) - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -1850,17 +1850,17 @@ LIMIT greatest(random(), 10.0) Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (21 rows) @@ -1888,17 +1888,17 @@ LIMIT 10 Output: hyper_1.device, hyper_1."time", hyper_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.device, hyper_2."time", hyper_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.device, hyper_3."time", hyper_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST (26 rows) @@ -1909,8 +1909,8 @@ SELECT DISTINCT device, time FROM hyper ORDER BY 1,2 LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper.device, hyper."time" -> Unique @@ -1923,17 +1923,17 @@ LIMIT 10 Output: hyper_1.device, hyper_1."time" Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.device, hyper_2."time" Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.device, hyper_3."time" Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST (23 rows) @@ -1944,8 +1944,8 @@ SELECT DISTINCT ON (device) device, time FROM hyper ORDER BY 1,2 LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper.device, hyper."time" -> Unique @@ -1958,17 +1958,17 @@ LIMIT 10 Output: hyper_1.device, hyper_1."time" Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.device, hyper_2."time" Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.device, hyper_3."time" Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST (23 rows) @@ -1988,17 +1988,17 @@ LIMIT 10 Output: t_1."time", t_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) -> Custom Scan (DataNodeScan) on public.hyper t_2 Output: t_2."time", t_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) -> Custom Scan (DataNodeScan) on public.hyper t_3 Output: t_3."time", t_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) -> Materialize Output: join_test.device -> Seq Scan on public.join_test @@ -2022,8 +2022,8 @@ FROM hyper INNER JOIN top_n USING (device) WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ GroupAggregate Output: (time_bucket('@ 1 min'::interval, hyper."time")), hyper.device, avg(hyper.temp) Group Key: time_bucket('@ 1 min'::interval, hyper."time"), hyper.device @@ -2039,17 +2039,17 @@ ORDER BY 1,2 Output: hyper_1."time", hyper_1.device, hyper_1.temp, time_bucket('@ 1 min'::interval, hyper_1."time") Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device, hyper_2.temp, time_bucket('@ 1 min'::interval, hyper_2."time") Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device, hyper_3.temp, time_bucket('@ 1 min'::interval, hyper_3."time") Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Materialize Output: top_n.device -> Subquery Scan on top_n @@ -2067,19 +2067,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_5.device, (avg(hyper_5.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_6.device, (avg(hyper_6.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST (56 rows) @@ -2092,8 +2092,8 @@ WHERE h1.time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND h2.time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ GroupAggregate Output: (time_bucket('@ 1 min'::interval, h1."time")), h1.device, avg(h1.temp), max(h2.temp) Group Key: time_bucket('@ 1 min'::interval, h1."time"), h1.device @@ -2104,7 +2104,7 @@ ORDER BY 1,2 Output: h2.temp, h2."time", h2.device, time_bucket('@ 1 min'::interval, h2."time") Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Materialize Output: h1."time", h1.device, h1.temp -> Custom Scan (AsyncAppend) @@ -2114,17 +2114,17 @@ ORDER BY 1,2 Output: h1_1."time", h1_1.device, h1_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper h1_2 Output: h1_2."time", h1_2.device, h1_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper h1_3 Output: h1_3."time", h1_3.device, h1_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (31 rows) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -2150,14 +2150,14 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND device = 1 GROUP BY 1 ORDER BY 1 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) Output: hyper."time", (avg(hyper.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST (6 rows) @@ -2170,14 +2170,14 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND device = 1 GROUP BY 1 ORDER BY 1 - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper."time")), (avg(hyper.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST (6 rows) @@ -2190,14 +2190,14 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND device = 1 GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) Output: hyper."time", hyper.device, (avg(hyper.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST (6 rows) @@ -2210,14 +2210,14 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND device = 1 GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper."time")), hyper.device, (avg(hyper.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST (6 rows) @@ -2230,14 +2230,14 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND device = 1 GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) Output: (date_trunc('month'::text, hyper."time")), hyper.device, (avg(hyper.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST + Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST (6 rows) @@ -2272,14 +2272,14 @@ GROUP BY 1,2 HAVING avg(temp) > 40 AND max(temp) < 70 ORDER BY 1,2 - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper."time")), hyper.device, (avg(hyper.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST (6 rows) @@ -2292,14 +2292,14 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND device = 1 GROUP BY 1 ORDER BY 1 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) Output: hyper.device, (avg(hyper.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1 + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1 (6 rows) @@ -2312,8 +2312,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND device = 1 AND (temp GROUP BY 1 ORDER BY 1 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate Output: hyper.location, avg(hyper.temp) Group Key: hyper.location @@ -2322,7 +2322,7 @@ ORDER BY 1 Filter: ((hyper.temp * random()) >= '0'::double precision) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) ORDER BY location ASC NULLS LAST (9 rows) @@ -2335,8 +2335,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND device = 1 GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ GroupAggregate Output: (time_bucket('@ 2 days'::interval, hyper."time")), hyper.device, avg(hyper.temp), sum((hyper.temp * (((random() <= '1'::double precision))::integer)::double precision)) Group Key: time_bucket('@ 2 days'::interval, hyper."time"), hyper.device @@ -2344,7 +2344,7 @@ ORDER BY 1,2 Output: time_bucket('@ 2 days'::interval, hyper."time"), hyper.device, hyper.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST (8 rows) @@ -2358,8 +2358,8 @@ GROUP BY 1,2 HAVING avg(temp) * custom_sum(device) > 0.8 ORDER BY 1,2 - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate Output: hyper."time", hyper.device, avg(hyper.temp) Group Key: hyper."time", hyper.device @@ -2368,7 +2368,7 @@ ORDER BY 1,2 Output: hyper."time", hyper.device, hyper.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) ORDER BY "time" ASC NULLS LAST (9 rows) @@ -2381,8 +2381,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND device = 1 GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate Output: hyper."time", hyper.device, avg(hyper.temp), custom_sum(hyper.device) Group Key: hyper."time", hyper.device @@ -2390,7 +2390,7 @@ ORDER BY 1,2 Output: hyper."time", hyper.device, hyper.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) ORDER BY "time" ASC NULLS LAST (8 rows) @@ -2401,24 +2401,24 @@ ORDER BY 1,2 (1 row) - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) Output: hyper."time", hyper.device, (avg(hyper.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST (6 rows) - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) Output: hyper."time", hyper.device, (avg(hyper.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST (6 rows) tsl_override_current_timestamptz @@ -2426,14 +2426,14 @@ ORDER BY 1,2 (1 row) - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) Output: hyper."time", hyper.device, (avg(hyper.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST (6 rows) @@ -2444,8 +2444,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -2456,17 +2456,17 @@ LIMIT 10 Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 (21 rows) @@ -2478,8 +2478,8 @@ FROM hyper ORDER BY 1,2 LIMIT 5 OFFSET 5 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -2490,17 +2490,17 @@ OFFSET 5 Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 (21 rows) @@ -2511,8 +2511,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT 0 - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -2523,17 +2523,17 @@ LIMIT 0 Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 (21 rows) @@ -2544,8 +2544,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT extract(year from date '2000-01-01') - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -2556,17 +2556,17 @@ LIMIT extract(year from date '2000-01-01') Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 (21 rows) @@ -2577,8 +2577,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT greatest(random(), 10.0) - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -2589,17 +2589,17 @@ LIMIT greatest(random(), 10.0) Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (21 rows) @@ -2627,17 +2627,17 @@ LIMIT 10 Output: hyper_1.device, hyper_1."time", hyper_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.device, hyper_2."time", hyper_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.device, hyper_3."time", hyper_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST (26 rows) @@ -2648,8 +2648,8 @@ SELECT DISTINCT device, time FROM hyper ORDER BY 1,2 LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper.device, hyper."time" -> Unique @@ -2662,17 +2662,17 @@ LIMIT 10 Output: hyper_1.device, hyper_1."time" Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.device, hyper_2."time" Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.device, hyper_3."time" Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST (23 rows) @@ -2683,8 +2683,8 @@ SELECT DISTINCT ON (device) device, time FROM hyper ORDER BY 1,2 LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper.device, hyper."time" -> Unique @@ -2697,17 +2697,17 @@ LIMIT 10 Output: hyper_1.device, hyper_1."time" Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.device, hyper_2."time" Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.device, hyper_3."time" Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST (23 rows) @@ -2727,17 +2727,17 @@ LIMIT 10 Output: t_1."time", t_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) -> Custom Scan (DataNodeScan) on public.hyper t_2 Output: t_2."time", t_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) -> Custom Scan (DataNodeScan) on public.hyper t_3 Output: t_3."time", t_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) -> Materialize Output: join_test.device -> Seq Scan on public.join_test @@ -2761,8 +2761,8 @@ FROM hyper INNER JOIN top_n USING (device) WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND device = 1 GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate Output: (time_bucket('@ 1 min'::interval, hyper."time")), hyper.device, avg(hyper.temp) Group Key: (time_bucket('@ 1 min'::interval, hyper."time")), hyper.device @@ -2772,7 +2772,7 @@ ORDER BY 1,2 Output: hyper."time", hyper.device, hyper.temp, time_bucket('@ 1 min'::interval, hyper."time") Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST -> Materialize Output: top_n.device -> Subquery Scan on top_n @@ -2785,7 +2785,7 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1 ORDER BY avg(temp) DESC NULLS FIRST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1 ORDER BY avg(temp) DESC NULLS FIRST (23 rows) @@ -2798,8 +2798,8 @@ WHERE h1.time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND h2.time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ GroupAggregate Output: (time_bucket('@ 1 min'::interval, h1."time")), h1.device, avg(h1.temp), max(h2.temp) Group Key: time_bucket('@ 1 min'::interval, h1."time"), h1.device @@ -2810,7 +2810,7 @@ ORDER BY 1,2 Output: h2.temp, h2."time", h2.device, time_bucket('@ 1 min'::interval, h2."time") Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Materialize Output: h1."time", h1.device, h1.temp -> Custom Scan (AsyncAppend) @@ -2820,17 +2820,17 @@ ORDER BY 1,2 Output: h1_1."time", h1_1.device, h1_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper h1_2 Output: h1_2."time", h1_2.device, h1_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper h1_3 Output: h1_3."time", h1_3.device, h1_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (31 rows) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -2856,8 +2856,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1 ORDER BY 1 LIMIT 10 - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: "time", (avg(temp)) -> Finalize GroupAggregate @@ -2872,19 +2872,19 @@ LIMIT 10 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1."time", (PARTIAL avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2."time", (PARTIAL avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST (27 rows) @@ -2897,8 +2897,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1 ORDER BY 1 LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: (time_bucket('@ 2 days'::interval, "time")), (avg(temp)) -> Finalize GroupAggregate @@ -2913,19 +2913,19 @@ LIMIT 10 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), (PARTIAL avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), (PARTIAL avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST (27 rows) @@ -2938,8 +2938,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 LIMIT 10 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: "time", device, (avg(temp)) -> Custom Scan (AsyncAppend) @@ -2951,19 +2951,19 @@ LIMIT 10 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (24 rows) @@ -2976,8 +2976,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 LIMIT 10 - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: (time_bucket('@ 2 days'::interval, "time")), device, (avg(temp)) -> Custom Scan (AsyncAppend) @@ -2989,19 +2989,19 @@ LIMIT 10 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (24 rows) @@ -3014,8 +3014,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 LIMIT 10 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: (date_trunc('month'::text, "time")), device, (avg(temp)) -> Custom Scan (AsyncAppend) @@ -3027,19 +3027,19 @@ LIMIT 10 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (date_trunc('month'::text, hyper_1."time")), hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (date_trunc('month'::text, hyper_2."time")), hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST (24 rows) @@ -3053,8 +3053,8 @@ GROUP BY 1,2 HAVING device > 4 ORDER BY 1,2 LIMIT 10 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Limit Output: (time_bucket('@ 2 days'::interval, "time")), device, (avg(temp)) -> Custom Scan (AsyncAppend) @@ -3066,19 +3066,19 @@ LIMIT 10 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (24 rows) EXPLAIN (verbose, costs off) @@ -3089,8 +3089,8 @@ GROUP BY 1,2 HAVING avg(temp) > 40 AND max(temp) < 70 ORDER BY 1,2 LIMIT 10 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Limit Output: (time_bucket('@ 2 days'::interval, "time")), device, (avg(temp)) -> Sort @@ -3104,19 +3104,19 @@ LIMIT 10 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (26 rows) @@ -3129,8 +3129,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1 ORDER BY 1 LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: device, (avg(temp)) -> Custom Scan (AsyncAppend) @@ -3142,19 +3142,19 @@ LIMIT 10 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST (24 rows) @@ -3167,8 +3167,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND (temp * random() >= 0 GROUP BY 1 ORDER BY 1 LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper.location, (avg(hyper.temp)) -> GroupAggregate @@ -3183,19 +3183,19 @@ LIMIT 10 Filter: ((hyper_1.temp * random()) >= '0'::double precision) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.location, hyper_2.temp Filter: ((hyper_2.temp * random()) >= '0'::double precision) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.location, hyper_3.temp Filter: ((hyper_3.temp * random()) >= '0'::double precision) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST (27 rows) @@ -3208,8 +3208,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 LIMIT 10 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: (time_bucket('@ 2 days'::interval, hyper."time")), hyper.device, (avg(hyper.temp)), (sum((hyper.temp * (((random() <= '1'::double precision))::integer)::double precision))) -> GroupAggregate @@ -3223,17 +3223,17 @@ LIMIT 10 Output: time_bucket('@ 2 days'::interval, hyper_1."time"), hyper_1.device, hyper_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: time_bucket('@ 2 days'::interval, hyper_2."time"), hyper_2.device, hyper_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: time_bucket('@ 2 days'::interval, hyper_3."time"), hyper_3.device, hyper_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (24 rows) @@ -3247,8 +3247,8 @@ GROUP BY 1,2 HAVING avg(temp) * custom_sum(device) > 0.8 ORDER BY 1,2 LIMIT 10 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Limit Output: hyper."time", hyper.device, (avg(hyper.temp)) -> GroupAggregate @@ -3263,17 +3263,17 @@ LIMIT 10 Output: hyper_1."time", hyper_1.device, hyper_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device, hyper_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device, hyper_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (25 rows) @@ -3286,8 +3286,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 LIMIT 10 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Limit Output: hyper."time", hyper.device, (avg(hyper.temp)), (custom_sum(hyper.device)) -> GroupAggregate @@ -3301,17 +3301,17 @@ LIMIT 10 Output: hyper_1."time", hyper_1.device, hyper_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device, hyper_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device, hyper_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (24 rows) @@ -3322,8 +3322,8 @@ LIMIT 10 (1 row) - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: "time", device, (avg(temp)) -> Custom Scan (AsyncAppend) @@ -3335,23 +3335,23 @@ LIMIT 10 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (24 rows) - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: "time", device, (avg(temp)) -> Custom Scan (AsyncAppend) @@ -3363,19 +3363,19 @@ LIMIT 10 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (24 rows) tsl_override_current_timestamptz @@ -3383,8 +3383,8 @@ LIMIT 10 (1 row) - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: "time", device, (avg(temp)) -> Custom Scan (AsyncAppend) @@ -3396,19 +3396,19 @@ LIMIT 10 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (24 rows) @@ -3419,8 +3419,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -3431,17 +3431,17 @@ LIMIT 10 Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 (21 rows) @@ -3453,8 +3453,8 @@ FROM hyper ORDER BY 1,2 LIMIT 5 OFFSET 5 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -3465,17 +3465,17 @@ OFFSET 5 Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 (21 rows) @@ -3486,8 +3486,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT 0 - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -3498,17 +3498,17 @@ LIMIT 0 Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 (21 rows) @@ -3519,8 +3519,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT extract(year from date '2000-01-01') - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -3531,17 +3531,17 @@ LIMIT extract(year from date '2000-01-01') Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 (21 rows) @@ -3552,8 +3552,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT greatest(random(), 10.0) - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -3564,17 +3564,17 @@ LIMIT greatest(random(), 10.0) Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (21 rows) @@ -3602,17 +3602,17 @@ LIMIT 10 Output: hyper_1.device, hyper_1."time", hyper_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.device, hyper_2."time", hyper_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.device, hyper_3."time", hyper_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST (26 rows) @@ -3623,8 +3623,8 @@ SELECT DISTINCT device, time FROM hyper ORDER BY 1,2 LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper.device, hyper."time" -> Unique @@ -3637,17 +3637,17 @@ LIMIT 10 Output: hyper_1.device, hyper_1."time" Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.device, hyper_2."time" Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.device, hyper_3."time" Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST (23 rows) @@ -3658,8 +3658,8 @@ SELECT DISTINCT ON (device) device, time FROM hyper ORDER BY 1,2 LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper.device, hyper."time" -> Unique @@ -3672,17 +3672,17 @@ LIMIT 10 Output: hyper_1.device, hyper_1."time" Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.device, hyper_2."time" Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.device, hyper_3."time" Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST (23 rows) @@ -3702,17 +3702,17 @@ LIMIT 10 Output: t_1."time", t_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) -> Custom Scan (DataNodeScan) on public.hyper t_2 Output: t_2."time", t_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) -> Custom Scan (DataNodeScan) on public.hyper t_3 Output: t_3."time", t_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) -> Materialize Output: join_test.device -> Seq Scan on public.join_test @@ -3736,8 +3736,8 @@ FROM hyper INNER JOIN top_n USING (device) WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ GroupAggregate Output: (time_bucket('@ 1 min'::interval, hyper."time")), hyper.device, avg(hyper.temp) Group Key: time_bucket('@ 1 min'::interval, hyper."time"), hyper.device @@ -3753,17 +3753,17 @@ ORDER BY 1,2 Output: hyper_1."time", hyper_1.device, hyper_1.temp, time_bucket('@ 1 min'::interval, hyper_1."time") Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device, hyper_2.temp, time_bucket('@ 1 min'::interval, hyper_2."time") Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device, hyper_3.temp, time_bucket('@ 1 min'::interval, hyper_3."time") Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Materialize Output: top_n.device -> Subquery Scan on top_n @@ -3781,19 +3781,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_5.device, (avg(hyper_5.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_6.device, (avg(hyper_6.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST (56 rows) @@ -3806,8 +3806,8 @@ WHERE h1.time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND h2.time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ GroupAggregate Output: (time_bucket('@ 1 min'::interval, h1."time")), h1.device, avg(h1.temp), max(h2.temp) Group Key: time_bucket('@ 1 min'::interval, h1."time"), h1.device @@ -3818,7 +3818,7 @@ ORDER BY 1,2 Output: h2.temp, h2."time", h2.device, time_bucket('@ 1 min'::interval, h2."time") Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Materialize Output: h1."time", h1.device, h1.temp -> Custom Scan (AsyncAppend) @@ -3828,17 +3828,17 @@ ORDER BY 1,2 Output: h1_1."time", h1_1.device, h1_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper h1_2 Output: h1_2."time", h1_2.device, h1_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper h1_3 Output: h1_3."time", h1_3.device, h1_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (31 rows) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -3864,8 +3864,8 @@ WHERE time >= '2019-01-01' GROUP BY 1 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: "time", avg(temp) Group Key: "time" @@ -3880,19 +3880,19 @@ GROUP BY 1 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 -> Custom Scan (DataNodeScan) Output: hyper_1."time", (PARTIAL avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 -> Custom Scan (DataNodeScan) Output: hyper_2."time", (PARTIAL avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 (27 rows) @@ -3905,8 +3905,8 @@ WHERE time >= '2019-01-01' GROUP BY 1 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: (time_bucket('@ 2 days'::interval, "time")), avg(temp) Group Key: (time_bucket('@ 2 days'::interval, "time")) @@ -3921,19 +3921,19 @@ GROUP BY 1 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), (PARTIAL avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), (PARTIAL avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 (27 rows) @@ -3946,8 +3946,8 @@ WHERE time >= '2019-01-01' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Merge Append @@ -3957,19 +3957,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (22 rows) @@ -3982,8 +3982,8 @@ WHERE time >= '2019-01-01' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: (time_bucket('@ 2 days'::interval, "time")), device, avg(temp) Group Key: (time_bucket('@ 2 days'::interval, "time")), device @@ -3996,19 +3996,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), hyper_1.device, (PARTIAL avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), hyper_2.device, (PARTIAL avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (25 rows) @@ -4021,8 +4021,8 @@ WHERE time >= '2019-01-01' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Finalize GroupAggregate Output: (date_trunc('month'::text, "time")), device, avg(temp) Group Key: (date_trunc('month'::text, "time")), device @@ -4035,19 +4035,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT date_trunc('month'::text, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (date_trunc('month'::text, hyper_1."time")), hyper_1.device, (PARTIAL avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT date_trunc('month'::text, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (date_trunc('month'::text, hyper_2."time")), hyper_2.device, (PARTIAL avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT date_trunc('month'::text, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST (25 rows) @@ -4061,8 +4061,8 @@ GROUP BY 1,2 HAVING device > 4 ORDER BY 1,2 - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: (time_bucket('@ 2 days'::interval, "time")), device, avg(temp) Group Key: (time_bucket('@ 2 days'::interval, "time")), device @@ -4075,19 +4075,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), hyper_1.device, (PARTIAL avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), hyper_2.device, (PARTIAL avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (25 rows) EXPLAIN (verbose, costs off) @@ -4098,8 +4098,8 @@ GROUP BY 1,2 HAVING avg(temp) > 40 AND max(temp) < 70 ORDER BY 1,2 - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: (time_bucket('@ 2 days'::interval, "time")), device, avg(temp) Group Key: (time_bucket('@ 2 days'::interval, "time")), device @@ -4113,19 +4113,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)), _timescaledb_internal.partialize_agg(max(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)), _timescaledb_internal.partialize_agg(max(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), hyper_1.device, (PARTIAL avg(hyper_1.temp)), (PARTIAL max(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)), _timescaledb_internal.partialize_agg(max(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)), _timescaledb_internal.partialize_agg(max(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), hyper_2.device, (PARTIAL avg(hyper_2.temp)), (PARTIAL max(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)), _timescaledb_internal.partialize_agg(max(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)), _timescaledb_internal.partialize_agg(max(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (26 rows) @@ -4138,8 +4138,8 @@ WHERE time >= '2019-01-01' GROUP BY 1 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: device, avg(temp) Group Key: device @@ -4154,19 +4154,19 @@ GROUP BY 1 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 -> Custom Scan (DataNodeScan) Output: hyper_1.device, (PARTIAL avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 -> Custom Scan (DataNodeScan) Output: hyper_2.device, (PARTIAL avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 (27 rows) @@ -4179,8 +4179,8 @@ WHERE time >= '2019-01-01' AND (temp * random() >= 0) GROUP BY 1 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Finalize GroupAggregate Output: location, avg(temp) Group Key: location @@ -4196,7 +4196,7 @@ GROUP BY 1 Filter: ((hyper.temp * random()) >= '0'::double precision) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST -> Partial GroupAggregate Output: hyper_1.location, PARTIAL avg(hyper_1.temp) Group Key: hyper_1.location @@ -4205,7 +4205,7 @@ GROUP BY 1 Filter: ((hyper_1.temp * random()) >= '0'::double precision) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST -> Partial GroupAggregate Output: hyper_2.location, PARTIAL avg(hyper_2.temp) Group Key: hyper_2.location @@ -4214,7 +4214,7 @@ GROUP BY 1 Filter: ((hyper_2.temp * random()) >= '0'::double precision) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST (34 rows) @@ -4227,8 +4227,8 @@ WHERE time >= '2019-01-01' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: (time_bucket('@ 2 days'::interval, hyper."time")), hyper.device, avg(hyper.temp), sum((hyper.temp * (((random() <= '1'::double precision))::integer)::double precision)) Group Key: (time_bucket('@ 2 days'::interval, hyper."time")), hyper.device @@ -4241,7 +4241,7 @@ ORDER BY 1,2 Output: time_bucket('@ 2 days'::interval, hyper."time"), hyper.device, hyper.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Partial GroupAggregate Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), hyper_1.device, PARTIAL avg(hyper_1.temp), PARTIAL sum((hyper_1.temp * (((random() <= '1'::double precision))::integer)::double precision)) Group Key: time_bucket('@ 2 days'::interval, hyper_1."time"), hyper_1.device @@ -4249,7 +4249,7 @@ ORDER BY 1,2 Output: time_bucket('@ 2 days'::interval, hyper_1."time"), hyper_1.device, hyper_1.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Partial GroupAggregate Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), hyper_2.device, PARTIAL avg(hyper_2.temp), PARTIAL sum((hyper_2.temp * (((random() <= '1'::double precision))::integer)::double precision)) Group Key: time_bucket('@ 2 days'::interval, hyper_2."time"), hyper_2.device @@ -4257,7 +4257,7 @@ ORDER BY 1,2 Output: time_bucket('@ 2 days'::interval, hyper_2."time"), hyper_2.device, hyper_2.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (29 rows) @@ -4271,8 +4271,8 @@ GROUP BY 1,2 HAVING avg(temp) * custom_sum(device) > 0.8 ORDER BY 1,2 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate Output: hyper."time", hyper.device, avg(hyper.temp) Group Key: hyper."time", hyper.device @@ -4285,17 +4285,17 @@ ORDER BY 1,2 Output: hyper_1."time", hyper_1.device, hyper_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device, hyper_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device, hyper_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (23 rows) @@ -4308,8 +4308,8 @@ WHERE time >= '2019-01-01' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate Output: hyper."time", hyper.device, avg(hyper.temp), custom_sum(hyper.device) Group Key: hyper."time", hyper.device @@ -4321,17 +4321,17 @@ ORDER BY 1,2 Output: hyper_1."time", hyper_1.device, hyper_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device, hyper_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device, hyper_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (22 rows) @@ -4342,8 +4342,8 @@ ORDER BY 1,2 (1 row) - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Merge Append @@ -4353,23 +4353,23 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (22 rows) - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Merge Append @@ -4379,19 +4379,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (22 rows) tsl_override_current_timestamptz @@ -4399,8 +4399,8 @@ ORDER BY 1,2 (1 row) - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Merge Append @@ -4410,19 +4410,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (22 rows) @@ -4433,8 +4433,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -4445,17 +4445,17 @@ LIMIT 10 Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 (21 rows) @@ -4467,8 +4467,8 @@ FROM hyper ORDER BY 1,2 LIMIT 5 OFFSET 5 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -4479,17 +4479,17 @@ OFFSET 5 Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 (21 rows) @@ -4500,8 +4500,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT 0 - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -4512,17 +4512,17 @@ LIMIT 0 Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 (21 rows) @@ -4533,8 +4533,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT extract(year from date '2000-01-01') - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -4545,17 +4545,17 @@ LIMIT extract(year from date '2000-01-01') Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 (21 rows) @@ -4566,8 +4566,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT greatest(random(), 10.0) - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -4578,17 +4578,17 @@ LIMIT greatest(random(), 10.0) Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (21 rows) @@ -4616,17 +4616,17 @@ LIMIT 10 Output: hyper_1.device, hyper_1."time", hyper_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.device, hyper_2."time", hyper_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.device, hyper_3."time", hyper_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST (26 rows) @@ -4637,8 +4637,8 @@ SELECT DISTINCT device, time FROM hyper ORDER BY 1,2 LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper.device, hyper."time" -> Unique @@ -4651,17 +4651,17 @@ LIMIT 10 Output: hyper_1.device, hyper_1."time" Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.device, hyper_2."time" Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.device, hyper_3."time" Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST (23 rows) @@ -4672,8 +4672,8 @@ SELECT DISTINCT ON (device) device, time FROM hyper ORDER BY 1,2 LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper.device, hyper."time" -> Unique @@ -4686,17 +4686,17 @@ LIMIT 10 Output: hyper_1.device, hyper_1."time" Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.device, hyper_2."time" Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.device, hyper_3."time" Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST (23 rows) @@ -4716,17 +4716,17 @@ LIMIT 10 Output: t_1."time", t_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) -> Custom Scan (DataNodeScan) on public.hyper t_2 Output: t_2."time", t_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) -> Custom Scan (DataNodeScan) on public.hyper t_3 Output: t_3."time", t_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) -> Materialize Output: join_test.device -> Seq Scan on public.join_test @@ -4750,8 +4750,8 @@ FROM hyper INNER JOIN top_n USING (device) WHERE time >= '2019-01-01' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate Output: (time_bucket('@ 1 min'::interval, hyper."time")), hyper.device, avg(hyper.temp) Group Key: time_bucket('@ 1 min'::interval, hyper."time"), hyper.device @@ -4767,17 +4767,17 @@ ORDER BY 1,2 Output: hyper_1."time", hyper_1.device, hyper_1.temp, time_bucket('@ 1 min'::interval, hyper_1."time") Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device, hyper_2.temp, time_bucket('@ 1 min'::interval, hyper_2."time") Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device, hyper_3.temp, time_bucket('@ 1 min'::interval, hyper_3."time") Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Materialize Output: top_n.device -> Subquery Scan on top_n @@ -4799,19 +4799,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_5.device, (PARTIAL avg(hyper_5.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_6.device, (PARTIAL avg(hyper_6.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST (60 rows) @@ -4824,8 +4824,8 @@ WHERE h1.time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND h2.time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ GroupAggregate Output: (time_bucket('@ 1 min'::interval, h1."time")), h1.device, avg(h1.temp), max(h2.temp) Group Key: time_bucket('@ 1 min'::interval, h1."time"), h1.device @@ -4836,7 +4836,7 @@ ORDER BY 1,2 Output: h2.temp, h2."time", h2.device, time_bucket('@ 1 min'::interval, h2."time") Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Materialize Output: h1."time", h1.device, h1.temp -> Custom Scan (AsyncAppend) @@ -4846,17 +4846,17 @@ ORDER BY 1,2 Output: h1_1."time", h1_1.device, h1_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper h1_2 Output: h1_2."time", h1_2.device, h1_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper h1_3 Output: h1_3."time", h1_3.device, h1_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (31 rows) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -4882,8 +4882,8 @@ WHERE time >= '2019-01-01' GROUP BY 1 ORDER BY 1 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", (avg(temp)) -> Merge Append @@ -4893,19 +4893,19 @@ ORDER BY 1 Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT "time", avg(temp) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", avg(temp) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper1d_1."time", (avg(hyper1d_1.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT "time", avg(temp) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", avg(temp) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper1d_2."time", (avg(hyper1d_2.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", avg(temp) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", avg(temp) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST (22 rows) @@ -4918,8 +4918,8 @@ WHERE time >= '2019-01-01' GROUP BY 1 ORDER BY 1 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: (time_bucket('@ 2 days'::interval, "time")), avg(temp) Group Key: (time_bucket('@ 2 days'::interval, "time")) @@ -4932,19 +4932,19 @@ ORDER BY 1 Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper1d_1."time")), (PARTIAL avg(hyper1d_1.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper1d_2."time")), (PARTIAL avg(hyper1d_2.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST (25 rows) @@ -4957,8 +4957,8 @@ WHERE time >= '2019-01-01' GROUP BY 1,2 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Append @@ -4967,19 +4967,19 @@ GROUP BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 (21 rows) @@ -4992,8 +4992,8 @@ WHERE time >= '2019-01-01' GROUP BY 1,2 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: (time_bucket('@ 2 days'::interval, "time")), device, avg(temp) Group Key: (time_bucket('@ 2 days'::interval, "time")), device @@ -5008,19 +5008,19 @@ GROUP BY 1,2 Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper1d_1."time")), hyper1d_1.device, (PARTIAL avg(hyper1d_1.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper1d_2."time")), hyper1d_2.device, (PARTIAL avg(hyper1d_2.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 (27 rows) @@ -5033,8 +5033,8 @@ WHERE time >= '2019-01-01' GROUP BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: (date_trunc('month'::text, "time")), device, avg(temp) Group Key: (date_trunc('month'::text, "time")), device @@ -5049,19 +5049,19 @@ GROUP BY 1,2 Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT date_trunc('month'::text, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: (date_trunc('month'::text, hyper1d_1."time")), hyper1d_1.device, (PARTIAL avg(hyper1d_1.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT date_trunc('month'::text, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: (date_trunc('month'::text, hyper1d_2."time")), hyper1d_2.device, (PARTIAL avg(hyper1d_2.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT date_trunc('month'::text, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 (27 rows) @@ -5075,8 +5075,8 @@ GROUP BY 1,2 HAVING device > 4 - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: (time_bucket('@ 2 days'::interval, "time")), device, avg(temp) Group Key: (time_bucket('@ 2 days'::interval, "time")), device @@ -5091,19 +5091,19 @@ HAVING device > 4 Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper1d_1."time")), hyper1d_1.device, (PARTIAL avg(hyper1d_1.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper1d_2."time")), hyper1d_2.device, (PARTIAL avg(hyper1d_2.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 (27 rows) EXPLAIN (verbose, costs off) @@ -5114,8 +5114,8 @@ GROUP BY 1,2 HAVING avg(temp) > 40 AND max(temp) < 70 - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: (time_bucket('@ 2 days'::interval, "time")), device, avg(temp) Group Key: (time_bucket('@ 2 days'::interval, "time")), device @@ -5131,19 +5131,19 @@ HAVING avg(temp) > 40 AND max(temp) < 70 Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)), _timescaledb_internal.partialize_agg(max(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)), _timescaledb_internal.partialize_agg(max(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper1d_1."time")), hyper1d_1.device, (PARTIAL avg(hyper1d_1.temp)), (PARTIAL max(hyper1d_1.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)), _timescaledb_internal.partialize_agg(max(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)), _timescaledb_internal.partialize_agg(max(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper1d_2."time")), hyper1d_2.device, (PARTIAL avg(hyper1d_2.temp)), (PARTIAL max(hyper1d_2.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)), _timescaledb_internal.partialize_agg(max(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)), _timescaledb_internal.partialize_agg(max(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 (28 rows) @@ -5156,8 +5156,8 @@ WHERE time >= '2019-01-01' GROUP BY 1 ORDER BY 1 - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: device, avg(temp) Group Key: device @@ -5170,19 +5170,19 @@ ORDER BY 1 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1.device, (PARTIAL avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2.device, (PARTIAL avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST (25 rows) @@ -5195,8 +5195,8 @@ WHERE time >= '2019-01-01' AND (temp * random() >= 0) GROUP BY 1 ORDER BY 1 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: location, avg(temp) Group Key: location @@ -5212,7 +5212,7 @@ ORDER BY 1 Filter: ((hyper1d.temp * random()) >= '0'::double precision) Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT location, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST -> Partial GroupAggregate Output: hyper1d_1.location, PARTIAL avg(hyper1d_1.temp) Group Key: hyper1d_1.location @@ -5221,7 +5221,7 @@ ORDER BY 1 Filter: ((hyper1d_1.temp * random()) >= '0'::double precision) Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT location, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST -> Partial GroupAggregate Output: hyper1d_2.location, PARTIAL avg(hyper1d_2.temp) Group Key: hyper1d_2.location @@ -5230,7 +5230,7 @@ ORDER BY 1 Filter: ((hyper1d_2.temp * random()) >= '0'::double precision) Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT location, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST (34 rows) @@ -5243,8 +5243,8 @@ WHERE time >= '2019-01-01' GROUP BY 1,2 - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: (time_bucket('@ 2 days'::interval, hyper1d."time")), hyper1d.device, avg(hyper1d.temp), sum((hyper1d.temp * (((random() <= '1'::double precision))::integer)::double precision)) Group Key: (time_bucket('@ 2 days'::interval, hyper1d."time")), hyper1d.device @@ -5257,7 +5257,7 @@ GROUP BY 1,2 Output: time_bucket('@ 2 days'::interval, hyper1d."time"), hyper1d.device, hyper1d.temp Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Partial GroupAggregate Output: (time_bucket('@ 2 days'::interval, hyper1d_1."time")), hyper1d_1.device, PARTIAL avg(hyper1d_1.temp), PARTIAL sum((hyper1d_1.temp * (((random() <= '1'::double precision))::integer)::double precision)) Group Key: time_bucket('@ 2 days'::interval, hyper1d_1."time"), hyper1d_1.device @@ -5265,7 +5265,7 @@ GROUP BY 1,2 Output: time_bucket('@ 2 days'::interval, hyper1d_1."time"), hyper1d_1.device, hyper1d_1.temp Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Partial GroupAggregate Output: (time_bucket('@ 2 days'::interval, hyper1d_2."time")), hyper1d_2.device, PARTIAL avg(hyper1d_2.temp), PARTIAL sum((hyper1d_2.temp * (((random() <= '1'::double precision))::integer)::double precision)) Group Key: time_bucket('@ 2 days'::interval, hyper1d_2."time"), hyper1d_2.device @@ -5273,7 +5273,7 @@ GROUP BY 1,2 Output: time_bucket('@ 2 days'::interval, hyper1d_2."time"), hyper1d_2.device, hyper1d_2.temp Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (29 rows) @@ -5287,8 +5287,8 @@ GROUP BY 1,2 HAVING avg(temp) * custom_sum(device) > 0.8 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Append @@ -5300,7 +5300,7 @@ HAVING avg(temp) * custom_sum(device) > 0.8 Output: hyper1d."time", hyper1d.device, hyper1d.temp Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> GroupAggregate Output: hyper1d_1."time", hyper1d_1.device, avg(hyper1d_1.temp) Group Key: hyper1d_1."time", hyper1d_1.device @@ -5309,7 +5309,7 @@ HAVING avg(temp) * custom_sum(device) > 0.8 Output: hyper1d_1."time", hyper1d_1.device, hyper1d_1.temp Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> GroupAggregate Output: hyper1d_2."time", hyper1d_2.device, avg(hyper1d_2.temp) Group Key: hyper1d_2."time", hyper1d_2.device @@ -5318,7 +5318,7 @@ HAVING avg(temp) * custom_sum(device) > 0.8 Output: hyper1d_2."time", hyper1d_2.device, hyper1d_2.temp Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (30 rows) @@ -5331,8 +5331,8 @@ WHERE time >= '2019-01-01' GROUP BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)), (custom_sum(device)) -> Append @@ -5343,7 +5343,7 @@ GROUP BY 1,2 Output: hyper1d."time", hyper1d.device, hyper1d.temp Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> GroupAggregate Output: hyper1d_1."time", hyper1d_1.device, avg(hyper1d_1.temp), custom_sum(hyper1d_1.device) Group Key: hyper1d_1."time", hyper1d_1.device @@ -5351,7 +5351,7 @@ GROUP BY 1,2 Output: hyper1d_1."time", hyper1d_1.device, hyper1d_1.temp Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> GroupAggregate Output: hyper1d_2."time", hyper1d_2.device, avg(hyper1d_2.temp), custom_sum(hyper1d_2.device) Group Key: hyper1d_2."time", hyper1d_2.device @@ -5359,7 +5359,7 @@ GROUP BY 1,2 Output: hyper1d_2."time", hyper1d_2.device, hyper1d_2.temp Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (27 rows) @@ -5370,8 +5370,8 @@ GROUP BY 1,2 (1 row) - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Append @@ -5380,23 +5380,23 @@ GROUP BY 1,2 Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper1d_1."time", hyper1d_1.device, (avg(hyper1d_1.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper1d_2."time", hyper1d_2.device, (avg(hyper1d_2.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 (21 rows) - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Append @@ -5405,19 +5405,19 @@ GROUP BY 1,2 Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper1d_1."time", hyper1d_1.device, (avg(hyper1d_1.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper1d_2."time", hyper1d_2.device, (avg(hyper1d_2.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 (21 rows) tsl_override_current_timestamptz @@ -5425,8 +5425,8 @@ GROUP BY 1,2 (1 row) - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Append @@ -5435,19 +5435,19 @@ GROUP BY 1,2 Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper1d_1."time", hyper1d_1.device, (avg(hyper1d_1.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper1d_2."time", hyper1d_2.device, (avg(hyper1d_2.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 (21 rows) @@ -5458,8 +5458,8 @@ SELECT time, device FROM hyper1d LIMIT 10 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper1d."time", hyper1d.device -> Custom Scan (AsyncAppend) @@ -5469,17 +5469,17 @@ LIMIT 10 Output: hyper1d_1."time", hyper1d_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_2 Output: hyper1d_2."time", hyper1d_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_3 Output: hyper1d_3."time", hyper1d_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) LIMIT 10 (20 rows) @@ -5491,8 +5491,8 @@ FROM hyper1d LIMIT 5 OFFSET 5 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper1d."time", hyper1d.device -> Custom Scan (AsyncAppend) @@ -5502,17 +5502,17 @@ OFFSET 5 Output: hyper1d_1."time", hyper1d_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_2 Output: hyper1d_2."time", hyper1d_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_3 Output: hyper1d_3."time", hyper1d_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) LIMIT 10 (20 rows) @@ -5523,8 +5523,8 @@ SELECT time, device FROM hyper1d LIMIT 0 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------ Limit Output: hyper1d."time", hyper1d.device -> Custom Scan (AsyncAppend) @@ -5534,17 +5534,17 @@ LIMIT 0 Output: hyper1d_1."time", hyper1d_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 1 -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_2 Output: hyper1d_2."time", hyper1d_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 1 -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_3 Output: hyper1d_3."time", hyper1d_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) LIMIT 1 (20 rows) @@ -5555,8 +5555,8 @@ SELECT time, device FROM hyper1d LIMIT extract(year from date '2000-01-01') - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper1d."time", hyper1d.device -> Custom Scan (AsyncAppend) @@ -5566,17 +5566,17 @@ LIMIT extract(year from date '2000-01-01') Output: hyper1d_1."time", hyper1d_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 2000 -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_2 Output: hyper1d_2."time", hyper1d_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 2000 -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_3 Output: hyper1d_3."time", hyper1d_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) LIMIT 2000 (20 rows) @@ -5587,8 +5587,8 @@ SELECT time, device FROM hyper1d LIMIT greatest(random(), 10.0) - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper1d."time", hyper1d.device -> Custom Scan (AsyncAppend) @@ -5598,17 +5598,17 @@ LIMIT greatest(random(), 10.0) Output: hyper1d_1."time", hyper1d_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_2 Output: hyper1d_2."time", hyper1d_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_3 Output: hyper1d_3."time", hyper1d_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) (20 rows) @@ -5619,8 +5619,8 @@ SELECT time, device, avg(temp) OVER (PARTITION BY device) FROM hyper1d LIMIT 10 - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper1d."time", hyper1d.device, (avg(hyper1d.temp) OVER (?)) -> WindowAgg @@ -5633,17 +5633,17 @@ LIMIT 10 Output: hyper1d_1.device, hyper1d_1."time", hyper1d_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_2 Output: hyper1d_2.device, hyper1d_2."time", hyper1d_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_3 Output: hyper1d_3.device, hyper1d_3."time", hyper1d_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) ORDER BY device ASC NULLS LAST (23 rows) @@ -5654,8 +5654,8 @@ SELECT DISTINCT device, time FROM hyper1d LIMIT 10 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper1d.device, hyper1d."time" -> Unique @@ -5668,17 +5668,17 @@ LIMIT 10 Output: hyper1d_1.device, hyper1d_1."time" Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_2 Output: hyper1d_2.device, hyper1d_2."time" Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_3 Output: hyper1d_3.device, hyper1d_3."time" Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST (23 rows) @@ -5689,8 +5689,8 @@ SELECT DISTINCT ON (device) device, time FROM hyper1d LIMIT 10 - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper1d.device, hyper1d."time" -> Unique @@ -5703,24 +5703,24 @@ LIMIT 10 Output: hyper1d_1.device, hyper1d_1."time" Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_2 Output: hyper1d_2.device, hyper1d_2."time" Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_3 Output: hyper1d_3.device, hyper1d_3."time" Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) ORDER BY device ASC NULLS LAST (23 rows) ######### LIMIT push down cases - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: t."time" -> Nested Loop @@ -5733,17 +5733,17 @@ LIMIT 10 Output: t_1."time", t_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) -> Custom Scan (DataNodeScan) on public.hyper1d t_2 Output: t_2."time", t_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) -> Custom Scan (DataNodeScan) on public.hyper1d t_3 Output: t_3."time", t_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) -> Materialize Output: join_test.device -> Seq Scan on public.join_test @@ -5767,8 +5767,8 @@ FROM hyper1d INNER JOIN top_n USING (device) WHERE time >= '2019-01-01' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ GroupAggregate Output: (time_bucket('@ 1 min'::interval, hyper1d."time")), hyper1d.device, avg(hyper1d.temp) Group Key: time_bucket('@ 1 min'::interval, hyper1d."time"), hyper1d.device @@ -5784,17 +5784,17 @@ ORDER BY 1,2 Output: hyper1d_1."time", hyper1d_1.device, hyper1d_1.temp, time_bucket('@ 1 min'::interval, hyper1d_1."time") Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_2 Output: hyper1d_2."time", hyper1d_2.device, hyper1d_2.temp, time_bucket('@ 1 min'::interval, hyper1d_2."time") Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_3 Output: hyper1d_3."time", hyper1d_3.device, hyper1d_3.temp, time_bucket('@ 1 min'::interval, hyper1d_3."time") Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Materialize Output: top_n.device -> Subquery Scan on top_n @@ -5816,19 +5816,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper1d_5.device, (PARTIAL avg(hyper1d_5.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper1d_6.device, (PARTIAL avg(hyper1d_6.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST (60 rows) @@ -5841,8 +5841,8 @@ WHERE h1.time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND h2.time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ GroupAggregate Output: (time_bucket('@ 1 min'::interval, h1."time")), h1.device, avg(h1.temp), max(h2.temp) Group Key: time_bucket('@ 1 min'::interval, h1."time"), h1.device @@ -5853,7 +5853,7 @@ ORDER BY 1,2 Output: h2.temp, h2."time", h2.device, time_bucket('@ 1 min'::interval, h2."time") Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Materialize Output: h1."time", h1.device, h1.temp -> Custom Scan (AsyncAppend) @@ -5863,17 +5863,17 @@ ORDER BY 1,2 Output: h1_1."time", h1_1.device, h1_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper h1_2 Output: h1_2."time", h1_2.device, h1_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper h1_3 Output: h1_3."time", h1_3.device, h1_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (31 rows) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/tsl/test/expected/dist_query-14.out b/tsl/test/expected/dist_query-14.out index 2957b8a5213..75d1e8c774b 100644 --- a/tsl/test/expected/dist_query-14.out +++ b/tsl/test/expected/dist_query-14.out @@ -194,8 +194,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: "time", avg(temp) Group Key: "time" @@ -210,19 +210,19 @@ GROUP BY 1 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 -> Custom Scan (DataNodeScan) Output: hyper_1."time", (PARTIAL avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 -> Custom Scan (DataNodeScan) Output: hyper_2."time", (PARTIAL avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 (27 rows) @@ -235,8 +235,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: (time_bucket('@ 2 days'::interval, "time")), avg(temp) Group Key: (time_bucket('@ 2 days'::interval, "time")) @@ -251,19 +251,19 @@ GROUP BY 1 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), (PARTIAL avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), (PARTIAL avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 (27 rows) @@ -276,8 +276,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Append @@ -286,19 +286,19 @@ GROUP BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 (21 rows) @@ -311,8 +311,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: (time_bucket('@ 2 days'::interval, "time")), device, (avg(temp)) -> Append @@ -321,19 +321,19 @@ GROUP BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 (21 rows) @@ -346,8 +346,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: (date_trunc('month'::text, "time")), device, (avg(temp)) -> Append @@ -356,19 +356,19 @@ GROUP BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: (date_trunc('month'::text, hyper_1."time")), hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: (date_trunc('month'::text, hyper_2."time")), hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 (21 rows) @@ -382,8 +382,8 @@ GROUP BY 1,2 HAVING device > 4 - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: (time_bucket('@ 2 days'::interval, "time")), device, (avg(temp)) -> Append @@ -392,19 +392,19 @@ HAVING device > 4 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 (21 rows) EXPLAIN (verbose, costs off) @@ -415,8 +415,8 @@ GROUP BY 1,2 HAVING avg(temp) > 40 AND max(temp) < 70 - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: (time_bucket('@ 2 days'::interval, "time")), device, (avg(temp)) -> Append @@ -425,19 +425,19 @@ HAVING avg(temp) > 40 AND max(temp) < 70 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) (21 rows) @@ -450,8 +450,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1 - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: device, (avg(temp)) -> Append @@ -460,19 +460,19 @@ GROUP BY 1 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 -> Custom Scan (DataNodeScan) Output: hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 -> Custom Scan (DataNodeScan) Output: hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 (21 rows) @@ -485,8 +485,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND (temp * random() >= 0 GROUP BY 1 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate Output: hyper.location, avg(hyper.temp) Group Key: hyper.location @@ -499,19 +499,19 @@ GROUP BY 1 Filter: ((hyper_1.temp * random()) >= '0'::double precision) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.location, hyper_2.temp Filter: ((hyper_2.temp * random()) >= '0'::double precision) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.location, hyper_3.temp Filter: ((hyper_3.temp * random()) >= '0'::double precision) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST (25 rows) @@ -524,8 +524,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Append -> GroupAggregate Output: (time_bucket('@ 2 days'::interval, hyper."time")), hyper.device, avg(hyper.temp), sum((hyper.temp * (((random() <= '1'::double precision))::integer)::double precision)) @@ -534,7 +534,7 @@ GROUP BY 1,2 Output: time_bucket('@ 2 days'::interval, hyper."time"), hyper.device, hyper.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> GroupAggregate Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), hyper_1.device, avg(hyper_1.temp), sum((hyper_1.temp * (((random() <= '1'::double precision))::integer)::double precision)) Group Key: time_bucket('@ 2 days'::interval, hyper_1."time"), hyper_1.device @@ -542,7 +542,7 @@ GROUP BY 1,2 Output: time_bucket('@ 2 days'::interval, hyper_1."time"), hyper_1.device, hyper_1.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> GroupAggregate Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), hyper_2.device, avg(hyper_2.temp), sum((hyper_2.temp * (((random() <= '1'::double precision))::integer)::double precision)) Group Key: time_bucket('@ 2 days'::interval, hyper_2."time"), hyper_2.device @@ -550,7 +550,7 @@ GROUP BY 1,2 Output: time_bucket('@ 2 days'::interval, hyper_2."time"), hyper_2.device, hyper_2.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (25 rows) @@ -564,8 +564,8 @@ GROUP BY 1,2 HAVING avg(temp) * custom_sum(device) > 0.8 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Append @@ -577,7 +577,7 @@ HAVING avg(temp) * custom_sum(device) > 0.8 Output: hyper."time", hyper.device, hyper.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> GroupAggregate Output: hyper_1."time", hyper_1.device, avg(hyper_1.temp) Group Key: hyper_1."time", hyper_1.device @@ -586,7 +586,7 @@ HAVING avg(temp) * custom_sum(device) > 0.8 Output: hyper_1."time", hyper_1.device, hyper_1.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> GroupAggregate Output: hyper_2."time", hyper_2.device, avg(hyper_2.temp) Group Key: hyper_2."time", hyper_2.device @@ -595,7 +595,7 @@ HAVING avg(temp) * custom_sum(device) > 0.8 Output: hyper_2."time", hyper_2.device, hyper_2.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (30 rows) @@ -608,8 +608,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)), (custom_sum(device)) -> Append @@ -620,7 +620,7 @@ GROUP BY 1,2 Output: hyper."time", hyper.device, hyper.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> GroupAggregate Output: hyper_1."time", hyper_1.device, avg(hyper_1.temp), custom_sum(hyper_1.device) Group Key: hyper_1."time", hyper_1.device @@ -628,7 +628,7 @@ GROUP BY 1,2 Output: hyper_1."time", hyper_1.device, hyper_1.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> GroupAggregate Output: hyper_2."time", hyper_2.device, avg(hyper_2.temp), custom_sum(hyper_2.device) Group Key: hyper_2."time", hyper_2.device @@ -636,7 +636,7 @@ GROUP BY 1,2 Output: hyper_2."time", hyper_2.device, hyper_2.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (27 rows) @@ -647,8 +647,8 @@ GROUP BY 1,2 (1 row) - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Append @@ -657,23 +657,23 @@ GROUP BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 (21 rows) - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Append @@ -682,19 +682,19 @@ GROUP BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 (21 rows) tsl_override_current_timestamptz @@ -702,8 +702,8 @@ GROUP BY 1,2 (1 row) - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Append @@ -712,19 +712,19 @@ GROUP BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 (21 rows) @@ -746,17 +746,17 @@ LIMIT 10 Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) LIMIT 10 (20 rows) @@ -779,17 +779,17 @@ OFFSET 5 Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) LIMIT 10 (20 rows) @@ -811,17 +811,17 @@ LIMIT 0 Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 1 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 1 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) LIMIT 1 (20 rows) @@ -843,17 +843,17 @@ LIMIT extract(year from date '2000-01-01') Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 2000 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 2000 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) LIMIT 2000 (20 rows) @@ -875,17 +875,17 @@ LIMIT greatest(random(), 10.0) Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) (20 rows) @@ -910,17 +910,17 @@ LIMIT 10 Output: hyper_1.device, hyper_1."time", hyper_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.device, hyper_2."time", hyper_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.device, hyper_3."time", hyper_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST (23 rows) @@ -931,8 +931,8 @@ SELECT DISTINCT device, time FROM hyper LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper.device, hyper."time" -> Unique @@ -945,17 +945,17 @@ LIMIT 10 Output: hyper_1.device, hyper_1."time" Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.device, hyper_2."time" Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.device, hyper_3."time" Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST (23 rows) @@ -966,8 +966,8 @@ SELECT DISTINCT ON (device) device, time FROM hyper LIMIT 10 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper.device, hyper."time" -> Unique @@ -980,17 +980,17 @@ LIMIT 10 Output: hyper_1.device, hyper_1."time" Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.device, hyper_2."time" Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.device, hyper_3."time" Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST (23 rows) @@ -1010,17 +1010,17 @@ LIMIT 10 Output: t_1."time", t_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) -> Custom Scan (DataNodeScan) on public.hyper t_2 Output: t_2."time", t_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) -> Custom Scan (DataNodeScan) on public.hyper t_3 Output: t_3."time", t_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) -> Materialize Output: join_test.device -> Seq Scan on public.join_test @@ -1044,8 +1044,8 @@ FROM hyper INNER JOIN top_n USING (device) WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ GroupAggregate Output: (time_bucket('@ 1 min'::interval, hyper."time")), hyper.device, avg(hyper.temp) Group Key: time_bucket('@ 1 min'::interval, hyper."time"), hyper.device @@ -1061,17 +1061,17 @@ ORDER BY 1,2 Output: hyper_1."time", hyper_1.device, hyper_1.temp, time_bucket('@ 1 min'::interval, hyper_1."time") Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device, hyper_2.temp, time_bucket('@ 1 min'::interval, hyper_2."time") Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device, hyper_3.temp, time_bucket('@ 1 min'::interval, hyper_3."time") Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Materialize Output: top_n.device -> Subquery Scan on top_n @@ -1089,19 +1089,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_5.device, (avg(hyper_5.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_6.device, (avg(hyper_6.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST (56 rows) @@ -1114,8 +1114,8 @@ WHERE h1.time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND h2.time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ GroupAggregate Output: (time_bucket('@ 1 min'::interval, h1."time")), h1.device, avg(h1.temp), max(h2.temp) Group Key: time_bucket('@ 1 min'::interval, h1."time"), h1.device @@ -1126,7 +1126,7 @@ ORDER BY 1,2 Output: h2.temp, h2."time", h2.device, time_bucket('@ 1 min'::interval, h2."time") Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Materialize Output: h1."time", h1.device, h1.temp -> Custom Scan (AsyncAppend) @@ -1136,17 +1136,17 @@ ORDER BY 1,2 Output: h1_1."time", h1_1.device, h1_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper h1_2 Output: h1_2."time", h1_2.device, h1_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper h1_3 Output: h1_3."time", h1_3.device, h1_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (31 rows) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -1172,8 +1172,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1 ORDER BY 1 - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: "time", avg(temp) Group Key: "time" @@ -1186,19 +1186,19 @@ ORDER BY 1 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1."time", (PARTIAL avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2."time", (PARTIAL avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST (25 rows) @@ -1211,8 +1211,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1 ORDER BY 1 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: (time_bucket('@ 2 days'::interval, "time")), avg(temp) Group Key: (time_bucket('@ 2 days'::interval, "time")) @@ -1225,19 +1225,19 @@ ORDER BY 1 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), (PARTIAL avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), (PARTIAL avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST (25 rows) @@ -1250,8 +1250,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Merge Append @@ -1261,19 +1261,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (22 rows) @@ -1286,8 +1286,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: (time_bucket('@ 2 days'::interval, "time")), device, (avg(temp)) -> Merge Append @@ -1297,19 +1297,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (22 rows) @@ -1322,8 +1322,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: (date_trunc('month'::text, "time")), device, (avg(temp)) -> Merge Append @@ -1333,19 +1333,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (date_trunc('month'::text, hyper_1."time")), hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (date_trunc('month'::text, hyper_2."time")), hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST (22 rows) @@ -1359,8 +1359,8 @@ GROUP BY 1,2 HAVING device > 4 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Custom Scan (AsyncAppend) Output: (time_bucket('@ 2 days'::interval, "time")), device, (avg(temp)) -> Merge Append @@ -1370,19 +1370,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (22 rows) EXPLAIN (verbose, costs off) @@ -1393,8 +1393,8 @@ GROUP BY 1,2 HAVING avg(temp) > 40 AND max(temp) < 70 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Sort Output: (time_bucket('@ 2 days'::interval, "time")), device, (avg(temp)) Sort Key: (time_bucket('@ 2 days'::interval, "time")), device @@ -1406,19 +1406,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (24 rows) @@ -1431,8 +1431,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1 ORDER BY 1 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: device, (avg(temp)) -> Merge Append @@ -1442,19 +1442,19 @@ ORDER BY 1 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST (22 rows) @@ -1467,8 +1467,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND (temp * random() >= 0 GROUP BY 1 ORDER BY 1 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate Output: hyper.location, avg(hyper.temp) Group Key: hyper.location @@ -1481,19 +1481,19 @@ ORDER BY 1 Filter: ((hyper_1.temp * random()) >= '0'::double precision) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.location, hyper_2.temp Filter: ((hyper_2.temp * random()) >= '0'::double precision) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.location, hyper_3.temp Filter: ((hyper_3.temp * random()) >= '0'::double precision) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST (25 rows) @@ -1506,8 +1506,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate Output: (time_bucket('@ 2 days'::interval, hyper."time")), hyper.device, avg(hyper.temp), sum((hyper.temp * (((random() <= '1'::double precision))::integer)::double precision)) Group Key: (time_bucket('@ 2 days'::interval, hyper."time")), hyper.device @@ -1519,17 +1519,17 @@ ORDER BY 1,2 Output: time_bucket('@ 2 days'::interval, hyper_1."time"), hyper_1.device, hyper_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: time_bucket('@ 2 days'::interval, hyper_2."time"), hyper_2.device, hyper_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: time_bucket('@ 2 days'::interval, hyper_3."time"), hyper_3.device, hyper_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (22 rows) @@ -1543,8 +1543,8 @@ GROUP BY 1,2 HAVING avg(temp) * custom_sum(device) > 0.8 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ GroupAggregate Output: hyper."time", hyper.device, avg(hyper.temp) Group Key: hyper."time", hyper.device @@ -1557,17 +1557,17 @@ ORDER BY 1,2 Output: hyper_1."time", hyper_1.device, hyper_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device, hyper_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device, hyper_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (23 rows) @@ -1580,8 +1580,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ GroupAggregate Output: hyper."time", hyper.device, avg(hyper.temp), custom_sum(hyper.device) Group Key: hyper."time", hyper.device @@ -1593,17 +1593,17 @@ ORDER BY 1,2 Output: hyper_1."time", hyper_1.device, hyper_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device, hyper_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device, hyper_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (22 rows) @@ -1614,8 +1614,8 @@ ORDER BY 1,2 (1 row) - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Merge Append @@ -1625,23 +1625,23 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (22 rows) - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Merge Append @@ -1651,19 +1651,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (22 rows) tsl_override_current_timestamptz @@ -1671,8 +1671,8 @@ ORDER BY 1,2 (1 row) - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Merge Append @@ -1682,19 +1682,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (22 rows) @@ -1705,8 +1705,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -1717,17 +1717,17 @@ LIMIT 10 Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 (21 rows) @@ -1739,8 +1739,8 @@ FROM hyper ORDER BY 1,2 LIMIT 5 OFFSET 5 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -1751,17 +1751,17 @@ OFFSET 5 Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 (21 rows) @@ -1772,8 +1772,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT 0 - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -1784,17 +1784,17 @@ LIMIT 0 Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 (21 rows) @@ -1805,8 +1805,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT extract(year from date '2000-01-01') - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -1817,17 +1817,17 @@ LIMIT extract(year from date '2000-01-01') Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 (21 rows) @@ -1838,8 +1838,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT greatest(random(), 10.0) - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -1850,17 +1850,17 @@ LIMIT greatest(random(), 10.0) Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (21 rows) @@ -1888,17 +1888,17 @@ LIMIT 10 Output: hyper_1.device, hyper_1."time", hyper_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.device, hyper_2."time", hyper_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.device, hyper_3."time", hyper_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST (26 rows) @@ -1909,8 +1909,8 @@ SELECT DISTINCT device, time FROM hyper ORDER BY 1,2 LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper.device, hyper."time" -> Unique @@ -1923,17 +1923,17 @@ LIMIT 10 Output: hyper_1.device, hyper_1."time" Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.device, hyper_2."time" Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.device, hyper_3."time" Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST (23 rows) @@ -1944,8 +1944,8 @@ SELECT DISTINCT ON (device) device, time FROM hyper ORDER BY 1,2 LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper.device, hyper."time" -> Unique @@ -1958,17 +1958,17 @@ LIMIT 10 Output: hyper_1.device, hyper_1."time" Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.device, hyper_2."time" Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.device, hyper_3."time" Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST (23 rows) @@ -1988,17 +1988,17 @@ LIMIT 10 Output: t_1."time", t_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) -> Custom Scan (DataNodeScan) on public.hyper t_2 Output: t_2."time", t_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) -> Custom Scan (DataNodeScan) on public.hyper t_3 Output: t_3."time", t_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) -> Materialize Output: join_test.device -> Seq Scan on public.join_test @@ -2022,8 +2022,8 @@ FROM hyper INNER JOIN top_n USING (device) WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ GroupAggregate Output: (time_bucket('@ 1 min'::interval, hyper."time")), hyper.device, avg(hyper.temp) Group Key: time_bucket('@ 1 min'::interval, hyper."time"), hyper.device @@ -2039,17 +2039,17 @@ ORDER BY 1,2 Output: hyper_1."time", hyper_1.device, hyper_1.temp, time_bucket('@ 1 min'::interval, hyper_1."time") Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device, hyper_2.temp, time_bucket('@ 1 min'::interval, hyper_2."time") Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device, hyper_3.temp, time_bucket('@ 1 min'::interval, hyper_3."time") Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Materialize Output: top_n.device -> Subquery Scan on top_n @@ -2067,19 +2067,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_5.device, (avg(hyper_5.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_6.device, (avg(hyper_6.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST (56 rows) @@ -2092,8 +2092,8 @@ WHERE h1.time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND h2.time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ GroupAggregate Output: (time_bucket('@ 1 min'::interval, h1."time")), h1.device, avg(h1.temp), max(h2.temp) Group Key: time_bucket('@ 1 min'::interval, h1."time"), h1.device @@ -2104,7 +2104,7 @@ ORDER BY 1,2 Output: h2.temp, h2."time", h2.device, time_bucket('@ 1 min'::interval, h2."time") Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Materialize Output: h1."time", h1.device, h1.temp -> Custom Scan (AsyncAppend) @@ -2114,17 +2114,17 @@ ORDER BY 1,2 Output: h1_1."time", h1_1.device, h1_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper h1_2 Output: h1_2."time", h1_2.device, h1_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper h1_3 Output: h1_3."time", h1_3.device, h1_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (31 rows) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -2150,14 +2150,14 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND device = 1 GROUP BY 1 ORDER BY 1 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) Output: hyper."time", (avg(hyper.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST (6 rows) @@ -2170,14 +2170,14 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND device = 1 GROUP BY 1 ORDER BY 1 - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper."time")), (avg(hyper.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST (6 rows) @@ -2190,14 +2190,14 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND device = 1 GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) Output: hyper."time", hyper.device, (avg(hyper.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST (6 rows) @@ -2210,14 +2210,14 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND device = 1 GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper."time")), hyper.device, (avg(hyper.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST (6 rows) @@ -2230,14 +2230,14 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND device = 1 GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) Output: (date_trunc('month'::text, hyper."time")), hyper.device, (avg(hyper.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST + Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST (6 rows) @@ -2272,14 +2272,14 @@ GROUP BY 1,2 HAVING avg(temp) > 40 AND max(temp) < 70 ORDER BY 1,2 - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper."time")), hyper.device, (avg(hyper.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST (6 rows) @@ -2292,14 +2292,14 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND device = 1 GROUP BY 1 ORDER BY 1 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) Output: hyper.device, (avg(hyper.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1 + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1 (6 rows) @@ -2312,8 +2312,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND device = 1 AND (temp GROUP BY 1 ORDER BY 1 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate Output: hyper.location, avg(hyper.temp) Group Key: hyper.location @@ -2322,7 +2322,7 @@ ORDER BY 1 Filter: ((hyper.temp * random()) >= '0'::double precision) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) ORDER BY location ASC NULLS LAST (9 rows) @@ -2335,8 +2335,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND device = 1 GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ GroupAggregate Output: (time_bucket('@ 2 days'::interval, hyper."time")), hyper.device, avg(hyper.temp), sum((hyper.temp * (((random() <= '1'::double precision))::integer)::double precision)) Group Key: time_bucket('@ 2 days'::interval, hyper."time"), hyper.device @@ -2344,7 +2344,7 @@ ORDER BY 1,2 Output: time_bucket('@ 2 days'::interval, hyper."time"), hyper.device, hyper.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST (8 rows) @@ -2358,8 +2358,8 @@ GROUP BY 1,2 HAVING avg(temp) * custom_sum(device) > 0.8 ORDER BY 1,2 - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate Output: hyper."time", hyper.device, avg(hyper.temp) Group Key: hyper."time", hyper.device @@ -2368,7 +2368,7 @@ ORDER BY 1,2 Output: hyper."time", hyper.device, hyper.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) ORDER BY "time" ASC NULLS LAST (9 rows) @@ -2381,8 +2381,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND device = 1 GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate Output: hyper."time", hyper.device, avg(hyper.temp), custom_sum(hyper.device) Group Key: hyper."time", hyper.device @@ -2390,7 +2390,7 @@ ORDER BY 1,2 Output: hyper."time", hyper.device, hyper.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) ORDER BY "time" ASC NULLS LAST (8 rows) @@ -2401,24 +2401,24 @@ ORDER BY 1,2 (1 row) - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) Output: hyper."time", hyper.device, (avg(hyper.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST (6 rows) - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) Output: hyper."time", hyper.device, (avg(hyper.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST (6 rows) tsl_override_current_timestamptz @@ -2426,14 +2426,14 @@ ORDER BY 1,2 (1 row) - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) Output: hyper."time", hyper.device, (avg(hyper.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST (6 rows) @@ -2444,8 +2444,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -2456,17 +2456,17 @@ LIMIT 10 Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 (21 rows) @@ -2478,8 +2478,8 @@ FROM hyper ORDER BY 1,2 LIMIT 5 OFFSET 5 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -2490,17 +2490,17 @@ OFFSET 5 Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 (21 rows) @@ -2511,8 +2511,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT 0 - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -2523,17 +2523,17 @@ LIMIT 0 Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 (21 rows) @@ -2544,8 +2544,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT extract(year from date '2000-01-01') - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -2556,17 +2556,17 @@ LIMIT extract(year from date '2000-01-01') Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 (21 rows) @@ -2577,8 +2577,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT greatest(random(), 10.0) - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -2589,17 +2589,17 @@ LIMIT greatest(random(), 10.0) Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (21 rows) @@ -2627,17 +2627,17 @@ LIMIT 10 Output: hyper_1.device, hyper_1."time", hyper_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.device, hyper_2."time", hyper_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.device, hyper_3."time", hyper_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST (26 rows) @@ -2648,8 +2648,8 @@ SELECT DISTINCT device, time FROM hyper ORDER BY 1,2 LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper.device, hyper."time" -> Unique @@ -2662,17 +2662,17 @@ LIMIT 10 Output: hyper_1.device, hyper_1."time" Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.device, hyper_2."time" Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.device, hyper_3."time" Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST (23 rows) @@ -2683,8 +2683,8 @@ SELECT DISTINCT ON (device) device, time FROM hyper ORDER BY 1,2 LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper.device, hyper."time" -> Unique @@ -2697,17 +2697,17 @@ LIMIT 10 Output: hyper_1.device, hyper_1."time" Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.device, hyper_2."time" Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.device, hyper_3."time" Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST (23 rows) @@ -2727,17 +2727,17 @@ LIMIT 10 Output: t_1."time", t_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) -> Custom Scan (DataNodeScan) on public.hyper t_2 Output: t_2."time", t_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) -> Custom Scan (DataNodeScan) on public.hyper t_3 Output: t_3."time", t_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) -> Materialize Output: join_test.device -> Seq Scan on public.join_test @@ -2761,8 +2761,8 @@ FROM hyper INNER JOIN top_n USING (device) WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND device = 1 GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate Output: (time_bucket('@ 1 min'::interval, hyper."time")), hyper.device, avg(hyper.temp) Group Key: (time_bucket('@ 1 min'::interval, hyper."time")), hyper.device @@ -2772,7 +2772,7 @@ ORDER BY 1,2 Output: hyper."time", hyper.device, hyper.temp, time_bucket('@ 1 min'::interval, hyper."time") Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST -> Materialize Output: top_n.device -> Subquery Scan on top_n @@ -2785,7 +2785,7 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1 ORDER BY avg(temp) DESC NULLS FIRST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1 ORDER BY avg(temp) DESC NULLS FIRST (23 rows) @@ -2798,8 +2798,8 @@ WHERE h1.time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND h2.time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ GroupAggregate Output: (time_bucket('@ 1 min'::interval, h1."time")), h1.device, avg(h1.temp), max(h2.temp) Group Key: time_bucket('@ 1 min'::interval, h1."time"), h1.device @@ -2810,7 +2810,7 @@ ORDER BY 1,2 Output: h2.temp, h2."time", h2.device, time_bucket('@ 1 min'::interval, h2."time") Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Materialize Output: h1."time", h1.device, h1.temp -> Custom Scan (AsyncAppend) @@ -2820,17 +2820,17 @@ ORDER BY 1,2 Output: h1_1."time", h1_1.device, h1_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper h1_2 Output: h1_2."time", h1_2.device, h1_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper h1_3 Output: h1_3."time", h1_3.device, h1_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (31 rows) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -2856,8 +2856,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1 ORDER BY 1 LIMIT 10 - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: "time", (avg(temp)) -> Finalize GroupAggregate @@ -2872,19 +2872,19 @@ LIMIT 10 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1."time", (PARTIAL avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2."time", (PARTIAL avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST (27 rows) @@ -2897,8 +2897,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1 ORDER BY 1 LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: (time_bucket('@ 2 days'::interval, "time")), (avg(temp)) -> Finalize GroupAggregate @@ -2913,19 +2913,19 @@ LIMIT 10 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), (PARTIAL avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), (PARTIAL avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST (27 rows) @@ -2938,8 +2938,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 LIMIT 10 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: "time", device, (avg(temp)) -> Custom Scan (AsyncAppend) @@ -2951,19 +2951,19 @@ LIMIT 10 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (24 rows) @@ -2976,8 +2976,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 LIMIT 10 - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: (time_bucket('@ 2 days'::interval, "time")), device, (avg(temp)) -> Custom Scan (AsyncAppend) @@ -2989,19 +2989,19 @@ LIMIT 10 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (24 rows) @@ -3014,8 +3014,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 LIMIT 10 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: (date_trunc('month'::text, "time")), device, (avg(temp)) -> Custom Scan (AsyncAppend) @@ -3027,19 +3027,19 @@ LIMIT 10 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (date_trunc('month'::text, hyper_1."time")), hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (date_trunc('month'::text, hyper_2."time")), hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST (24 rows) @@ -3053,8 +3053,8 @@ GROUP BY 1,2 HAVING device > 4 ORDER BY 1,2 LIMIT 10 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Limit Output: (time_bucket('@ 2 days'::interval, "time")), device, (avg(temp)) -> Custom Scan (AsyncAppend) @@ -3066,19 +3066,19 @@ LIMIT 10 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (24 rows) EXPLAIN (verbose, costs off) @@ -3089,8 +3089,8 @@ GROUP BY 1,2 HAVING avg(temp) > 40 AND max(temp) < 70 ORDER BY 1,2 LIMIT 10 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Limit Output: (time_bucket('@ 2 days'::interval, "time")), device, (avg(temp)) -> Sort @@ -3104,19 +3104,19 @@ LIMIT 10 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (26 rows) @@ -3129,8 +3129,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1 ORDER BY 1 LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: device, (avg(temp)) -> Custom Scan (AsyncAppend) @@ -3142,19 +3142,19 @@ LIMIT 10 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST (24 rows) @@ -3167,8 +3167,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND (temp * random() >= 0 GROUP BY 1 ORDER BY 1 LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper.location, (avg(hyper.temp)) -> GroupAggregate @@ -3183,19 +3183,19 @@ LIMIT 10 Filter: ((hyper_1.temp * random()) >= '0'::double precision) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.location, hyper_2.temp Filter: ((hyper_2.temp * random()) >= '0'::double precision) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.location, hyper_3.temp Filter: ((hyper_3.temp * random()) >= '0'::double precision) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST (27 rows) @@ -3208,8 +3208,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 LIMIT 10 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: (time_bucket('@ 2 days'::interval, hyper."time")), hyper.device, (avg(hyper.temp)), (sum((hyper.temp * (((random() <= '1'::double precision))::integer)::double precision))) -> GroupAggregate @@ -3223,17 +3223,17 @@ LIMIT 10 Output: time_bucket('@ 2 days'::interval, hyper_1."time"), hyper_1.device, hyper_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: time_bucket('@ 2 days'::interval, hyper_2."time"), hyper_2.device, hyper_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: time_bucket('@ 2 days'::interval, hyper_3."time"), hyper_3.device, hyper_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (24 rows) @@ -3247,8 +3247,8 @@ GROUP BY 1,2 HAVING avg(temp) * custom_sum(device) > 0.8 ORDER BY 1,2 LIMIT 10 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Limit Output: hyper."time", hyper.device, (avg(hyper.temp)) -> GroupAggregate @@ -3263,17 +3263,17 @@ LIMIT 10 Output: hyper_1."time", hyper_1.device, hyper_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device, hyper_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device, hyper_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (25 rows) @@ -3286,8 +3286,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 LIMIT 10 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Limit Output: hyper."time", hyper.device, (avg(hyper.temp)), (custom_sum(hyper.device)) -> GroupAggregate @@ -3301,17 +3301,17 @@ LIMIT 10 Output: hyper_1."time", hyper_1.device, hyper_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device, hyper_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device, hyper_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (24 rows) @@ -3322,8 +3322,8 @@ LIMIT 10 (1 row) - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: "time", device, (avg(temp)) -> Custom Scan (AsyncAppend) @@ -3335,23 +3335,23 @@ LIMIT 10 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (24 rows) - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: "time", device, (avg(temp)) -> Custom Scan (AsyncAppend) @@ -3363,19 +3363,19 @@ LIMIT 10 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (24 rows) tsl_override_current_timestamptz @@ -3383,8 +3383,8 @@ LIMIT 10 (1 row) - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: "time", device, (avg(temp)) -> Custom Scan (AsyncAppend) @@ -3396,19 +3396,19 @@ LIMIT 10 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (24 rows) @@ -3419,8 +3419,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -3431,17 +3431,17 @@ LIMIT 10 Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 (21 rows) @@ -3453,8 +3453,8 @@ FROM hyper ORDER BY 1,2 LIMIT 5 OFFSET 5 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -3465,17 +3465,17 @@ OFFSET 5 Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 (21 rows) @@ -3486,8 +3486,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT 0 - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -3498,17 +3498,17 @@ LIMIT 0 Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 (21 rows) @@ -3519,8 +3519,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT extract(year from date '2000-01-01') - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -3531,17 +3531,17 @@ LIMIT extract(year from date '2000-01-01') Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 (21 rows) @@ -3552,8 +3552,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT greatest(random(), 10.0) - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -3564,17 +3564,17 @@ LIMIT greatest(random(), 10.0) Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (21 rows) @@ -3602,17 +3602,17 @@ LIMIT 10 Output: hyper_1.device, hyper_1."time", hyper_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.device, hyper_2."time", hyper_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.device, hyper_3."time", hyper_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST (26 rows) @@ -3623,8 +3623,8 @@ SELECT DISTINCT device, time FROM hyper ORDER BY 1,2 LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper.device, hyper."time" -> Unique @@ -3637,17 +3637,17 @@ LIMIT 10 Output: hyper_1.device, hyper_1."time" Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.device, hyper_2."time" Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.device, hyper_3."time" Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST (23 rows) @@ -3658,8 +3658,8 @@ SELECT DISTINCT ON (device) device, time FROM hyper ORDER BY 1,2 LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper.device, hyper."time" -> Unique @@ -3672,17 +3672,17 @@ LIMIT 10 Output: hyper_1.device, hyper_1."time" Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.device, hyper_2."time" Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.device, hyper_3."time" Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST (23 rows) @@ -3702,17 +3702,17 @@ LIMIT 10 Output: t_1."time", t_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) -> Custom Scan (DataNodeScan) on public.hyper t_2 Output: t_2."time", t_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) -> Custom Scan (DataNodeScan) on public.hyper t_3 Output: t_3."time", t_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) -> Materialize Output: join_test.device -> Seq Scan on public.join_test @@ -3736,8 +3736,8 @@ FROM hyper INNER JOIN top_n USING (device) WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ GroupAggregate Output: (time_bucket('@ 1 min'::interval, hyper."time")), hyper.device, avg(hyper.temp) Group Key: time_bucket('@ 1 min'::interval, hyper."time"), hyper.device @@ -3753,17 +3753,17 @@ ORDER BY 1,2 Output: hyper_1."time", hyper_1.device, hyper_1.temp, time_bucket('@ 1 min'::interval, hyper_1."time") Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device, hyper_2.temp, time_bucket('@ 1 min'::interval, hyper_2."time") Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device, hyper_3.temp, time_bucket('@ 1 min'::interval, hyper_3."time") Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Materialize Output: top_n.device -> Subquery Scan on top_n @@ -3781,19 +3781,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_5.device, (avg(hyper_5.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_6.device, (avg(hyper_6.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST (56 rows) @@ -3806,8 +3806,8 @@ WHERE h1.time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND h2.time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ GroupAggregate Output: (time_bucket('@ 1 min'::interval, h1."time")), h1.device, avg(h1.temp), max(h2.temp) Group Key: time_bucket('@ 1 min'::interval, h1."time"), h1.device @@ -3818,7 +3818,7 @@ ORDER BY 1,2 Output: h2.temp, h2."time", h2.device, time_bucket('@ 1 min'::interval, h2."time") Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Materialize Output: h1."time", h1.device, h1.temp -> Custom Scan (AsyncAppend) @@ -3828,17 +3828,17 @@ ORDER BY 1,2 Output: h1_1."time", h1_1.device, h1_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper h1_2 Output: h1_2."time", h1_2.device, h1_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper h1_3 Output: h1_3."time", h1_3.device, h1_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (31 rows) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -3864,8 +3864,8 @@ WHERE time >= '2019-01-01' GROUP BY 1 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: "time", avg(temp) Group Key: "time" @@ -3880,19 +3880,19 @@ GROUP BY 1 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 -> Custom Scan (DataNodeScan) Output: hyper_1."time", (PARTIAL avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 -> Custom Scan (DataNodeScan) Output: hyper_2."time", (PARTIAL avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 (27 rows) @@ -3905,8 +3905,8 @@ WHERE time >= '2019-01-01' GROUP BY 1 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: (time_bucket('@ 2 days'::interval, "time")), avg(temp) Group Key: (time_bucket('@ 2 days'::interval, "time")) @@ -3921,19 +3921,19 @@ GROUP BY 1 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), (PARTIAL avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), (PARTIAL avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 (27 rows) @@ -3946,8 +3946,8 @@ WHERE time >= '2019-01-01' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Merge Append @@ -3957,19 +3957,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (22 rows) @@ -3982,8 +3982,8 @@ WHERE time >= '2019-01-01' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: (time_bucket('@ 2 days'::interval, "time")), device, avg(temp) Group Key: (time_bucket('@ 2 days'::interval, "time")), device @@ -3996,19 +3996,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), hyper_1.device, (PARTIAL avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), hyper_2.device, (PARTIAL avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (25 rows) @@ -4021,8 +4021,8 @@ WHERE time >= '2019-01-01' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Finalize GroupAggregate Output: (date_trunc('month'::text, "time")), device, avg(temp) Group Key: (date_trunc('month'::text, "time")), device @@ -4035,19 +4035,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT date_trunc('month'::text, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (date_trunc('month'::text, hyper_1."time")), hyper_1.device, (PARTIAL avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT date_trunc('month'::text, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (date_trunc('month'::text, hyper_2."time")), hyper_2.device, (PARTIAL avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT date_trunc('month'::text, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST (25 rows) @@ -4061,8 +4061,8 @@ GROUP BY 1,2 HAVING device > 4 ORDER BY 1,2 - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: (time_bucket('@ 2 days'::interval, "time")), device, avg(temp) Group Key: (time_bucket('@ 2 days'::interval, "time")), device @@ -4075,19 +4075,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), hyper_1.device, (PARTIAL avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), hyper_2.device, (PARTIAL avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (25 rows) EXPLAIN (verbose, costs off) @@ -4098,8 +4098,8 @@ GROUP BY 1,2 HAVING avg(temp) > 40 AND max(temp) < 70 ORDER BY 1,2 - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: (time_bucket('@ 2 days'::interval, "time")), device, avg(temp) Group Key: (time_bucket('@ 2 days'::interval, "time")), device @@ -4113,19 +4113,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)), _timescaledb_internal.partialize_agg(max(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)), _timescaledb_internal.partialize_agg(max(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), hyper_1.device, (PARTIAL avg(hyper_1.temp)), (PARTIAL max(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)), _timescaledb_internal.partialize_agg(max(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)), _timescaledb_internal.partialize_agg(max(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), hyper_2.device, (PARTIAL avg(hyper_2.temp)), (PARTIAL max(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)), _timescaledb_internal.partialize_agg(max(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)), _timescaledb_internal.partialize_agg(max(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (26 rows) @@ -4138,8 +4138,8 @@ WHERE time >= '2019-01-01' GROUP BY 1 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: device, avg(temp) Group Key: device @@ -4154,19 +4154,19 @@ GROUP BY 1 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 -> Custom Scan (DataNodeScan) Output: hyper_1.device, (PARTIAL avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 -> Custom Scan (DataNodeScan) Output: hyper_2.device, (PARTIAL avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 (27 rows) @@ -4179,8 +4179,8 @@ WHERE time >= '2019-01-01' AND (temp * random() >= 0) GROUP BY 1 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Finalize GroupAggregate Output: location, avg(temp) Group Key: location @@ -4196,7 +4196,7 @@ GROUP BY 1 Filter: ((hyper.temp * random()) >= '0'::double precision) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST -> Partial GroupAggregate Output: hyper_1.location, PARTIAL avg(hyper_1.temp) Group Key: hyper_1.location @@ -4205,7 +4205,7 @@ GROUP BY 1 Filter: ((hyper_1.temp * random()) >= '0'::double precision) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST -> Partial GroupAggregate Output: hyper_2.location, PARTIAL avg(hyper_2.temp) Group Key: hyper_2.location @@ -4214,7 +4214,7 @@ GROUP BY 1 Filter: ((hyper_2.temp * random()) >= '0'::double precision) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST (34 rows) @@ -4227,8 +4227,8 @@ WHERE time >= '2019-01-01' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: (time_bucket('@ 2 days'::interval, hyper."time")), hyper.device, avg(hyper.temp), sum((hyper.temp * (((random() <= '1'::double precision))::integer)::double precision)) Group Key: (time_bucket('@ 2 days'::interval, hyper."time")), hyper.device @@ -4241,7 +4241,7 @@ ORDER BY 1,2 Output: time_bucket('@ 2 days'::interval, hyper."time"), hyper.device, hyper.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Partial GroupAggregate Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), hyper_1.device, PARTIAL avg(hyper_1.temp), PARTIAL sum((hyper_1.temp * (((random() <= '1'::double precision))::integer)::double precision)) Group Key: time_bucket('@ 2 days'::interval, hyper_1."time"), hyper_1.device @@ -4249,7 +4249,7 @@ ORDER BY 1,2 Output: time_bucket('@ 2 days'::interval, hyper_1."time"), hyper_1.device, hyper_1.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Partial GroupAggregate Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), hyper_2.device, PARTIAL avg(hyper_2.temp), PARTIAL sum((hyper_2.temp * (((random() <= '1'::double precision))::integer)::double precision)) Group Key: time_bucket('@ 2 days'::interval, hyper_2."time"), hyper_2.device @@ -4257,7 +4257,7 @@ ORDER BY 1,2 Output: time_bucket('@ 2 days'::interval, hyper_2."time"), hyper_2.device, hyper_2.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (29 rows) @@ -4271,8 +4271,8 @@ GROUP BY 1,2 HAVING avg(temp) * custom_sum(device) > 0.8 ORDER BY 1,2 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate Output: hyper."time", hyper.device, avg(hyper.temp) Group Key: hyper."time", hyper.device @@ -4285,17 +4285,17 @@ ORDER BY 1,2 Output: hyper_1."time", hyper_1.device, hyper_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device, hyper_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device, hyper_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (23 rows) @@ -4308,8 +4308,8 @@ WHERE time >= '2019-01-01' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate Output: hyper."time", hyper.device, avg(hyper.temp), custom_sum(hyper.device) Group Key: hyper."time", hyper.device @@ -4321,17 +4321,17 @@ ORDER BY 1,2 Output: hyper_1."time", hyper_1.device, hyper_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device, hyper_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device, hyper_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (22 rows) @@ -4342,8 +4342,8 @@ ORDER BY 1,2 (1 row) - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Merge Append @@ -4353,23 +4353,23 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (22 rows) - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Merge Append @@ -4379,19 +4379,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (22 rows) tsl_override_current_timestamptz @@ -4399,8 +4399,8 @@ ORDER BY 1,2 (1 row) - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Merge Append @@ -4410,19 +4410,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (22 rows) @@ -4433,8 +4433,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -4445,17 +4445,17 @@ LIMIT 10 Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 (21 rows) @@ -4467,8 +4467,8 @@ FROM hyper ORDER BY 1,2 LIMIT 5 OFFSET 5 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -4479,17 +4479,17 @@ OFFSET 5 Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 (21 rows) @@ -4500,8 +4500,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT 0 - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -4512,17 +4512,17 @@ LIMIT 0 Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 (21 rows) @@ -4533,8 +4533,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT extract(year from date '2000-01-01') - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -4545,17 +4545,17 @@ LIMIT extract(year from date '2000-01-01') Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 (21 rows) @@ -4566,8 +4566,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT greatest(random(), 10.0) - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -4578,17 +4578,17 @@ LIMIT greatest(random(), 10.0) Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (21 rows) @@ -4616,17 +4616,17 @@ LIMIT 10 Output: hyper_1.device, hyper_1."time", hyper_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.device, hyper_2."time", hyper_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.device, hyper_3."time", hyper_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST (26 rows) @@ -4637,8 +4637,8 @@ SELECT DISTINCT device, time FROM hyper ORDER BY 1,2 LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper.device, hyper."time" -> Unique @@ -4651,17 +4651,17 @@ LIMIT 10 Output: hyper_1.device, hyper_1."time" Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.device, hyper_2."time" Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.device, hyper_3."time" Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST (23 rows) @@ -4672,8 +4672,8 @@ SELECT DISTINCT ON (device) device, time FROM hyper ORDER BY 1,2 LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper.device, hyper."time" -> Unique @@ -4686,17 +4686,17 @@ LIMIT 10 Output: hyper_1.device, hyper_1."time" Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.device, hyper_2."time" Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.device, hyper_3."time" Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST (23 rows) @@ -4716,17 +4716,17 @@ LIMIT 10 Output: t_1."time", t_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) -> Custom Scan (DataNodeScan) on public.hyper t_2 Output: t_2."time", t_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) -> Custom Scan (DataNodeScan) on public.hyper t_3 Output: t_3."time", t_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) -> Materialize Output: join_test.device -> Seq Scan on public.join_test @@ -4750,8 +4750,8 @@ FROM hyper INNER JOIN top_n USING (device) WHERE time >= '2019-01-01' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate Output: (time_bucket('@ 1 min'::interval, hyper."time")), hyper.device, avg(hyper.temp) Group Key: time_bucket('@ 1 min'::interval, hyper."time"), hyper.device @@ -4767,17 +4767,17 @@ ORDER BY 1,2 Output: hyper_1."time", hyper_1.device, hyper_1.temp, time_bucket('@ 1 min'::interval, hyper_1."time") Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device, hyper_2.temp, time_bucket('@ 1 min'::interval, hyper_2."time") Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device, hyper_3.temp, time_bucket('@ 1 min'::interval, hyper_3."time") Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Materialize Output: top_n.device -> Subquery Scan on top_n @@ -4799,19 +4799,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_5.device, (PARTIAL avg(hyper_5.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_6.device, (PARTIAL avg(hyper_6.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST (60 rows) @@ -4824,8 +4824,8 @@ WHERE h1.time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND h2.time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ GroupAggregate Output: (time_bucket('@ 1 min'::interval, h1."time")), h1.device, avg(h1.temp), max(h2.temp) Group Key: time_bucket('@ 1 min'::interval, h1."time"), h1.device @@ -4836,7 +4836,7 @@ ORDER BY 1,2 Output: h2.temp, h2."time", h2.device, time_bucket('@ 1 min'::interval, h2."time") Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Materialize Output: h1."time", h1.device, h1.temp -> Custom Scan (AsyncAppend) @@ -4846,17 +4846,17 @@ ORDER BY 1,2 Output: h1_1."time", h1_1.device, h1_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper h1_2 Output: h1_2."time", h1_2.device, h1_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper h1_3 Output: h1_3."time", h1_3.device, h1_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (31 rows) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -4882,8 +4882,8 @@ WHERE time >= '2019-01-01' GROUP BY 1 ORDER BY 1 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", (avg(temp)) -> Merge Append @@ -4893,19 +4893,19 @@ ORDER BY 1 Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT "time", avg(temp) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", avg(temp) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper1d_1."time", (avg(hyper1d_1.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT "time", avg(temp) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", avg(temp) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper1d_2."time", (avg(hyper1d_2.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", avg(temp) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", avg(temp) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST (22 rows) @@ -4918,8 +4918,8 @@ WHERE time >= '2019-01-01' GROUP BY 1 ORDER BY 1 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: (time_bucket('@ 2 days'::interval, "time")), avg(temp) Group Key: (time_bucket('@ 2 days'::interval, "time")) @@ -4932,19 +4932,19 @@ ORDER BY 1 Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper1d_1."time")), (PARTIAL avg(hyper1d_1.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper1d_2."time")), (PARTIAL avg(hyper1d_2.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST (25 rows) @@ -4957,8 +4957,8 @@ WHERE time >= '2019-01-01' GROUP BY 1,2 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Append @@ -4967,19 +4967,19 @@ GROUP BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 (21 rows) @@ -4992,8 +4992,8 @@ WHERE time >= '2019-01-01' GROUP BY 1,2 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: (time_bucket('@ 2 days'::interval, "time")), device, avg(temp) Group Key: (time_bucket('@ 2 days'::interval, "time")), device @@ -5008,19 +5008,19 @@ GROUP BY 1,2 Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper1d_1."time")), hyper1d_1.device, (PARTIAL avg(hyper1d_1.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper1d_2."time")), hyper1d_2.device, (PARTIAL avg(hyper1d_2.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 (27 rows) @@ -5033,8 +5033,8 @@ WHERE time >= '2019-01-01' GROUP BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: (date_trunc('month'::text, "time")), device, avg(temp) Group Key: (date_trunc('month'::text, "time")), device @@ -5049,19 +5049,19 @@ GROUP BY 1,2 Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT date_trunc('month'::text, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: (date_trunc('month'::text, hyper1d_1."time")), hyper1d_1.device, (PARTIAL avg(hyper1d_1.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT date_trunc('month'::text, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: (date_trunc('month'::text, hyper1d_2."time")), hyper1d_2.device, (PARTIAL avg(hyper1d_2.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT date_trunc('month'::text, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 (27 rows) @@ -5075,8 +5075,8 @@ GROUP BY 1,2 HAVING device > 4 - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: (time_bucket('@ 2 days'::interval, "time")), device, avg(temp) Group Key: (time_bucket('@ 2 days'::interval, "time")), device @@ -5091,19 +5091,19 @@ HAVING device > 4 Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper1d_1."time")), hyper1d_1.device, (PARTIAL avg(hyper1d_1.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper1d_2."time")), hyper1d_2.device, (PARTIAL avg(hyper1d_2.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 (27 rows) EXPLAIN (verbose, costs off) @@ -5114,8 +5114,8 @@ GROUP BY 1,2 HAVING avg(temp) > 40 AND max(temp) < 70 - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: (time_bucket('@ 2 days'::interval, "time")), device, avg(temp) Group Key: (time_bucket('@ 2 days'::interval, "time")), device @@ -5131,19 +5131,19 @@ HAVING avg(temp) > 40 AND max(temp) < 70 Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)), _timescaledb_internal.partialize_agg(max(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)), _timescaledb_internal.partialize_agg(max(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper1d_1."time")), hyper1d_1.device, (PARTIAL avg(hyper1d_1.temp)), (PARTIAL max(hyper1d_1.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)), _timescaledb_internal.partialize_agg(max(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)), _timescaledb_internal.partialize_agg(max(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper1d_2."time")), hyper1d_2.device, (PARTIAL avg(hyper1d_2.temp)), (PARTIAL max(hyper1d_2.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)), _timescaledb_internal.partialize_agg(max(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)), _timescaledb_internal.partialize_agg(max(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 (28 rows) @@ -5156,8 +5156,8 @@ WHERE time >= '2019-01-01' GROUP BY 1 ORDER BY 1 - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: device, avg(temp) Group Key: device @@ -5170,19 +5170,19 @@ ORDER BY 1 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1.device, (PARTIAL avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2.device, (PARTIAL avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST (25 rows) @@ -5195,8 +5195,8 @@ WHERE time >= '2019-01-01' AND (temp * random() >= 0) GROUP BY 1 ORDER BY 1 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: location, avg(temp) Group Key: location @@ -5212,7 +5212,7 @@ ORDER BY 1 Filter: ((hyper1d.temp * random()) >= '0'::double precision) Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT location, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST -> Partial GroupAggregate Output: hyper1d_1.location, PARTIAL avg(hyper1d_1.temp) Group Key: hyper1d_1.location @@ -5221,7 +5221,7 @@ ORDER BY 1 Filter: ((hyper1d_1.temp * random()) >= '0'::double precision) Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT location, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST -> Partial GroupAggregate Output: hyper1d_2.location, PARTIAL avg(hyper1d_2.temp) Group Key: hyper1d_2.location @@ -5230,7 +5230,7 @@ ORDER BY 1 Filter: ((hyper1d_2.temp * random()) >= '0'::double precision) Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT location, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST (34 rows) @@ -5243,8 +5243,8 @@ WHERE time >= '2019-01-01' GROUP BY 1,2 - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: (time_bucket('@ 2 days'::interval, hyper1d."time")), hyper1d.device, avg(hyper1d.temp), sum((hyper1d.temp * (((random() <= '1'::double precision))::integer)::double precision)) Group Key: (time_bucket('@ 2 days'::interval, hyper1d."time")), hyper1d.device @@ -5257,7 +5257,7 @@ GROUP BY 1,2 Output: time_bucket('@ 2 days'::interval, hyper1d."time"), hyper1d.device, hyper1d.temp Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Partial GroupAggregate Output: (time_bucket('@ 2 days'::interval, hyper1d_1."time")), hyper1d_1.device, PARTIAL avg(hyper1d_1.temp), PARTIAL sum((hyper1d_1.temp * (((random() <= '1'::double precision))::integer)::double precision)) Group Key: time_bucket('@ 2 days'::interval, hyper1d_1."time"), hyper1d_1.device @@ -5265,7 +5265,7 @@ GROUP BY 1,2 Output: time_bucket('@ 2 days'::interval, hyper1d_1."time"), hyper1d_1.device, hyper1d_1.temp Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Partial GroupAggregate Output: (time_bucket('@ 2 days'::interval, hyper1d_2."time")), hyper1d_2.device, PARTIAL avg(hyper1d_2.temp), PARTIAL sum((hyper1d_2.temp * (((random() <= '1'::double precision))::integer)::double precision)) Group Key: time_bucket('@ 2 days'::interval, hyper1d_2."time"), hyper1d_2.device @@ -5273,7 +5273,7 @@ GROUP BY 1,2 Output: time_bucket('@ 2 days'::interval, hyper1d_2."time"), hyper1d_2.device, hyper1d_2.temp Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (29 rows) @@ -5287,8 +5287,8 @@ GROUP BY 1,2 HAVING avg(temp) * custom_sum(device) > 0.8 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Append @@ -5300,7 +5300,7 @@ HAVING avg(temp) * custom_sum(device) > 0.8 Output: hyper1d."time", hyper1d.device, hyper1d.temp Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> GroupAggregate Output: hyper1d_1."time", hyper1d_1.device, avg(hyper1d_1.temp) Group Key: hyper1d_1."time", hyper1d_1.device @@ -5309,7 +5309,7 @@ HAVING avg(temp) * custom_sum(device) > 0.8 Output: hyper1d_1."time", hyper1d_1.device, hyper1d_1.temp Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> GroupAggregate Output: hyper1d_2."time", hyper1d_2.device, avg(hyper1d_2.temp) Group Key: hyper1d_2."time", hyper1d_2.device @@ -5318,7 +5318,7 @@ HAVING avg(temp) * custom_sum(device) > 0.8 Output: hyper1d_2."time", hyper1d_2.device, hyper1d_2.temp Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (30 rows) @@ -5331,8 +5331,8 @@ WHERE time >= '2019-01-01' GROUP BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)), (custom_sum(device)) -> Append @@ -5343,7 +5343,7 @@ GROUP BY 1,2 Output: hyper1d."time", hyper1d.device, hyper1d.temp Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> GroupAggregate Output: hyper1d_1."time", hyper1d_1.device, avg(hyper1d_1.temp), custom_sum(hyper1d_1.device) Group Key: hyper1d_1."time", hyper1d_1.device @@ -5351,7 +5351,7 @@ GROUP BY 1,2 Output: hyper1d_1."time", hyper1d_1.device, hyper1d_1.temp Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> GroupAggregate Output: hyper1d_2."time", hyper1d_2.device, avg(hyper1d_2.temp), custom_sum(hyper1d_2.device) Group Key: hyper1d_2."time", hyper1d_2.device @@ -5359,7 +5359,7 @@ GROUP BY 1,2 Output: hyper1d_2."time", hyper1d_2.device, hyper1d_2.temp Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (27 rows) @@ -5370,8 +5370,8 @@ GROUP BY 1,2 (1 row) - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Append @@ -5380,23 +5380,23 @@ GROUP BY 1,2 Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper1d_1."time", hyper1d_1.device, (avg(hyper1d_1.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper1d_2."time", hyper1d_2.device, (avg(hyper1d_2.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 (21 rows) - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Append @@ -5405,19 +5405,19 @@ GROUP BY 1,2 Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper1d_1."time", hyper1d_1.device, (avg(hyper1d_1.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper1d_2."time", hyper1d_2.device, (avg(hyper1d_2.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 (21 rows) tsl_override_current_timestamptz @@ -5425,8 +5425,8 @@ GROUP BY 1,2 (1 row) - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Append @@ -5435,19 +5435,19 @@ GROUP BY 1,2 Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper1d_1."time", hyper1d_1.device, (avg(hyper1d_1.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper1d_2."time", hyper1d_2.device, (avg(hyper1d_2.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 (21 rows) @@ -5458,8 +5458,8 @@ SELECT time, device FROM hyper1d LIMIT 10 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper1d."time", hyper1d.device -> Custom Scan (AsyncAppend) @@ -5469,17 +5469,17 @@ LIMIT 10 Output: hyper1d_1."time", hyper1d_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_2 Output: hyper1d_2."time", hyper1d_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_3 Output: hyper1d_3."time", hyper1d_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) LIMIT 10 (20 rows) @@ -5491,8 +5491,8 @@ FROM hyper1d LIMIT 5 OFFSET 5 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper1d."time", hyper1d.device -> Custom Scan (AsyncAppend) @@ -5502,17 +5502,17 @@ OFFSET 5 Output: hyper1d_1."time", hyper1d_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_2 Output: hyper1d_2."time", hyper1d_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_3 Output: hyper1d_3."time", hyper1d_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) LIMIT 10 (20 rows) @@ -5523,8 +5523,8 @@ SELECT time, device FROM hyper1d LIMIT 0 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------ Limit Output: hyper1d."time", hyper1d.device -> Custom Scan (AsyncAppend) @@ -5534,17 +5534,17 @@ LIMIT 0 Output: hyper1d_1."time", hyper1d_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 1 -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_2 Output: hyper1d_2."time", hyper1d_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 1 -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_3 Output: hyper1d_3."time", hyper1d_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) LIMIT 1 (20 rows) @@ -5555,8 +5555,8 @@ SELECT time, device FROM hyper1d LIMIT extract(year from date '2000-01-01') - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper1d."time", hyper1d.device -> Custom Scan (AsyncAppend) @@ -5566,17 +5566,17 @@ LIMIT extract(year from date '2000-01-01') Output: hyper1d_1."time", hyper1d_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 2000 -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_2 Output: hyper1d_2."time", hyper1d_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 2000 -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_3 Output: hyper1d_3."time", hyper1d_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) LIMIT 2000 (20 rows) @@ -5587,8 +5587,8 @@ SELECT time, device FROM hyper1d LIMIT greatest(random(), 10.0) - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper1d."time", hyper1d.device -> Custom Scan (AsyncAppend) @@ -5598,17 +5598,17 @@ LIMIT greatest(random(), 10.0) Output: hyper1d_1."time", hyper1d_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_2 Output: hyper1d_2."time", hyper1d_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_3 Output: hyper1d_3."time", hyper1d_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) (20 rows) @@ -5619,8 +5619,8 @@ SELECT time, device, avg(temp) OVER (PARTITION BY device) FROM hyper1d LIMIT 10 - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper1d."time", hyper1d.device, (avg(hyper1d.temp) OVER (?)) -> WindowAgg @@ -5633,17 +5633,17 @@ LIMIT 10 Output: hyper1d_1.device, hyper1d_1."time", hyper1d_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_2 Output: hyper1d_2.device, hyper1d_2."time", hyper1d_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_3 Output: hyper1d_3.device, hyper1d_3."time", hyper1d_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) ORDER BY device ASC NULLS LAST (23 rows) @@ -5654,8 +5654,8 @@ SELECT DISTINCT device, time FROM hyper1d LIMIT 10 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper1d.device, hyper1d."time" -> Unique @@ -5668,17 +5668,17 @@ LIMIT 10 Output: hyper1d_1.device, hyper1d_1."time" Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_2 Output: hyper1d_2.device, hyper1d_2."time" Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_3 Output: hyper1d_3.device, hyper1d_3."time" Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST (23 rows) @@ -5689,8 +5689,8 @@ SELECT DISTINCT ON (device) device, time FROM hyper1d LIMIT 10 - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper1d.device, hyper1d."time" -> Unique @@ -5703,24 +5703,24 @@ LIMIT 10 Output: hyper1d_1.device, hyper1d_1."time" Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_2 Output: hyper1d_2.device, hyper1d_2."time" Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_3 Output: hyper1d_3.device, hyper1d_3."time" Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) ORDER BY device ASC NULLS LAST (23 rows) ######### LIMIT push down cases - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: t."time" -> Nested Loop @@ -5733,17 +5733,17 @@ LIMIT 10 Output: t_1."time", t_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) -> Custom Scan (DataNodeScan) on public.hyper1d t_2 Output: t_2."time", t_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) -> Custom Scan (DataNodeScan) on public.hyper1d t_3 Output: t_3."time", t_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) -> Materialize Output: join_test.device -> Seq Scan on public.join_test @@ -5767,8 +5767,8 @@ FROM hyper1d INNER JOIN top_n USING (device) WHERE time >= '2019-01-01' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ GroupAggregate Output: (time_bucket('@ 1 min'::interval, hyper1d."time")), hyper1d.device, avg(hyper1d.temp) Group Key: time_bucket('@ 1 min'::interval, hyper1d."time"), hyper1d.device @@ -5784,17 +5784,17 @@ ORDER BY 1,2 Output: hyper1d_1."time", hyper1d_1.device, hyper1d_1.temp, time_bucket('@ 1 min'::interval, hyper1d_1."time") Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_2 Output: hyper1d_2."time", hyper1d_2.device, hyper1d_2.temp, time_bucket('@ 1 min'::interval, hyper1d_2."time") Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_3 Output: hyper1d_3."time", hyper1d_3.device, hyper1d_3.temp, time_bucket('@ 1 min'::interval, hyper1d_3."time") Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Materialize Output: top_n.device -> Subquery Scan on top_n @@ -5816,19 +5816,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper1d_5.device, (PARTIAL avg(hyper1d_5.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper1d_6.device, (PARTIAL avg(hyper1d_6.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST (60 rows) @@ -5841,8 +5841,8 @@ WHERE h1.time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND h2.time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ GroupAggregate Output: (time_bucket('@ 1 min'::interval, h1."time")), h1.device, avg(h1.temp), max(h2.temp) Group Key: time_bucket('@ 1 min'::interval, h1."time"), h1.device @@ -5853,7 +5853,7 @@ ORDER BY 1,2 Output: h2.temp, h2."time", h2.device, time_bucket('@ 1 min'::interval, h2."time") Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Materialize Output: h1."time", h1.device, h1.temp -> Custom Scan (AsyncAppend) @@ -5863,17 +5863,17 @@ ORDER BY 1,2 Output: h1_1."time", h1_1.device, h1_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper h1_2 Output: h1_2."time", h1_2.device, h1_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper h1_3 Output: h1_3."time", h1_3.device, h1_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (31 rows) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/tsl/test/expected/dist_query-15.out b/tsl/test/expected/dist_query-15.out index 1aff40a4796..f86976b10d2 100644 --- a/tsl/test/expected/dist_query-15.out +++ b/tsl/test/expected/dist_query-15.out @@ -194,8 +194,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: "time", avg(temp) Group Key: "time" @@ -210,19 +210,19 @@ GROUP BY 1 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 -> Custom Scan (DataNodeScan) Output: hyper_1."time", (PARTIAL avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 -> Custom Scan (DataNodeScan) Output: hyper_2."time", (PARTIAL avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 (27 rows) @@ -235,8 +235,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: (time_bucket('@ 2 days'::interval, "time")), avg(temp) Group Key: (time_bucket('@ 2 days'::interval, "time")) @@ -251,19 +251,19 @@ GROUP BY 1 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), (PARTIAL avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), (PARTIAL avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 (27 rows) @@ -276,8 +276,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Append @@ -286,19 +286,19 @@ GROUP BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 (21 rows) @@ -311,8 +311,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: (time_bucket('@ 2 days'::interval, "time")), device, (avg(temp)) -> Append @@ -321,19 +321,19 @@ GROUP BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 (21 rows) @@ -346,8 +346,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: (date_trunc('month'::text, "time")), device, (avg(temp)) -> Append @@ -356,19 +356,19 @@ GROUP BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: (date_trunc('month'::text, hyper_1."time")), hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: (date_trunc('month'::text, hyper_2."time")), hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 (21 rows) @@ -382,8 +382,8 @@ GROUP BY 1,2 HAVING device > 4 - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: (time_bucket('@ 2 days'::interval, "time")), device, (avg(temp)) -> Append @@ -392,19 +392,19 @@ HAVING device > 4 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 (21 rows) EXPLAIN (verbose, costs off) @@ -415,8 +415,8 @@ GROUP BY 1,2 HAVING avg(temp) > 40 AND max(temp) < 70 - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: (time_bucket('@ 2 days'::interval, "time")), device, (avg(temp)) -> Append @@ -425,19 +425,19 @@ HAVING avg(temp) > 40 AND max(temp) < 70 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) (21 rows) @@ -450,8 +450,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1 - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: device, (avg(temp)) -> Append @@ -460,19 +460,19 @@ GROUP BY 1 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 -> Custom Scan (DataNodeScan) Output: hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 -> Custom Scan (DataNodeScan) Output: hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 (21 rows) @@ -485,8 +485,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND (temp * random() >= 0 GROUP BY 1 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate Output: hyper.location, avg(hyper.temp) Group Key: hyper.location @@ -499,19 +499,19 @@ GROUP BY 1 Filter: ((hyper_1.temp * random()) >= '0'::double precision) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.location, hyper_2.temp Filter: ((hyper_2.temp * random()) >= '0'::double precision) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.location, hyper_3.temp Filter: ((hyper_3.temp * random()) >= '0'::double precision) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST (25 rows) @@ -524,8 +524,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Append -> GroupAggregate Output: (time_bucket('@ 2 days'::interval, hyper."time")), hyper.device, avg(hyper.temp), sum((hyper.temp * (((random() <= '1'::double precision))::integer)::double precision)) @@ -536,7 +536,7 @@ GROUP BY 1,2 Output: hyper."time", hyper.device, hyper.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> GroupAggregate Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), hyper_1.device, avg(hyper_1.temp), sum((hyper_1.temp * (((random() <= '1'::double precision))::integer)::double precision)) Group Key: time_bucket('@ 2 days'::interval, hyper_1."time"), hyper_1.device @@ -546,7 +546,7 @@ GROUP BY 1,2 Output: hyper_1."time", hyper_1.device, hyper_1.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> GroupAggregate Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), hyper_2.device, avg(hyper_2.temp), sum((hyper_2.temp * (((random() <= '1'::double precision))::integer)::double precision)) Group Key: time_bucket('@ 2 days'::interval, hyper_2."time"), hyper_2.device @@ -556,7 +556,7 @@ GROUP BY 1,2 Output: hyper_2."time", hyper_2.device, hyper_2.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (31 rows) @@ -570,8 +570,8 @@ GROUP BY 1,2 HAVING avg(temp) * custom_sum(device) > 0.8 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Append @@ -583,7 +583,7 @@ HAVING avg(temp) * custom_sum(device) > 0.8 Output: hyper."time", hyper.device, hyper.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> GroupAggregate Output: hyper_1."time", hyper_1.device, avg(hyper_1.temp) Group Key: hyper_1."time", hyper_1.device @@ -592,7 +592,7 @@ HAVING avg(temp) * custom_sum(device) > 0.8 Output: hyper_1."time", hyper_1.device, hyper_1.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> GroupAggregate Output: hyper_2."time", hyper_2.device, avg(hyper_2.temp) Group Key: hyper_2."time", hyper_2.device @@ -601,7 +601,7 @@ HAVING avg(temp) * custom_sum(device) > 0.8 Output: hyper_2."time", hyper_2.device, hyper_2.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (30 rows) @@ -614,8 +614,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)), (custom_sum(device)) -> Append @@ -626,7 +626,7 @@ GROUP BY 1,2 Output: hyper."time", hyper.device, hyper.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> GroupAggregate Output: hyper_1."time", hyper_1.device, avg(hyper_1.temp), custom_sum(hyper_1.device) Group Key: hyper_1."time", hyper_1.device @@ -634,7 +634,7 @@ GROUP BY 1,2 Output: hyper_1."time", hyper_1.device, hyper_1.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> GroupAggregate Output: hyper_2."time", hyper_2.device, avg(hyper_2.temp), custom_sum(hyper_2.device) Group Key: hyper_2."time", hyper_2.device @@ -642,7 +642,7 @@ GROUP BY 1,2 Output: hyper_2."time", hyper_2.device, hyper_2.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (27 rows) @@ -653,8 +653,8 @@ GROUP BY 1,2 (1 row) - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Append @@ -663,23 +663,23 @@ GROUP BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 (21 rows) - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Append @@ -688,19 +688,19 @@ GROUP BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 (21 rows) tsl_override_current_timestamptz @@ -708,8 +708,8 @@ GROUP BY 1,2 (1 row) - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Append @@ -718,19 +718,19 @@ GROUP BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 (21 rows) @@ -752,17 +752,17 @@ LIMIT 10 Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) LIMIT 10 (20 rows) @@ -785,17 +785,17 @@ OFFSET 5 Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) LIMIT 10 (20 rows) @@ -817,17 +817,17 @@ LIMIT 0 Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 1 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 1 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) LIMIT 1 (20 rows) @@ -849,17 +849,17 @@ LIMIT extract(year from date '2000-01-01') Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 2000 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) LIMIT 2000 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) LIMIT 2000 (20 rows) @@ -881,17 +881,17 @@ LIMIT greatest(random(), 10.0) Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) (20 rows) @@ -918,21 +918,21 @@ LIMIT 10 Output: hyper_1."time", hyper_1.device, hyper_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST -> Result Output: hyper_2.device, hyper_2."time", hyper_2.temp -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device, hyper_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST -> Result Output: hyper_3.device, hyper_3."time", hyper_3.temp -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device, hyper_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST (29 rows) @@ -943,8 +943,8 @@ SELECT DISTINCT device, time FROM hyper LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper.device, hyper."time" -> Unique @@ -957,17 +957,17 @@ LIMIT 10 Output: hyper_1.device, hyper_1."time" Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.device, hyper_2."time" Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.device, hyper_3."time" Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST (23 rows) @@ -978,8 +978,8 @@ SELECT DISTINCT ON (device) device, time FROM hyper LIMIT 10 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper.device, hyper."time" -> Unique @@ -992,17 +992,17 @@ LIMIT 10 Output: hyper_1.device, hyper_1."time" Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.device, hyper_2."time" Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.device, hyper_3."time" Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST (23 rows) @@ -1022,17 +1022,17 @@ LIMIT 10 Output: t_1."time", t_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) -> Custom Scan (DataNodeScan) on public.hyper t_2 Output: t_2."time", t_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) -> Custom Scan (DataNodeScan) on public.hyper t_3 Output: t_3."time", t_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) -> Materialize Output: join_test.device -> Seq Scan on public.join_test @@ -1056,8 +1056,8 @@ FROM hyper INNER JOIN top_n USING (device) WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ GroupAggregate Output: (time_bucket('@ 1 min'::interval, hyper."time")), hyper.device, avg(hyper.temp) Group Key: time_bucket('@ 1 min'::interval, hyper."time"), hyper.device @@ -1075,21 +1075,21 @@ ORDER BY 1,2 Output: hyper_1."time", hyper_1.device, hyper_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Result Output: hyper_2."time", hyper_2.device, hyper_2.temp, time_bucket('@ 1 min'::interval, hyper_2."time") -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device, hyper_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Result Output: hyper_3."time", hyper_3.device, hyper_3.temp, time_bucket('@ 1 min'::interval, hyper_3."time") -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device, hyper_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Materialize Output: top_n.device -> Subquery Scan on top_n @@ -1107,19 +1107,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_5.device, (avg(hyper_5.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_6.device, (avg(hyper_6.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST (62 rows) @@ -1132,8 +1132,8 @@ WHERE h1.time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND h2.time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ GroupAggregate Output: (time_bucket('@ 1 min'::interval, h1."time")), h1.device, avg(h1.temp), max(h2.temp) Group Key: time_bucket('@ 1 min'::interval, h1."time"), h1.device @@ -1146,7 +1146,7 @@ ORDER BY 1,2 Output: h2.temp, h2."time", h2.device Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Materialize Output: h1."time", h1.device, h1.temp -> Custom Scan (AsyncAppend) @@ -1156,17 +1156,17 @@ ORDER BY 1,2 Output: h1_1."time", h1_1.device, h1_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper h1_2 Output: h1_2."time", h1_2.device, h1_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper h1_3 Output: h1_3."time", h1_3.device, h1_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (33 rows) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -1192,8 +1192,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1 ORDER BY 1 - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: "time", avg(temp) Group Key: "time" @@ -1206,19 +1206,19 @@ ORDER BY 1 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1."time", (PARTIAL avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2."time", (PARTIAL avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST (25 rows) @@ -1231,8 +1231,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1 ORDER BY 1 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: (time_bucket('@ 2 days'::interval, "time")), avg(temp) Group Key: (time_bucket('@ 2 days'::interval, "time")) @@ -1245,19 +1245,19 @@ ORDER BY 1 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), (PARTIAL avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), (PARTIAL avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST (25 rows) @@ -1270,8 +1270,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Merge Append @@ -1281,19 +1281,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (22 rows) @@ -1306,8 +1306,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: (time_bucket('@ 2 days'::interval, "time")), device, (avg(temp)) -> Merge Append @@ -1317,19 +1317,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (22 rows) @@ -1342,8 +1342,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: (date_trunc('month'::text, "time")), device, (avg(temp)) -> Merge Append @@ -1353,19 +1353,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (date_trunc('month'::text, hyper_1."time")), hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (date_trunc('month'::text, hyper_2."time")), hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST (22 rows) @@ -1379,8 +1379,8 @@ GROUP BY 1,2 HAVING device > 4 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Custom Scan (AsyncAppend) Output: (time_bucket('@ 2 days'::interval, "time")), device, (avg(temp)) -> Merge Append @@ -1390,19 +1390,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (22 rows) EXPLAIN (verbose, costs off) @@ -1413,8 +1413,8 @@ GROUP BY 1,2 HAVING avg(temp) > 40 AND max(temp) < 70 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Sort Output: (time_bucket('@ 2 days'::interval, "time")), device, (avg(temp)) Sort Key: (time_bucket('@ 2 days'::interval, "time")), device @@ -1426,19 +1426,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (24 rows) @@ -1451,8 +1451,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1 ORDER BY 1 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: device, (avg(temp)) -> Merge Append @@ -1462,19 +1462,19 @@ ORDER BY 1 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST (22 rows) @@ -1487,8 +1487,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND (temp * random() >= 0 GROUP BY 1 ORDER BY 1 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate Output: hyper.location, avg(hyper.temp) Group Key: hyper.location @@ -1501,19 +1501,19 @@ ORDER BY 1 Filter: ((hyper_1.temp * random()) >= '0'::double precision) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.location, hyper_2.temp Filter: ((hyper_2.temp * random()) >= '0'::double precision) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.location, hyper_3.temp Filter: ((hyper_3.temp * random()) >= '0'::double precision) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST (25 rows) @@ -1526,8 +1526,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate Output: (time_bucket('@ 2 days'::interval, hyper."time")), hyper.device, avg(hyper.temp), sum((hyper.temp * (((random() <= '1'::double precision))::integer)::double precision)) Group Key: (time_bucket('@ 2 days'::interval, hyper."time")), hyper.device @@ -1541,21 +1541,21 @@ ORDER BY 1,2 Output: hyper_1."time", hyper_1.device, hyper_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Result Output: time_bucket('@ 2 days'::interval, hyper_2."time"), hyper_2.device, hyper_2.temp -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device, hyper_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Result Output: time_bucket('@ 2 days'::interval, hyper_3."time"), hyper_3.device, hyper_3.temp -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device, hyper_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (28 rows) @@ -1569,8 +1569,8 @@ GROUP BY 1,2 HAVING avg(temp) * custom_sum(device) > 0.8 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ GroupAggregate Output: hyper."time", hyper.device, avg(hyper.temp) Group Key: hyper."time", hyper.device @@ -1583,17 +1583,17 @@ ORDER BY 1,2 Output: hyper_1."time", hyper_1.device, hyper_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device, hyper_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device, hyper_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (23 rows) @@ -1606,8 +1606,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ GroupAggregate Output: hyper."time", hyper.device, avg(hyper.temp), custom_sum(hyper.device) Group Key: hyper."time", hyper.device @@ -1619,17 +1619,17 @@ ORDER BY 1,2 Output: hyper_1."time", hyper_1.device, hyper_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device, hyper_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device, hyper_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (22 rows) @@ -1640,8 +1640,8 @@ ORDER BY 1,2 (1 row) - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Merge Append @@ -1651,23 +1651,23 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (22 rows) - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Merge Append @@ -1677,19 +1677,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (22 rows) tsl_override_current_timestamptz @@ -1697,8 +1697,8 @@ ORDER BY 1,2 (1 row) - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Merge Append @@ -1708,19 +1708,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (22 rows) @@ -1731,8 +1731,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -1743,17 +1743,17 @@ LIMIT 10 Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 (21 rows) @@ -1765,8 +1765,8 @@ FROM hyper ORDER BY 1,2 LIMIT 5 OFFSET 5 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -1777,17 +1777,17 @@ OFFSET 5 Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 (21 rows) @@ -1798,8 +1798,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT 0 - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -1810,17 +1810,17 @@ LIMIT 0 Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 (21 rows) @@ -1831,8 +1831,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT extract(year from date '2000-01-01') - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -1843,17 +1843,17 @@ LIMIT extract(year from date '2000-01-01') Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 (21 rows) @@ -1864,8 +1864,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT greatest(random(), 10.0) - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -1876,17 +1876,17 @@ LIMIT greatest(random(), 10.0) Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (21 rows) @@ -1916,21 +1916,21 @@ LIMIT 10 Output: hyper_1."time", hyper_1.device, hyper_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST -> Result Output: hyper_2.device, hyper_2."time", hyper_2.temp -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device, hyper_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST -> Result Output: hyper_3.device, hyper_3."time", hyper_3.temp -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device, hyper_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST (32 rows) @@ -1941,8 +1941,8 @@ SELECT DISTINCT device, time FROM hyper ORDER BY 1,2 LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper.device, hyper."time" -> Unique @@ -1955,17 +1955,17 @@ LIMIT 10 Output: hyper_1.device, hyper_1."time" Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.device, hyper_2."time" Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.device, hyper_3."time" Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST (23 rows) @@ -1976,8 +1976,8 @@ SELECT DISTINCT ON (device) device, time FROM hyper ORDER BY 1,2 LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper.device, hyper."time" -> Unique @@ -1990,17 +1990,17 @@ LIMIT 10 Output: hyper_1.device, hyper_1."time" Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.device, hyper_2."time" Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.device, hyper_3."time" Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST (23 rows) @@ -2020,17 +2020,17 @@ LIMIT 10 Output: t_1."time", t_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) -> Custom Scan (DataNodeScan) on public.hyper t_2 Output: t_2."time", t_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) -> Custom Scan (DataNodeScan) on public.hyper t_3 Output: t_3."time", t_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) -> Materialize Output: join_test.device -> Seq Scan on public.join_test @@ -2054,8 +2054,8 @@ FROM hyper INNER JOIN top_n USING (device) WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ GroupAggregate Output: (time_bucket('@ 1 min'::interval, hyper."time")), hyper.device, avg(hyper.temp) Group Key: time_bucket('@ 1 min'::interval, hyper."time"), hyper.device @@ -2073,21 +2073,21 @@ ORDER BY 1,2 Output: hyper_1."time", hyper_1.device, hyper_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Result Output: hyper_2."time", hyper_2.device, hyper_2.temp, time_bucket('@ 1 min'::interval, hyper_2."time") -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device, hyper_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Result Output: hyper_3."time", hyper_3.device, hyper_3.temp, time_bucket('@ 1 min'::interval, hyper_3."time") -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device, hyper_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Materialize Output: top_n.device -> Subquery Scan on top_n @@ -2105,19 +2105,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_5.device, (avg(hyper_5.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_6.device, (avg(hyper_6.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST (62 rows) @@ -2130,8 +2130,8 @@ WHERE h1.time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND h2.time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ GroupAggregate Output: (time_bucket('@ 1 min'::interval, h1."time")), h1.device, avg(h1.temp), max(h2.temp) Group Key: time_bucket('@ 1 min'::interval, h1."time"), h1.device @@ -2144,7 +2144,7 @@ ORDER BY 1,2 Output: h2.temp, h2."time", h2.device Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Materialize Output: h1."time", h1.device, h1.temp -> Custom Scan (AsyncAppend) @@ -2154,17 +2154,17 @@ ORDER BY 1,2 Output: h1_1."time", h1_1.device, h1_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper h1_2 Output: h1_2."time", h1_2.device, h1_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper h1_3 Output: h1_3."time", h1_3.device, h1_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (33 rows) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -2190,14 +2190,14 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND device = 1 GROUP BY 1 ORDER BY 1 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) Output: hyper."time", (avg(hyper.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST (6 rows) @@ -2210,14 +2210,14 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND device = 1 GROUP BY 1 ORDER BY 1 - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper."time")), (avg(hyper.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST (6 rows) @@ -2230,14 +2230,14 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND device = 1 GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) Output: hyper."time", hyper.device, (avg(hyper.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST (6 rows) @@ -2250,14 +2250,14 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND device = 1 GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper."time")), hyper.device, (avg(hyper.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST (6 rows) @@ -2270,14 +2270,14 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND device = 1 GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) Output: (date_trunc('month'::text, hyper."time")), hyper.device, (avg(hyper.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST + Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST (6 rows) @@ -2312,14 +2312,14 @@ GROUP BY 1,2 HAVING avg(temp) > 40 AND max(temp) < 70 ORDER BY 1,2 - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper."time")), hyper.device, (avg(hyper.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST (6 rows) @@ -2332,14 +2332,14 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND device = 1 GROUP BY 1 ORDER BY 1 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) Output: hyper.device, (avg(hyper.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1 + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1 (6 rows) @@ -2352,8 +2352,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND device = 1 AND (temp GROUP BY 1 ORDER BY 1 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate Output: hyper.location, avg(hyper.temp) Group Key: hyper.location @@ -2362,7 +2362,7 @@ ORDER BY 1 Filter: ((hyper.temp * random()) >= '0'::double precision) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) ORDER BY location ASC NULLS LAST (9 rows) @@ -2375,8 +2375,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND device = 1 GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ GroupAggregate Output: (time_bucket('@ 2 days'::interval, hyper."time")), hyper.device, avg(hyper.temp), sum((hyper.temp * (((random() <= '1'::double precision))::integer)::double precision)) Group Key: time_bucket('@ 2 days'::interval, hyper."time"), hyper.device @@ -2386,7 +2386,7 @@ ORDER BY 1,2 Output: hyper."time", hyper.device, hyper.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST (10 rows) @@ -2400,8 +2400,8 @@ GROUP BY 1,2 HAVING avg(temp) * custom_sum(device) > 0.8 ORDER BY 1,2 - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate Output: hyper."time", hyper.device, avg(hyper.temp) Group Key: hyper."time", hyper.device @@ -2410,7 +2410,7 @@ ORDER BY 1,2 Output: hyper."time", hyper.device, hyper.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) ORDER BY "time" ASC NULLS LAST (9 rows) @@ -2423,8 +2423,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND device = 1 GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate Output: hyper."time", hyper.device, avg(hyper.temp), custom_sum(hyper.device) Group Key: hyper."time", hyper.device @@ -2432,7 +2432,7 @@ ORDER BY 1,2 Output: hyper."time", hyper.device, hyper.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) ORDER BY "time" ASC NULLS LAST (8 rows) @@ -2443,24 +2443,24 @@ ORDER BY 1,2 (1 row) - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) Output: hyper."time", hyper.device, (avg(hyper.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST (6 rows) - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) Output: hyper."time", hyper.device, (avg(hyper.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST (6 rows) tsl_override_current_timestamptz @@ -2468,14 +2468,14 @@ ORDER BY 1,2 (1 row) - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) Output: hyper."time", hyper.device, (avg(hyper.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST (6 rows) @@ -2486,8 +2486,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -2498,17 +2498,17 @@ LIMIT 10 Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 (21 rows) @@ -2520,8 +2520,8 @@ FROM hyper ORDER BY 1,2 LIMIT 5 OFFSET 5 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -2532,17 +2532,17 @@ OFFSET 5 Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 (21 rows) @@ -2553,8 +2553,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT 0 - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -2565,17 +2565,17 @@ LIMIT 0 Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 (21 rows) @@ -2586,8 +2586,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT extract(year from date '2000-01-01') - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -2598,17 +2598,17 @@ LIMIT extract(year from date '2000-01-01') Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 (21 rows) @@ -2619,8 +2619,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT greatest(random(), 10.0) - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -2631,17 +2631,17 @@ LIMIT greatest(random(), 10.0) Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (21 rows) @@ -2671,21 +2671,21 @@ LIMIT 10 Output: hyper_1."time", hyper_1.device, hyper_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST -> Result Output: hyper_2.device, hyper_2."time", hyper_2.temp -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device, hyper_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST -> Result Output: hyper_3.device, hyper_3."time", hyper_3.temp -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device, hyper_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST (32 rows) @@ -2696,8 +2696,8 @@ SELECT DISTINCT device, time FROM hyper ORDER BY 1,2 LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper.device, hyper."time" -> Unique @@ -2710,17 +2710,17 @@ LIMIT 10 Output: hyper_1.device, hyper_1."time" Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.device, hyper_2."time" Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.device, hyper_3."time" Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST (23 rows) @@ -2731,8 +2731,8 @@ SELECT DISTINCT ON (device) device, time FROM hyper ORDER BY 1,2 LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper.device, hyper."time" -> Unique @@ -2745,17 +2745,17 @@ LIMIT 10 Output: hyper_1.device, hyper_1."time" Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.device, hyper_2."time" Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.device, hyper_3."time" Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST (23 rows) @@ -2775,17 +2775,17 @@ LIMIT 10 Output: t_1."time", t_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) -> Custom Scan (DataNodeScan) on public.hyper t_2 Output: t_2."time", t_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) -> Custom Scan (DataNodeScan) on public.hyper t_3 Output: t_3."time", t_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) -> Materialize Output: join_test.device -> Seq Scan on public.join_test @@ -2809,8 +2809,8 @@ FROM hyper INNER JOIN top_n USING (device) WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND device = 1 GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate Output: (time_bucket('@ 1 min'::interval, hyper."time")), hyper.device, avg(hyper.temp) Group Key: (time_bucket('@ 1 min'::interval, hyper."time")), hyper.device @@ -2822,7 +2822,7 @@ ORDER BY 1,2 Output: hyper."time", hyper.device, hyper.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST -> Materialize Output: top_n.device -> Subquery Scan on top_n @@ -2835,7 +2835,7 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1 ORDER BY avg(temp) DESC NULLS FIRST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device = 1)) GROUP BY 1 ORDER BY avg(temp) DESC NULLS FIRST (25 rows) @@ -2848,8 +2848,8 @@ WHERE h1.time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND h2.time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ GroupAggregate Output: (time_bucket('@ 1 min'::interval, h1."time")), h1.device, avg(h1.temp), max(h2.temp) Group Key: time_bucket('@ 1 min'::interval, h1."time"), h1.device @@ -2862,7 +2862,7 @@ ORDER BY 1,2 Output: h2.temp, h2."time", h2.device Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Materialize Output: h1."time", h1.device, h1.temp -> Custom Scan (AsyncAppend) @@ -2872,17 +2872,17 @@ ORDER BY 1,2 Output: h1_1."time", h1_1.device, h1_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper h1_2 Output: h1_2."time", h1_2.device, h1_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper h1_3 Output: h1_3."time", h1_3.device, h1_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (33 rows) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -2908,8 +2908,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1 ORDER BY 1 LIMIT 10 - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: "time", (avg(temp)) -> Finalize GroupAggregate @@ -2924,19 +2924,19 @@ LIMIT 10 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1."time", (PARTIAL avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2."time", (PARTIAL avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST (27 rows) @@ -2949,8 +2949,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1 ORDER BY 1 LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: (time_bucket('@ 2 days'::interval, "time")), (avg(temp)) -> Finalize GroupAggregate @@ -2965,19 +2965,19 @@ LIMIT 10 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), (PARTIAL avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), (PARTIAL avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST (27 rows) @@ -2990,8 +2990,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 LIMIT 10 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: "time", device, (avg(temp)) -> Custom Scan (AsyncAppend) @@ -3003,19 +3003,19 @@ LIMIT 10 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (24 rows) @@ -3028,8 +3028,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 LIMIT 10 - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: (time_bucket('@ 2 days'::interval, "time")), device, (avg(temp)) -> Custom Scan (AsyncAppend) @@ -3041,19 +3041,19 @@ LIMIT 10 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (24 rows) @@ -3066,8 +3066,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 LIMIT 10 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: (date_trunc('month'::text, "time")), device, (avg(temp)) -> Custom Scan (AsyncAppend) @@ -3079,19 +3079,19 @@ LIMIT 10 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (date_trunc('month'::text, hyper_1."time")), hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (date_trunc('month'::text, hyper_2."time")), hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT date_trunc('month'::text, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST (24 rows) @@ -3105,8 +3105,8 @@ GROUP BY 1,2 HAVING device > 4 ORDER BY 1,2 LIMIT 10 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Limit Output: (time_bucket('@ 2 days'::interval, "time")), device, (avg(temp)) -> Custom Scan (AsyncAppend) @@ -3118,19 +3118,19 @@ LIMIT 10 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (24 rows) EXPLAIN (verbose, costs off) @@ -3141,8 +3141,8 @@ GROUP BY 1,2 HAVING avg(temp) > 40 AND max(temp) < 70 ORDER BY 1,2 LIMIT 10 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Limit Output: (time_bucket('@ 2 days'::interval, "time")), device, (avg(temp)) -> Sort @@ -3156,19 +3156,19 @@ LIMIT 10 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 HAVING ((avg(temp) > 40::double precision)) AND ((max(temp) < 70::double precision)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (26 rows) @@ -3181,8 +3181,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1 ORDER BY 1 LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: device, (avg(temp)) -> Custom Scan (AsyncAppend) @@ -3194,19 +3194,19 @@ LIMIT 10 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST (24 rows) @@ -3219,8 +3219,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND (temp * random() >= 0 GROUP BY 1 ORDER BY 1 LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper.location, (avg(hyper.temp)) -> GroupAggregate @@ -3235,19 +3235,19 @@ LIMIT 10 Filter: ((hyper_1.temp * random()) >= '0'::double precision) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.location, hyper_2.temp Filter: ((hyper_2.temp * random()) >= '0'::double precision) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.location, hyper_3.temp Filter: ((hyper_3.temp * random()) >= '0'::double precision) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST (27 rows) @@ -3260,8 +3260,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 LIMIT 10 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: (time_bucket('@ 2 days'::interval, hyper."time")), hyper.device, (avg(hyper.temp)), (sum((hyper.temp * (((random() <= '1'::double precision))::integer)::double precision))) -> GroupAggregate @@ -3277,21 +3277,21 @@ LIMIT 10 Output: hyper_1."time", hyper_1.device, hyper_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Result Output: time_bucket('@ 2 days'::interval, hyper_2."time"), hyper_2.device, hyper_2.temp -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device, hyper_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Result Output: time_bucket('@ 2 days'::interval, hyper_3."time"), hyper_3.device, hyper_3.temp -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device, hyper_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (30 rows) @@ -3305,8 +3305,8 @@ GROUP BY 1,2 HAVING avg(temp) * custom_sum(device) > 0.8 ORDER BY 1,2 LIMIT 10 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Limit Output: hyper."time", hyper.device, (avg(hyper.temp)) -> GroupAggregate @@ -3321,17 +3321,17 @@ LIMIT 10 Output: hyper_1."time", hyper_1.device, hyper_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device, hyper_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device, hyper_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (25 rows) @@ -3344,8 +3344,8 @@ WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 LIMIT 10 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Limit Output: hyper."time", hyper.device, (avg(hyper.temp)), (custom_sum(hyper.device)) -> GroupAggregate @@ -3359,17 +3359,17 @@ LIMIT 10 Output: hyper_1."time", hyper_1.device, hyper_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device, hyper_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device, hyper_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (24 rows) @@ -3380,8 +3380,8 @@ LIMIT 10 (1 row) - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: "time", device, (avg(temp)) -> Custom Scan (AsyncAppend) @@ -3393,23 +3393,23 @@ LIMIT 10 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (24 rows) - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: "time", device, (avg(temp)) -> Custom Scan (AsyncAppend) @@ -3421,19 +3421,19 @@ LIMIT 10 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (24 rows) tsl_override_current_timestamptz @@ -3441,8 +3441,8 @@ LIMIT 10 (1 row) - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: "time", device, (avg(temp)) -> Custom Scan (AsyncAppend) @@ -3454,19 +3454,19 @@ LIMIT 10 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (24 rows) @@ -3477,8 +3477,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -3489,17 +3489,17 @@ LIMIT 10 Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 (21 rows) @@ -3511,8 +3511,8 @@ FROM hyper ORDER BY 1,2 LIMIT 5 OFFSET 5 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -3523,17 +3523,17 @@ OFFSET 5 Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 (21 rows) @@ -3544,8 +3544,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT 0 - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -3556,17 +3556,17 @@ LIMIT 0 Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 (21 rows) @@ -3577,8 +3577,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT extract(year from date '2000-01-01') - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -3589,17 +3589,17 @@ LIMIT extract(year from date '2000-01-01') Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 (21 rows) @@ -3610,8 +3610,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT greatest(random(), 10.0) - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -3622,17 +3622,17 @@ LIMIT greatest(random(), 10.0) Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (21 rows) @@ -3662,21 +3662,21 @@ LIMIT 10 Output: hyper_1."time", hyper_1.device, hyper_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST -> Result Output: hyper_2.device, hyper_2."time", hyper_2.temp -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device, hyper_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST -> Result Output: hyper_3.device, hyper_3."time", hyper_3.temp -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device, hyper_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST (32 rows) @@ -3687,8 +3687,8 @@ SELECT DISTINCT device, time FROM hyper ORDER BY 1,2 LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper.device, hyper."time" -> Unique @@ -3701,17 +3701,17 @@ LIMIT 10 Output: hyper_1.device, hyper_1."time" Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.device, hyper_2."time" Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.device, hyper_3."time" Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST (23 rows) @@ -3722,8 +3722,8 @@ SELECT DISTINCT ON (device) device, time FROM hyper ORDER BY 1,2 LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper.device, hyper."time" -> Unique @@ -3736,17 +3736,17 @@ LIMIT 10 Output: hyper_1.device, hyper_1."time" Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.device, hyper_2."time" Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.device, hyper_3."time" Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST (23 rows) @@ -3766,17 +3766,17 @@ LIMIT 10 Output: t_1."time", t_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) -> Custom Scan (DataNodeScan) on public.hyper t_2 Output: t_2."time", t_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) -> Custom Scan (DataNodeScan) on public.hyper t_3 Output: t_3."time", t_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) -> Materialize Output: join_test.device -> Seq Scan on public.join_test @@ -3800,8 +3800,8 @@ FROM hyper INNER JOIN top_n USING (device) WHERE time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ GroupAggregate Output: (time_bucket('@ 1 min'::interval, hyper."time")), hyper.device, avg(hyper.temp) Group Key: time_bucket('@ 1 min'::interval, hyper."time"), hyper.device @@ -3819,21 +3819,21 @@ ORDER BY 1,2 Output: hyper_1."time", hyper_1.device, hyper_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Result Output: hyper_2."time", hyper_2.device, hyper_2.temp, time_bucket('@ 1 min'::interval, hyper_2."time") -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device, hyper_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Result Output: hyper_3."time", hyper_3.device, hyper_3.temp, time_bucket('@ 1 min'::interval, hyper_3."time") -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device, hyper_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Materialize Output: top_n.device -> Subquery Scan on top_n @@ -3851,19 +3851,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_5.device, (avg(hyper_5.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_6.device, (avg(hyper_6.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST (62 rows) @@ -3876,8 +3876,8 @@ WHERE h1.time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND h2.time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ GroupAggregate Output: (time_bucket('@ 1 min'::interval, h1."time")), h1.device, avg(h1.temp), max(h2.temp) Group Key: time_bucket('@ 1 min'::interval, h1."time"), h1.device @@ -3890,7 +3890,7 @@ ORDER BY 1,2 Output: h2.temp, h2."time", h2.device Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Materialize Output: h1."time", h1.device, h1.temp -> Custom Scan (AsyncAppend) @@ -3900,17 +3900,17 @@ ORDER BY 1,2 Output: h1_1."time", h1_1.device, h1_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper h1_2 Output: h1_2."time", h1_2.device, h1_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper h1_3 Output: h1_3."time", h1_3.device, h1_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (33 rows) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -3936,8 +3936,8 @@ WHERE time >= '2019-01-01' GROUP BY 1 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: "time", avg(temp) Group Key: "time" @@ -3952,19 +3952,19 @@ GROUP BY 1 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 -> Custom Scan (DataNodeScan) Output: hyper_1."time", (PARTIAL avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 -> Custom Scan (DataNodeScan) Output: hyper_2."time", (PARTIAL avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT "time", _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 (27 rows) @@ -3977,8 +3977,8 @@ WHERE time >= '2019-01-01' GROUP BY 1 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: (time_bucket('@ 2 days'::interval, "time")), avg(temp) Group Key: (time_bucket('@ 2 days'::interval, "time")) @@ -3993,19 +3993,19 @@ GROUP BY 1 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), (PARTIAL avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), (PARTIAL avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 (27 rows) @@ -4018,8 +4018,8 @@ WHERE time >= '2019-01-01' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Merge Append @@ -4029,19 +4029,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (22 rows) @@ -4054,8 +4054,8 @@ WHERE time >= '2019-01-01' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: (time_bucket('@ 2 days'::interval, "time")), device, avg(temp) Group Key: (time_bucket('@ 2 days'::interval, "time")), device @@ -4068,19 +4068,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), hyper_1.device, (PARTIAL avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), hyper_2.device, (PARTIAL avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (25 rows) @@ -4093,8 +4093,8 @@ WHERE time >= '2019-01-01' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Finalize GroupAggregate Output: (date_trunc('month'::text, "time")), device, avg(temp) Group Key: (date_trunc('month'::text, "time")), device @@ -4107,19 +4107,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT date_trunc('month'::text, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (date_trunc('month'::text, hyper_1."time")), hyper_1.device, (PARTIAL avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT date_trunc('month'::text, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (date_trunc('month'::text, hyper_2."time")), hyper_2.device, (PARTIAL avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT date_trunc('month'::text, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY date_trunc('month'::text, "time") ASC NULLS LAST, device ASC NULLS LAST (25 rows) @@ -4133,8 +4133,8 @@ GROUP BY 1,2 HAVING device > 4 ORDER BY 1,2 - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: (time_bucket('@ 2 days'::interval, "time")), device, avg(temp) Group Key: (time_bucket('@ 2 days'::interval, "time")), device @@ -4147,19 +4147,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), hyper_1.device, (PARTIAL avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), hyper_2.device, (PARTIAL avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (25 rows) EXPLAIN (verbose, costs off) @@ -4170,8 +4170,8 @@ GROUP BY 1,2 HAVING avg(temp) > 40 AND max(temp) < 70 ORDER BY 1,2 - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: (time_bucket('@ 2 days'::interval, "time")), device, avg(temp) Group Key: (time_bucket('@ 2 days'::interval, "time")), device @@ -4185,19 +4185,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)), _timescaledb_internal.partialize_agg(max(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)), _timescaledb_internal.partialize_agg(max(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), hyper_1.device, (PARTIAL avg(hyper_1.temp)), (PARTIAL max(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)), _timescaledb_internal.partialize_agg(max(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)), _timescaledb_internal.partialize_agg(max(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), hyper_2.device, (PARTIAL avg(hyper_2.temp)), (PARTIAL max(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)), _timescaledb_internal.partialize_agg(max(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)), _timescaledb_internal.partialize_agg(max(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (26 rows) @@ -4210,8 +4210,8 @@ WHERE time >= '2019-01-01' GROUP BY 1 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: device, avg(temp) Group Key: device @@ -4226,19 +4226,19 @@ GROUP BY 1 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 -> Custom Scan (DataNodeScan) Output: hyper_1.device, (PARTIAL avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 -> Custom Scan (DataNodeScan) Output: hyper_2.device, (PARTIAL avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 + Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 (27 rows) @@ -4251,8 +4251,8 @@ WHERE time >= '2019-01-01' AND (temp * random() >= 0) GROUP BY 1 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Finalize GroupAggregate Output: location, avg(temp) Group Key: location @@ -4268,7 +4268,7 @@ GROUP BY 1 Filter: ((hyper.temp * random()) >= '0'::double precision) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST -> Partial GroupAggregate Output: hyper_1.location, PARTIAL avg(hyper_1.temp) Group Key: hyper_1.location @@ -4277,7 +4277,7 @@ GROUP BY 1 Filter: ((hyper_1.temp * random()) >= '0'::double precision) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST -> Partial GroupAggregate Output: hyper_2.location, PARTIAL avg(hyper_2.temp) Group Key: hyper_2.location @@ -4286,7 +4286,7 @@ GROUP BY 1 Filter: ((hyper_2.temp * random()) >= '0'::double precision) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST (34 rows) @@ -4299,8 +4299,8 @@ WHERE time >= '2019-01-01' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: (time_bucket('@ 2 days'::interval, hyper."time")), hyper.device, avg(hyper.temp), sum((hyper.temp * (((random() <= '1'::double precision))::integer)::double precision)) Group Key: (time_bucket('@ 2 days'::interval, hyper."time")), hyper.device @@ -4315,7 +4315,7 @@ ORDER BY 1,2 Output: hyper."time", hyper.device, hyper.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Partial GroupAggregate Output: (time_bucket('@ 2 days'::interval, hyper_1."time")), hyper_1.device, PARTIAL avg(hyper_1.temp), PARTIAL sum((hyper_1.temp * (((random() <= '1'::double precision))::integer)::double precision)) Group Key: time_bucket('@ 2 days'::interval, hyper_1."time"), hyper_1.device @@ -4325,7 +4325,7 @@ ORDER BY 1,2 Output: hyper_1."time", hyper_1.device, hyper_1.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Partial GroupAggregate Output: (time_bucket('@ 2 days'::interval, hyper_2."time")), hyper_2.device, PARTIAL avg(hyper_2.temp), PARTIAL sum((hyper_2.temp * (((random() <= '1'::double precision))::integer)::double precision)) Group Key: time_bucket('@ 2 days'::interval, hyper_2."time"), hyper_2.device @@ -4335,7 +4335,7 @@ ORDER BY 1,2 Output: hyper_2."time", hyper_2.device, hyper_2.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (35 rows) @@ -4349,8 +4349,8 @@ GROUP BY 1,2 HAVING avg(temp) * custom_sum(device) > 0.8 ORDER BY 1,2 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate Output: hyper."time", hyper.device, avg(hyper.temp) Group Key: hyper."time", hyper.device @@ -4363,17 +4363,17 @@ ORDER BY 1,2 Output: hyper_1."time", hyper_1.device, hyper_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device, hyper_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device, hyper_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (23 rows) @@ -4386,8 +4386,8 @@ WHERE time >= '2019-01-01' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate Output: hyper."time", hyper.device, avg(hyper.temp), custom_sum(hyper.device) Group Key: hyper."time", hyper.device @@ -4399,17 +4399,17 @@ ORDER BY 1,2 Output: hyper_1."time", hyper_1.device, hyper_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device, hyper_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device, hyper_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (22 rows) @@ -4420,8 +4420,8 @@ ORDER BY 1,2 (1 row) - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Merge Append @@ -4431,23 +4431,23 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (22 rows) - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Merge Append @@ -4457,19 +4457,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (22 rows) tsl_override_current_timestamptz @@ -4477,8 +4477,8 @@ ORDER BY 1,2 (1 row) - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Merge Append @@ -4488,19 +4488,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (22 rows) @@ -4511,8 +4511,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -4523,17 +4523,17 @@ LIMIT 10 Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 (21 rows) @@ -4545,8 +4545,8 @@ FROM hyper ORDER BY 1,2 LIMIT 5 OFFSET 5 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -4557,17 +4557,17 @@ OFFSET 5 Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 10 (21 rows) @@ -4578,8 +4578,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT 0 - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -4590,17 +4590,17 @@ LIMIT 0 Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 1 (21 rows) @@ -4611,8 +4611,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT extract(year from date '2000-01-01') - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -4623,17 +4623,17 @@ LIMIT extract(year from date '2000-01-01') Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST LIMIT 2000 (21 rows) @@ -4644,8 +4644,8 @@ SELECT time, device FROM hyper ORDER BY 1,2 LIMIT greatest(random(), 10.0) - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Limit Output: hyper."time", hyper.device -> Custom Scan (AsyncAppend) @@ -4656,17 +4656,17 @@ LIMIT greatest(random(), 10.0) Output: hyper_1."time", hyper_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (21 rows) @@ -4696,21 +4696,21 @@ LIMIT 10 Output: hyper_1."time", hyper_1.device, hyper_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST -> Result Output: hyper_2.device, hyper_2."time", hyper_2.temp -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device, hyper_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST -> Result Output: hyper_3.device, hyper_3."time", hyper_3.temp -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device, hyper_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST (32 rows) @@ -4721,8 +4721,8 @@ SELECT DISTINCT device, time FROM hyper ORDER BY 1,2 LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper.device, hyper."time" -> Unique @@ -4735,17 +4735,17 @@ LIMIT 10 Output: hyper_1.device, hyper_1."time" Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.device, hyper_2."time" Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.device, hyper_3."time" Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST (23 rows) @@ -4756,8 +4756,8 @@ SELECT DISTINCT ON (device) device, time FROM hyper ORDER BY 1,2 LIMIT 10 - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper.device, hyper."time" -> Unique @@ -4770,17 +4770,17 @@ LIMIT 10 Output: hyper_1.device, hyper_1."time" Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2.device, hyper_2."time" Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3.device, hyper_3."time" Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST (23 rows) @@ -4800,17 +4800,17 @@ LIMIT 10 Output: t_1."time", t_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) -> Custom Scan (DataNodeScan) on public.hyper t_2 Output: t_2."time", t_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) -> Custom Scan (DataNodeScan) on public.hyper t_3 Output: t_3."time", t_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) + Remote SQL: SELECT "time", device FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) -> Materialize Output: join_test.device -> Seq Scan on public.join_test @@ -4834,8 +4834,8 @@ FROM hyper INNER JOIN top_n USING (device) WHERE time >= '2019-01-01' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate Output: (time_bucket('@ 1 min'::interval, hyper."time")), hyper.device, avg(hyper.temp) Group Key: time_bucket('@ 1 min'::interval, hyper."time"), hyper.device @@ -4853,21 +4853,21 @@ ORDER BY 1,2 Output: hyper_1."time", hyper_1.device, hyper_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Result Output: hyper_2."time", hyper_2.device, hyper_2.temp, time_bucket('@ 1 min'::interval, hyper_2."time") -> Custom Scan (DataNodeScan) on public.hyper hyper_2 Output: hyper_2."time", hyper_2.device, hyper_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Result Output: hyper_3."time", hyper_3.device, hyper_3.temp, time_bucket('@ 1 min'::interval, hyper_3."time") -> Custom Scan (DataNodeScan) on public.hyper hyper_3 Output: hyper_3."time", hyper_3.device, hyper_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Materialize Output: top_n.device -> Subquery Scan on top_n @@ -4889,19 +4889,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_5.device, (PARTIAL avg(hyper_5.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_6.device, (PARTIAL avg(hyper_6.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST (66 rows) @@ -4914,8 +4914,8 @@ WHERE h1.time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND h2.time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ GroupAggregate Output: (time_bucket('@ 1 min'::interval, h1."time")), h1.device, avg(h1.temp), max(h2.temp) Group Key: time_bucket('@ 1 min'::interval, h1."time"), h1.device @@ -4928,7 +4928,7 @@ ORDER BY 1,2 Output: h2.temp, h2."time", h2.device Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Materialize Output: h1."time", h1.device, h1.temp -> Custom Scan (AsyncAppend) @@ -4938,17 +4938,17 @@ ORDER BY 1,2 Output: h1_1."time", h1_1.device, h1_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper h1_2 Output: h1_2."time", h1_2.device, h1_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper h1_3 Output: h1_3."time", h1_3.device, h1_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (33 rows) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -4974,8 +4974,8 @@ WHERE time >= '2019-01-01' GROUP BY 1 ORDER BY 1 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", (avg(temp)) -> Merge Append @@ -4985,19 +4985,19 @@ ORDER BY 1 Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT "time", avg(temp) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", avg(temp) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper1d_1."time", (avg(hyper1d_1.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT "time", avg(temp) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", avg(temp) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper1d_2."time", (avg(hyper1d_2.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", avg(temp) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST + Remote SQL: SELECT "time", avg(temp) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY "time" ASC NULLS LAST (22 rows) @@ -5010,8 +5010,8 @@ WHERE time >= '2019-01-01' GROUP BY 1 ORDER BY 1 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: (time_bucket('@ 2 days'::interval, "time")), avg(temp) Group Key: (time_bucket('@ 2 days'::interval, "time")) @@ -5024,19 +5024,19 @@ ORDER BY 1 Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper1d_1."time")), (PARTIAL avg(hyper1d_1.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper1d_2."time")), (PARTIAL avg(hyper1d_2.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST (25 rows) @@ -5049,8 +5049,8 @@ WHERE time >= '2019-01-01' GROUP BY 1,2 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Append @@ -5059,19 +5059,19 @@ GROUP BY 1,2 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper_1."time", hyper_1.device, (avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper_2."time", hyper_2.device, (avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 (21 rows) @@ -5084,8 +5084,8 @@ WHERE time >= '2019-01-01' GROUP BY 1,2 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: (time_bucket('@ 2 days'::interval, "time")), device, avg(temp) Group Key: (time_bucket('@ 2 days'::interval, "time")), device @@ -5100,19 +5100,19 @@ GROUP BY 1,2 Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper1d_1."time")), hyper1d_1.device, (PARTIAL avg(hyper1d_1.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper1d_2."time")), hyper1d_2.device, (PARTIAL avg(hyper1d_2.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 (27 rows) @@ -5125,8 +5125,8 @@ WHERE time >= '2019-01-01' GROUP BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: (date_trunc('month'::text, "time")), device, avg(temp) Group Key: (date_trunc('month'::text, "time")), device @@ -5141,19 +5141,19 @@ GROUP BY 1,2 Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT date_trunc('month'::text, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: (date_trunc('month'::text, hyper1d_1."time")), hyper1d_1.device, (PARTIAL avg(hyper1d_1.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT date_trunc('month'::text, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: (date_trunc('month'::text, hyper1d_2."time")), hyper1d_2.device, (PARTIAL avg(hyper1d_2.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT date_trunc('month'::text, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT date_trunc('month'::text, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 (27 rows) @@ -5167,8 +5167,8 @@ GROUP BY 1,2 HAVING device > 4 - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: (time_bucket('@ 2 days'::interval, "time")), device, avg(temp) Group Key: (time_bucket('@ 2 days'::interval, "time")), device @@ -5183,19 +5183,19 @@ HAVING device > 4 Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper1d_1."time")), hyper1d_1.device, (PARTIAL avg(hyper1d_1.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper1d_2."time")), hyper1d_2.device, (PARTIAL avg(hyper1d_2.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND ((device > 4)) GROUP BY 1, 2 (27 rows) EXPLAIN (verbose, costs off) @@ -5206,8 +5206,8 @@ GROUP BY 1,2 HAVING avg(temp) > 40 AND max(temp) < 70 - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: (time_bucket('@ 2 days'::interval, "time")), device, avg(temp) Group Key: (time_bucket('@ 2 days'::interval, "time")), device @@ -5223,19 +5223,19 @@ HAVING avg(temp) > 40 AND max(temp) < 70 Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)), _timescaledb_internal.partialize_agg(max(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)), _timescaledb_internal.partialize_agg(max(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper1d_1."time")), hyper1d_1.device, (PARTIAL avg(hyper1d_1.temp)), (PARTIAL max(hyper1d_1.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)), _timescaledb_internal.partialize_agg(max(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)), _timescaledb_internal.partialize_agg(max(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: (time_bucket('@ 2 days'::interval, hyper1d_2."time")), hyper1d_2.device, (PARTIAL avg(hyper1d_2.temp)), (PARTIAL max(hyper1d_2.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)), _timescaledb_internal.partialize_agg(max(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT public.time_bucket('@ 2 days'::interval, "time"), device, _timescaledb_internal.partialize_agg(avg(temp)), _timescaledb_internal.partialize_agg(max(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 (28 rows) @@ -5248,8 +5248,8 @@ WHERE time >= '2019-01-01' GROUP BY 1 ORDER BY 1 - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: device, avg(temp) Group Key: device @@ -5262,19 +5262,19 @@ ORDER BY 1 Relations: Aggregate on (public.hyper) Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_12_chunk, _dist_hyper_1_13_chunk, _dist_hyper_1_15_chunk, _dist_hyper_1_17_chunk - Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_1.device, (PARTIAL avg(hyper_1.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_9_chunk, _dist_hyper_1_11_chunk, _dist_hyper_1_14_chunk, _dist_hyper_1_18_chunk - Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4, 5, 6, 7]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper_2.device, (PARTIAL avg(hyper_2.temp)) Relations: Aggregate on (public.hyper) Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_10_chunk, _dist_hyper_1_16_chunk - Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1, 2, 3, 4]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST (25 rows) @@ -5287,8 +5287,8 @@ WHERE time >= '2019-01-01' AND (temp * random() >= 0) GROUP BY 1 ORDER BY 1 - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: location, avg(temp) Group Key: location @@ -5304,7 +5304,7 @@ ORDER BY 1 Filter: ((hyper1d.temp * random()) >= '0'::double precision) Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT location, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST -> Partial GroupAggregate Output: hyper1d_1.location, PARTIAL avg(hyper1d_1.temp) Group Key: hyper1d_1.location @@ -5313,7 +5313,7 @@ ORDER BY 1 Filter: ((hyper1d_1.temp * random()) >= '0'::double precision) Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT location, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST -> Partial GroupAggregate Output: hyper1d_2.location, PARTIAL avg(hyper1d_2.temp) Group Key: hyper1d_2.location @@ -5322,7 +5322,7 @@ ORDER BY 1 Filter: ((hyper1d_2.temp * random()) >= '0'::double precision) Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT location, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST + Remote SQL: SELECT location, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY location ASC NULLS LAST (34 rows) @@ -5335,8 +5335,8 @@ WHERE time >= '2019-01-01' GROUP BY 1,2 - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Finalize GroupAggregate Output: (time_bucket('@ 2 days'::interval, hyper1d."time")), hyper1d.device, avg(hyper1d.temp), sum((hyper1d.temp * (((random() <= '1'::double precision))::integer)::double precision)) Group Key: (time_bucket('@ 2 days'::interval, hyper1d."time")), hyper1d.device @@ -5351,7 +5351,7 @@ GROUP BY 1,2 Output: hyper1d."time", hyper1d.device, hyper1d.temp Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Partial GroupAggregate Output: (time_bucket('@ 2 days'::interval, hyper1d_1."time")), hyper1d_1.device, PARTIAL avg(hyper1d_1.temp), PARTIAL sum((hyper1d_1.temp * (((random() <= '1'::double precision))::integer)::double precision)) Group Key: time_bucket('@ 2 days'::interval, hyper1d_1."time"), hyper1d_1.device @@ -5361,7 +5361,7 @@ GROUP BY 1,2 Output: hyper1d_1."time", hyper1d_1.device, hyper1d_1.temp Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Partial GroupAggregate Output: (time_bucket('@ 2 days'::interval, hyper1d_2."time")), hyper1d_2.device, PARTIAL avg(hyper1d_2.temp), PARTIAL sum((hyper1d_2.temp * (((random() <= '1'::double precision))::integer)::double precision)) Group Key: time_bucket('@ 2 days'::interval, hyper1d_2."time"), hyper1d_2.device @@ -5371,7 +5371,7 @@ GROUP BY 1,2 Output: hyper1d_2."time", hyper1d_2.device, hyper1d_2.temp Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('2 days'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (35 rows) @@ -5385,8 +5385,8 @@ GROUP BY 1,2 HAVING avg(temp) * custom_sum(device) > 0.8 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Append @@ -5398,7 +5398,7 @@ HAVING avg(temp) * custom_sum(device) > 0.8 Output: hyper1d."time", hyper1d.device, hyper1d.temp Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> GroupAggregate Output: hyper1d_1."time", hyper1d_1.device, avg(hyper1d_1.temp) Group Key: hyper1d_1."time", hyper1d_1.device @@ -5407,7 +5407,7 @@ HAVING avg(temp) * custom_sum(device) > 0.8 Output: hyper1d_1."time", hyper1d_1.device, hyper1d_1.temp Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> GroupAggregate Output: hyper1d_2."time", hyper1d_2.device, avg(hyper1d_2.temp) Group Key: hyper1d_2."time", hyper1d_2.device @@ -5416,7 +5416,7 @@ HAVING avg(temp) * custom_sum(device) > 0.8 Output: hyper1d_2."time", hyper1d_2.device, hyper1d_2.temp Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (30 rows) @@ -5429,8 +5429,8 @@ WHERE time >= '2019-01-01' GROUP BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)), (custom_sum(device)) -> Append @@ -5441,7 +5441,7 @@ GROUP BY 1,2 Output: hyper1d."time", hyper1d.device, hyper1d.temp Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> GroupAggregate Output: hyper1d_1."time", hyper1d_1.device, avg(hyper1d_1.temp), custom_sum(hyper1d_1.device) Group Key: hyper1d_1."time", hyper1d_1.device @@ -5449,7 +5449,7 @@ GROUP BY 1,2 Output: hyper1d_1."time", hyper1d_1.device, hyper1d_1.temp Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST -> GroupAggregate Output: hyper1d_2."time", hyper1d_2.device, avg(hyper1d_2.temp), custom_sum(hyper1d_2.device) Group Key: hyper1d_2."time", hyper1d_2.device @@ -5457,7 +5457,7 @@ GROUP BY 1,2 Output: hyper1d_2."time", hyper1d_2.device, hyper1d_2.temp Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY "time" ASC NULLS LAST, device ASC NULLS LAST (27 rows) @@ -5468,8 +5468,8 @@ GROUP BY 1,2 (1 row) - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Append @@ -5478,23 +5478,23 @@ GROUP BY 1,2 Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper1d_1."time", hyper1d_1.device, (avg(hyper1d_1.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper1d_2."time", hyper1d_2.device, (avg(hyper1d_2.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 (21 rows) - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Append @@ -5503,19 +5503,19 @@ GROUP BY 1,2 Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper1d_1."time", hyper1d_1.device, (avg(hyper1d_1.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper1d_2."time", hyper1d_2.device, (avg(hyper1d_2.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 (21 rows) tsl_override_current_timestamptz @@ -5523,8 +5523,8 @@ GROUP BY 1,2 (1 row) - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) Output: "time", device, (avg(temp)) -> Append @@ -5533,19 +5533,19 @@ GROUP BY 1,2 Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper1d_1."time", hyper1d_1.device, (avg(hyper1d_1.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 -> Custom Scan (DataNodeScan) Output: hyper1d_2."time", hyper1d_2.device, (avg(hyper1d_2.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 + Remote SQL: SELECT "time", device, avg(temp) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1, 2 (21 rows) @@ -5556,8 +5556,8 @@ SELECT time, device FROM hyper1d LIMIT 10 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper1d."time", hyper1d.device -> Custom Scan (AsyncAppend) @@ -5567,17 +5567,17 @@ LIMIT 10 Output: hyper1d_1."time", hyper1d_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_2 Output: hyper1d_2."time", hyper1d_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_3 Output: hyper1d_3."time", hyper1d_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) LIMIT 10 (20 rows) @@ -5589,8 +5589,8 @@ FROM hyper1d LIMIT 5 OFFSET 5 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper1d."time", hyper1d.device -> Custom Scan (AsyncAppend) @@ -5600,17 +5600,17 @@ OFFSET 5 Output: hyper1d_1."time", hyper1d_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_2 Output: hyper1d_2."time", hyper1d_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 10 -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_3 Output: hyper1d_3."time", hyper1d_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) LIMIT 10 + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) LIMIT 10 (20 rows) @@ -5621,8 +5621,8 @@ SELECT time, device FROM hyper1d LIMIT 0 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------ Limit Output: hyper1d."time", hyper1d.device -> Custom Scan (AsyncAppend) @@ -5632,17 +5632,17 @@ LIMIT 0 Output: hyper1d_1."time", hyper1d_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 1 -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_2 Output: hyper1d_2."time", hyper1d_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 1 -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_3 Output: hyper1d_3."time", hyper1d_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) LIMIT 1 + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) LIMIT 1 (20 rows) @@ -5653,8 +5653,8 @@ SELECT time, device FROM hyper1d LIMIT extract(year from date '2000-01-01') - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper1d."time", hyper1d.device -> Custom Scan (AsyncAppend) @@ -5664,17 +5664,17 @@ LIMIT extract(year from date '2000-01-01') Output: hyper1d_1."time", hyper1d_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 2000 -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_2 Output: hyper1d_2."time", hyper1d_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) LIMIT 2000 -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_3 Output: hyper1d_3."time", hyper1d_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) LIMIT 2000 + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) LIMIT 2000 (20 rows) @@ -5685,8 +5685,8 @@ SELECT time, device FROM hyper1d LIMIT greatest(random(), 10.0) - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper1d."time", hyper1d.device -> Custom Scan (AsyncAppend) @@ -5696,17 +5696,17 @@ LIMIT greatest(random(), 10.0) Output: hyper1d_1."time", hyper1d_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_2 Output: hyper1d_2."time", hyper1d_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_3 Output: hyper1d_3."time", hyper1d_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) (20 rows) @@ -5717,8 +5717,8 @@ SELECT time, device, avg(temp) OVER (PARTITION BY device) FROM hyper1d LIMIT 10 - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper1d."time", hyper1d.device, (avg(hyper1d.temp) OVER (?)) -> WindowAgg @@ -5733,21 +5733,21 @@ LIMIT 10 Output: hyper1d_1."time", hyper1d_1.device, hyper1d_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) ORDER BY device ASC NULLS LAST -> Result Output: hyper1d_2.device, hyper1d_2."time", hyper1d_2.temp -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_2 Output: hyper1d_2."time", hyper1d_2.device, hyper1d_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) ORDER BY device ASC NULLS LAST -> Result Output: hyper1d_3.device, hyper1d_3."time", hyper1d_3.temp -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_3 Output: hyper1d_3."time", hyper1d_3.device, hyper1d_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) ORDER BY device ASC NULLS LAST (29 rows) @@ -5758,8 +5758,8 @@ SELECT DISTINCT device, time FROM hyper1d LIMIT 10 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper1d.device, hyper1d."time" -> Unique @@ -5772,17 +5772,17 @@ LIMIT 10 Output: hyper1d_1.device, hyper1d_1."time" Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_2 Output: hyper1d_2.device, hyper1d_2."time" Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_3 Output: hyper1d_3.device, hyper1d_3."time" Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT DISTINCT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) ORDER BY device ASC NULLS LAST, "time" ASC NULLS LAST (23 rows) @@ -5793,8 +5793,8 @@ SELECT DISTINCT ON (device) device, time FROM hyper1d LIMIT 10 - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: hyper1d.device, hyper1d."time" -> Unique @@ -5807,24 +5807,24 @@ LIMIT 10 Output: hyper1d_1.device, hyper1d_1."time" Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_2 Output: hyper1d_2.device, hyper1d_2."time" Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_3 Output: hyper1d_3.device, hyper1d_3."time" Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) ORDER BY device ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device) "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) ORDER BY device ASC NULLS LAST (23 rows) ######### LIMIT push down cases - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------- Limit Output: t."time" -> Nested Loop @@ -5837,17 +5837,17 @@ LIMIT 10 Output: t_1."time", t_1.device Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) -> Custom Scan (DataNodeScan) on public.hyper1d t_2 Output: t_2."time", t_2.device Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) -> Custom Scan (DataNodeScan) on public.hyper1d t_3 Output: t_3."time", t_3.device Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) + Remote SQL: SELECT "time", device FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) -> Materialize Output: join_test.device -> Seq Scan on public.join_test @@ -5871,8 +5871,8 @@ FROM hyper1d INNER JOIN top_n USING (device) WHERE time >= '2019-01-01' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ GroupAggregate Output: (time_bucket('@ 1 min'::interval, hyper1d."time")), hyper1d.device, avg(hyper1d.temp) Group Key: time_bucket('@ 1 min'::interval, hyper1d."time"), hyper1d.device @@ -5890,21 +5890,21 @@ ORDER BY 1,2 Output: hyper1d_1."time", hyper1d_1.device, hyper1d_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Result Output: hyper1d_2."time", hyper1d_2.device, hyper1d_2.temp, time_bucket('@ 1 min'::interval, hyper1d_2."time") -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_2 Output: hyper1d_2."time", hyper1d_2.device, hyper1d_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Result Output: hyper1d_3."time", hyper1d_3.device, hyper1d_3.temp, time_bucket('@ 1 min'::interval, hyper1d_3."time") -> Custom Scan (DataNodeScan) on public.hyper1d hyper1d_3 Output: hyper1d_3."time", hyper1d_3.device, hyper1d_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Materialize Output: top_n.device -> Subquery Scan on top_n @@ -5926,19 +5926,19 @@ ORDER BY 1,2 Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_1 Chunks: _dist_hyper_2_20_chunk - Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper1d_5.device, (PARTIAL avg(hyper1d_5.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_2 Chunks: _dist_hyper_2_21_chunk - Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[8]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST -> Custom Scan (DataNodeScan) Output: hyper1d_6.device, (PARTIAL avg(hyper1d_6.temp)) Relations: Aggregate on (public.hyper1d) Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST + Remote SQL: SELECT device, _timescaledb_internal.partialize_agg(avg(temp)) FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) GROUP BY 1 ORDER BY device ASC NULLS LAST (66 rows) @@ -5951,8 +5951,8 @@ WHERE h1.time BETWEEN '2019-01-01' AND '2019-01-01 15:00' AND h2.time BETWEEN '2019-01-01' AND '2019-01-01 15:00' GROUP BY 1,2 ORDER BY 1,2 - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ GroupAggregate Output: (time_bucket('@ 1 min'::interval, h1."time")), h1.device, avg(h1.temp), max(h2.temp) Group Key: time_bucket('@ 1 min'::interval, h1."time"), h1.device @@ -5965,7 +5965,7 @@ ORDER BY 1,2 Output: h2.temp, h2."time", h2.device Data node: db_dist_query_3 Chunks: _dist_hyper_2_19_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_internal.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper1d WHERE _timescaledb_functions.chunks_in(public.hyper1d.*, ARRAY[5]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Materialize Output: h1."time", h1.device, h1.temp -> Custom Scan (AsyncAppend) @@ -5975,17 +5975,17 @@ ORDER BY 1,2 Output: h1_1."time", h1_1.device, h1_1.temp Data node: db_dist_query_1 Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper h1_2 Output: h1_2."time", h1_2.device, h1_2.temp Data node: db_dist_query_2 Chunks: _dist_hyper_1_2_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.hyper h1_3 Output: h1_3."time", h1_3.device, h1_3.temp Data node: db_dist_query_3 Chunks: _dist_hyper_1_3_chunk - Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_internal.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST + Remote SQL: SELECT "time", device, temp FROM public.hyper WHERE _timescaledb_functions.chunks_in(public.hyper.*, ARRAY[1]) AND (("time" >= '2019-01-01 00:00:00-08'::timestamp with time zone)) AND (("time" <= '2019-01-01 15:00:00-08'::timestamp with time zone)) ORDER BY public.time_bucket('00:01:00'::interval, "time") ASC NULLS LAST, device ASC NULLS LAST (33 rows) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/tsl/test/expected/dist_ref_table_join-13.out b/tsl/test/expected/dist_ref_table_join-13.out index aecc93252da..41268acea0a 100644 --- a/tsl/test/expected/dist_ref_table_join-13.out +++ b/tsl/test/expected/dist_ref_table_join-13.out @@ -338,8 +338,8 @@ SELECT * FROM metric LEFT JOIN metric_name USING (id); LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric LEFT JOIN metric_name USING (id); DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric.id, metric.ts, metric.value, metric_name.name -> Append (actual rows=4 loops=1) @@ -348,13 +348,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.id, metric_2.ts, metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (15 rows) :PREFIX @@ -362,8 +362,8 @@ SELECT * FROM metric LEFT JOIN metric_name ON metric.id = metric_name.id; LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric LEFT JOIN metric_name ON metric.id = metric_name.id; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric.ts, metric.id, metric.value, metric_name.id, metric_name.name -> Append (actual rows=4 loops=1) @@ -372,13 +372,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.ts, r8.id, r8.value, r2.id, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r8.ts, r8.id, r8.value, r2.id, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.ts, metric_2.id, metric_2.value, metric_name.id, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.ts, r9.id, r9.value, r2.id, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r9.ts, r9.id, r9.value, r2.id, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (15 rows) -- Tests without filter (DHT reftable) @@ -387,8 +387,8 @@ SELECT * FROM metric LEFT JOIN metric_name_dht USING (id); LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric LEFT JOIN metric_name_dht USING (id); DEBUG: try to push down a join on a reference table - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric.id, metric.ts, metric.value, metric_name_dht.name -> Append (actual rows=4 loops=1) @@ -397,13 +397,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: Cursor Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name_dht r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name_dht r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.id, metric_2.ts, metric_2.value, metric_name_dht.name Data node: db_dist_ref_table_join_2 Fetcher Type: Cursor Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name_dht r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name_dht r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (15 rows) -- Tests with filter pushdown @@ -412,8 +412,8 @@ SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE value > 10; LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE value > 10; DEBUG: try to push down a join on a reference table - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric.id, metric.ts, metric.value, metric_name.name -> Append (actual rows=4 loops=1) @@ -422,13 +422,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) AND ((r8.value > 10::double precision)) + Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) AND ((r8.value > 10::double precision)) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.id, metric_2.ts, metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) AND ((r9.value > 10::double precision)) + Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) AND ((r9.value > 10::double precision)) (15 rows) PREPARE prepared_join_pushdown_value (int) AS @@ -440,8 +440,8 @@ EXECUTE prepared_join_pushdown_value(10); LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) EXECUTE prepared_join_pushdown_value(10); DEBUG: try to push down a join on a reference table - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric.id, metric.ts, metric.value, metric_name.name -> Append (actual rows=4 loops=1) @@ -450,13 +450,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) AND ((r8.value > 10::double precision)) + Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) AND ((r8.value > 10::double precision)) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.id, metric_2.ts, metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) AND ((r9.value > 10::double precision)) + Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) AND ((r9.value > 10::double precision)) (15 rows) :PREFIX @@ -464,14 +464,14 @@ SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE ts > '2022-02-02 02: LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE ts > '2022-02-02 02:02:02+03'; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) (actual rows=0 loops=1) Output: metric.id, metric.ts, metric.value, metric_name.name Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT r5.id, r5.ts, r5.value, r2.name FROM (public.metric r5 LEFT JOIN public.metric_name r2 ON (((r5.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r5, ARRAY[1]) AND ((r5.ts > '2022-02-01 15:02:02-08'::timestamp with time zone)) + Remote SQL: SELECT r5.id, r5.ts, r5.value, r2.name FROM (public.metric r5 LEFT JOIN public.metric_name r2 ON (((r5.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r5, ARRAY[1]) AND ((r5.ts > '2022-02-01 15:02:02-08'::timestamp with time zone)) (6 rows) :PREFIX @@ -479,14 +479,14 @@ SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE ts BETWEEN '2022-02- LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE ts BETWEEN '2022-02-02 02:02:02+03' AND '2022-02-02 02:12:02+03'; DEBUG: try to push down a join on a reference table - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric.id, metric.ts, metric.value, metric_name.name Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT r5.id, r5.ts, r5.value, r2.name FROM (public.metric r5 LEFT JOIN public.metric_name r2 ON (((r5.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r5, ARRAY[1]) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)) + Remote SQL: SELECT r5.id, r5.ts, r5.value, r2.name FROM (public.metric r5 LEFT JOIN public.metric_name r2 ON (((r5.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r5, ARRAY[1]) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)) (6 rows) :PREFIX @@ -494,14 +494,14 @@ SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE name LIKE 'cpu%' AND LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE name LIKE 'cpu%' AND ts BETWEEN '2022-02-02 02:02:02+03' AND '2022-02-02 02:12:02+03'; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric.id, metric.ts, metric.value, metric_name.name Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT r5.id, r5.ts, r5.value, r2.name FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_internal.chunks_in(r5, ARRAY[1]) + Remote SQL: SELECT r5.id, r5.ts, r5.value, r2.name FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_functions.chunks_in(r5, ARRAY[1]) (6 rows) :PREFIX @@ -509,8 +509,8 @@ SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE name LIKE 'cpu%'; LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE name LIKE 'cpu%'; DEBUG: try to push down a join on a reference table - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric.id, metric.ts, metric.value, metric_name.name -> Append (actual rows=4 loops=1) @@ -519,13 +519,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.id, metric_2.ts, metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (15 rows) :PREFIX @@ -533,8 +533,8 @@ SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE name = 'cpu2'; LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE name = 'cpu2'; DEBUG: try to push down a join on a reference table - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=1 loops=1) Output: metric.id, metric.ts, metric.value, metric_name.name -> Append (actual rows=1 loops=1) @@ -543,13 +543,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name = 'cpu2'::text)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name = 'cpu2'::text)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.id, metric_2.ts, metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name = 'cpu2'::text)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name = 'cpu2'::text)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (15 rows) :PREFIX @@ -557,8 +557,8 @@ SELECT * FROM metric LEFT JOIN metric_name_dht USING (id) WHERE name LIKE 'cpu%' LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric LEFT JOIN metric_name_dht USING (id) WHERE name LIKE 'cpu%'; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric.id, metric.ts, metric.value, metric_name_dht.name -> Append (actual rows=4 loops=1) @@ -567,13 +567,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: Cursor Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name_dht r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name_dht r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.id, metric_2.ts, metric_2.value, metric_name_dht.name Data node: db_dist_ref_table_join_2 Fetcher Type: Cursor Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name_dht r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name_dht r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (15 rows) -- Tests with an expression that evaluates to false @@ -582,8 +582,8 @@ SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE name LIKE 'cpu1' AND LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE name LIKE 'cpu1' AND name LIKE 'cpu2'; DEBUG: try to push down a join on a reference table - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=0 loops=1) Output: metric.id, metric.ts, metric.value, metric_name.name -> Append (actual rows=0 loops=1) @@ -592,13 +592,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu1'::text)) AND ((r2.name ~~ 'cpu2'::text)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu1'::text)) AND ((r2.name ~~ 'cpu2'::text)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=0 loops=1) Output: metric_2.id, metric_2.ts, metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu1'::text)) AND ((r2.name ~~ 'cpu2'::text)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu1'::text)) AND ((r2.name ~~ 'cpu2'::text)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (15 rows) -- Tests with aliases @@ -607,8 +607,8 @@ SELECT * FROM metric m1 LEFT JOIN metric_name m2 USING (id); LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric m1 LEFT JOIN metric_name m2 USING (id); DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: m1.id, m1.ts, m1.value, m2.name -> Append (actual rows=4 loops=1) @@ -617,13 +617,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: m1_2.id, m1_2.ts, m1_2.value, m2.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (15 rows) :PREFIX @@ -631,8 +631,8 @@ SELECT * FROM metric m1 LEFT JOIN metric_name m2 ON m1.id = m2.id; LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric m1 LEFT JOIN metric_name m2 ON m1.id = m2.id; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: m1.ts, m1.id, m1.value, m2.id, m2.name -> Append (actual rows=4 loops=1) @@ -641,13 +641,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.ts, r8.id, r8.value, r2.id, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r8.ts, r8.id, r8.value, r2.id, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: m1_2.ts, m1_2.id, m1_2.value, m2.id, m2.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.ts, r9.id, r9.value, r2.id, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r9.ts, r9.id, r9.value, r2.id, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (15 rows) :PREFIX @@ -655,8 +655,8 @@ SELECT * FROM metric m1 LEFT JOIN metric_name m2 ON m1.id = m2.id WHERE m1.value LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric m1 LEFT JOIN metric_name m2 ON m1.id = m2.id WHERE m1.value > 10; DEBUG: try to push down a join on a reference table - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: m1.ts, m1.id, m1.value, m2.id, m2.name -> Append (actual rows=4 loops=1) @@ -665,13 +665,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.ts, r8.id, r8.value, r2.id, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) AND ((r8.value > 10::double precision)) + Remote SQL: SELECT r8.ts, r8.id, r8.value, r2.id, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) AND ((r8.value > 10::double precision)) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: m1_2.ts, m1_2.id, m1_2.value, m2.id, m2.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.ts, r9.id, r9.value, r2.id, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) AND ((r9.value > 10::double precision)) + Remote SQL: SELECT r9.ts, r9.id, r9.value, r2.id, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) AND ((r9.value > 10::double precision)) (15 rows) :PREFIX @@ -679,8 +679,8 @@ SELECT * FROM metric m1 LEFT JOIN metric_name m2 ON m1.id = m2.id WHERE m1.value LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric m1 LEFT JOIN metric_name m2 ON m1.id = m2.id WHERE m1.value > 10 AND m2.name LIKE 'cpu%'; DEBUG: try to push down a join on a reference table - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: m1.ts, m1.id, m1.value, m2.id, m2.name -> Append (actual rows=4 loops=1) @@ -689,13 +689,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.ts, r8.id, r8.value, r2.id, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r8.value > 10::double precision)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r8.ts, r8.id, r8.value, r2.id, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r8.value > 10::double precision)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: m1_2.ts, m1_2.id, m1_2.value, m2.id, m2.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.ts, r9.id, r9.value, r2.id, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r9.value > 10::double precision)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r9.ts, r9.id, r9.value, r2.id, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r9.value > 10::double precision)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (15 rows) -- Tests with projections @@ -704,8 +704,8 @@ SELECT name, value FROM metric LEFT JOIN metric_name USING (id) WHERE name LIKE LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value FROM metric LEFT JOIN metric_name USING (id) WHERE name LIKE 'cpu%' AND ts BETWEEN '2022-02-02 02:02:02+03' AND '2022-02-02 02:12:02+03'; DEBUG: try to push down a join on a reference table - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Result (actual rows=1 loops=1) Output: metric_name.name, metric.value -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) @@ -713,7 +713,7 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT r5.value, r2.name FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_internal.chunks_in(r5, ARRAY[1]) + Remote SQL: SELECT r5.value, r2.name FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_functions.chunks_in(r5, ARRAY[1]) (8 rows) :PREFIX @@ -721,14 +721,14 @@ SELECT m1.ts, m1.value FROM metric m1 LEFT JOIN metric_name m2 USING (id) WHERE LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT m1.ts, m1.value FROM metric m1 LEFT JOIN metric_name m2 USING (id) WHERE name LIKE 'cpu%' AND ts BETWEEN '2022-02-02 02:02:02+03' AND '2022-02-02 02:12:02+03'; DEBUG: try to push down a join on a reference table - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: m1.ts, m1.value Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT r5.ts, r5.value FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_internal.chunks_in(r5, ARRAY[1]) + Remote SQL: SELECT r5.ts, r5.value FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_functions.chunks_in(r5, ARRAY[1]) (6 rows) :PREFIX @@ -736,8 +736,8 @@ SELECT m1.id, m1.id FROM metric m1 LEFT JOIN metric_name m2 USING (id) WHERE nam LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT m1.id, m1.id FROM metric m1 LEFT JOIN metric_name m2 USING (id) WHERE name LIKE 'cpu%' AND ts BETWEEN '2022-02-02 02:02:02+03' AND '2022-02-02 02:12:02+03'; DEBUG: try to push down a join on a reference table - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Result (actual rows=1 loops=1) Output: m1.id, m1.id -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) @@ -745,7 +745,7 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT r5.id FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_internal.chunks_in(r5, ARRAY[1]) + Remote SQL: SELECT r5.id FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_functions.chunks_in(r5, ARRAY[1]) (8 rows) :PREFIX @@ -753,14 +753,14 @@ SELECT m1.id, m2.id FROM metric m1 LEFT JOIN metric_name m2 USING (id) WHERE nam LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT m1.id, m2.id FROM metric m1 LEFT JOIN metric_name m2 USING (id) WHERE name LIKE 'cpu%' AND ts BETWEEN '2022-02-02 02:02:02+03' AND '2022-02-02 02:12:02+03'; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: m1.id, m2.id Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT r5.id, r2.id FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_internal.chunks_in(r5, ARRAY[1]) + Remote SQL: SELECT r5.id, r2.id FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_functions.chunks_in(r5, ARRAY[1]) (6 rows) :PREFIX @@ -768,14 +768,14 @@ SELECT m1.*, m2.* FROM metric m1 LEFT JOIN metric_name m2 USING (id) WHERE name LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT m1.*, m2.* FROM metric m1 LEFT JOIN metric_name m2 USING (id) WHERE name LIKE 'cpu%' AND ts BETWEEN '2022-02-02 02:02:02+03' AND '2022-02-02 02:12:02+03'; DEBUG: try to push down a join on a reference table - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: m1.ts, m1.id, m1.value, m2.id, m2.name Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT r5.ts, r5.id, r5.value, r2.id, r2.name FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_internal.chunks_in(r5, ARRAY[1]) + Remote SQL: SELECT r5.ts, r5.id, r5.value, r2.id, r2.name FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_functions.chunks_in(r5, ARRAY[1]) (6 rows) :PREFIX @@ -783,14 +783,14 @@ SELECT * FROM metric m1 LEFT JOIN metric_name m2 USING (id) WHERE name LIKE 'cpu LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric m1 LEFT JOIN metric_name m2 USING (id) WHERE name LIKE 'cpu%' AND ts BETWEEN '2022-02-02 02:02:02+03' AND '2022-02-02 02:12:02+03'; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: m1.id, m1.ts, m1.value, m2.name Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT r5.id, r5.ts, r5.value, r2.name FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_internal.chunks_in(r5, ARRAY[1]) + Remote SQL: SELECT r5.id, r5.ts, r5.value, r2.name FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_functions.chunks_in(r5, ARRAY[1]) (6 rows) -- Ordering @@ -799,8 +799,8 @@ SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name; LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric_name.name, metric.value -> Merge Append (actual rows=4 loops=1) @@ -810,13 +810,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS LAST + Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS LAST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST + Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST (16 rows) :PREFIX @@ -824,8 +824,8 @@ SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name AS LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name ASC; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric_name.name, metric.value -> Merge Append (actual rows=4 loops=1) @@ -835,13 +835,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS LAST + Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS LAST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST + Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST (16 rows) :PREFIX @@ -849,8 +849,8 @@ SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name DE LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name DESC; DEBUG: try to push down a join on a reference table - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric_name.name, metric.value -> Merge Append (actual rows=4 loops=1) @@ -860,13 +860,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name DESC NULLS FIRST + Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name DESC NULLS FIRST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r2.name DESC NULLS FIRST + Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r2.name DESC NULLS FIRST (16 rows) :PREFIX @@ -874,8 +874,8 @@ SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name AS LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name ASC NULLS first; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric_name.name, metric.value -> Merge Append (actual rows=4 loops=1) @@ -885,13 +885,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS FIRST + Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS FIRST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS FIRST + Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS FIRST (16 rows) :PREFIX @@ -899,8 +899,8 @@ SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name AS LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name ASC NULLS last; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric_name.name, metric.value -> Merge Append (actual rows=4 loops=1) @@ -910,13 +910,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS LAST + Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS LAST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST + Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST (16 rows) :PREFIX @@ -924,8 +924,8 @@ SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name DE LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name DESC NULLS first; DEBUG: try to push down a join on a reference table - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric_name.name, metric.value -> Merge Append (actual rows=4 loops=1) @@ -935,13 +935,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name DESC NULLS FIRST + Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name DESC NULLS FIRST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r2.name DESC NULLS FIRST + Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r2.name DESC NULLS FIRST (16 rows) :PREFIX @@ -949,8 +949,8 @@ SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name DE LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name DESC NULLS last; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric_name.name, metric.value -> Merge Append (actual rows=4 loops=1) @@ -960,13 +960,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name DESC NULLS LAST + Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name DESC NULLS LAST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r2.name DESC NULLS LAST + Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r2.name DESC NULLS LAST (16 rows) :PREFIX @@ -974,8 +974,8 @@ SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name, v LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name, value DESC; DEBUG: try to push down a join on a reference table - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric_name.name, metric.value -> Merge Append (actual rows=4 loops=1) @@ -985,13 +985,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS LAST, r8.value DESC NULLS FIRST + Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS LAST, r8.value DESC NULLS FIRST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST, r9.value DESC NULLS FIRST + Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST, r9.value DESC NULLS FIRST (16 rows) :PREFIX @@ -999,8 +999,8 @@ SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY value, LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY value, name DESC; DEBUG: try to push down a join on a reference table - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric_name.name, metric.value -> Merge Append (actual rows=4 loops=1) @@ -1010,13 +1010,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r8.value ASC NULLS LAST, r2.name DESC NULLS FIRST + Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r8.value ASC NULLS LAST, r2.name DESC NULLS FIRST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r9.value ASC NULLS LAST, r2.name DESC NULLS FIRST + Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r9.value ASC NULLS LAST, r2.name DESC NULLS FIRST (16 rows) :PREFIX @@ -1024,8 +1024,8 @@ SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY value A LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY value ASC, name DESC; DEBUG: try to push down a join on a reference table - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric_name.name, metric.value -> Merge Append (actual rows=4 loops=1) @@ -1035,13 +1035,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r8.value ASC NULLS LAST, r2.name DESC NULLS FIRST + Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r8.value ASC NULLS LAST, r2.name DESC NULLS FIRST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r9.value ASC NULLS LAST, r2.name DESC NULLS FIRST + Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r9.value ASC NULLS LAST, r2.name DESC NULLS FIRST (16 rows) :PREFIX @@ -1049,8 +1049,8 @@ SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY value A LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY value ASC NULLS last, name DESC NULLS first; DEBUG: try to push down a join on a reference table - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric_name.name, metric.value -> Merge Append (actual rows=4 loops=1) @@ -1060,13 +1060,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r8.value ASC NULLS LAST, r2.name DESC NULLS FIRST + Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r8.value ASC NULLS LAST, r2.name DESC NULLS FIRST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r9.value ASC NULLS LAST, r2.name DESC NULLS FIRST + Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r9.value ASC NULLS LAST, r2.name DESC NULLS FIRST (16 rows) -- Ordering with explicit table qualification @@ -1075,8 +1075,8 @@ SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY value, LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY value, name, metric_name.id; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric_name.name, metric.value, metric_name.id -> Merge Append (actual rows=4 loops=1) @@ -1086,13 +1086,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name, r2.id FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r8.value ASC NULLS LAST, r2.name ASC NULLS LAST, r2.id ASC NULLS LAST + Remote SQL: SELECT r8.value, r2.name, r2.id FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r8.value ASC NULLS LAST, r2.name ASC NULLS LAST, r2.id ASC NULLS LAST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name, metric_name.id Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name, r2.id FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r9.value ASC NULLS LAST, r2.name ASC NULLS LAST, r2.id ASC NULLS LAST + Remote SQL: SELECT r9.value, r2.name, r2.id FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r9.value ASC NULLS LAST, r2.name ASC NULLS LAST, r2.id ASC NULLS LAST (16 rows) :PREFIX @@ -1100,8 +1100,8 @@ SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY value, LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY value, name, metric_name.id, metric.id; DEBUG: try to push down a join on a reference table - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric_name.name, metric.value, metric_name.id, metric.id -> Merge Append (actual rows=4 loops=1) @@ -1111,13 +1111,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r8.id, r2.name, r2.id FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r8.value ASC NULLS LAST, r2.name ASC NULLS LAST, r2.id ASC NULLS LAST, r8.id ASC NULLS LAST + Remote SQL: SELECT r8.value, r8.id, r2.name, r2.id FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r8.value ASC NULLS LAST, r2.name ASC NULLS LAST, r2.id ASC NULLS LAST, r8.id ASC NULLS LAST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_2.id, metric_name.name, metric_name.id Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r9.id, r2.name, r2.id FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r9.value ASC NULLS LAST, r2.name ASC NULLS LAST, r2.id ASC NULLS LAST, r9.id ASC NULLS LAST + Remote SQL: SELECT r9.value, r9.id, r2.name, r2.id FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r9.value ASC NULLS LAST, r2.name ASC NULLS LAST, r2.id ASC NULLS LAST, r9.id ASC NULLS LAST (16 rows) -- Ordering with explicit table qualification and aliases @@ -1126,8 +1126,8 @@ SELECT name, value FROM metric m1 LEFT JOIN metric_name m2 USING (id) ORDER BY v LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value FROM metric m1 LEFT JOIN metric_name m2 USING (id) ORDER BY value, name, m1.id, m2.id; DEBUG: try to push down a join on a reference table - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: m2.name, m1.value, m1.id, m2.id -> Merge Append (actual rows=4 loops=1) @@ -1137,13 +1137,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r8.id, r2.name, r2.id FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r8.value ASC NULLS LAST, r2.name ASC NULLS LAST, r8.id ASC NULLS LAST, r2.id ASC NULLS LAST + Remote SQL: SELECT r8.value, r8.id, r2.name, r2.id FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r8.value ASC NULLS LAST, r2.name ASC NULLS LAST, r8.id ASC NULLS LAST, r2.id ASC NULLS LAST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: m1_2.value, m1_2.id, m2.name, m2.id Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r9.id, r2.name, r2.id FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r9.value ASC NULLS LAST, r2.name ASC NULLS LAST, r9.id ASC NULLS LAST, r2.id ASC NULLS LAST + Remote SQL: SELECT r9.value, r9.id, r2.name, r2.id FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r9.value ASC NULLS LAST, r2.name ASC NULLS LAST, r9.id ASC NULLS LAST, r2.id ASC NULLS LAST (16 rows) -- Grouping @@ -1152,8 +1152,8 @@ SELECT name FROM metric LEFT JOIN metric_name USING (id) WHERE name LIKE 'cpu%' LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name FROM metric LEFT JOIN metric_name USING (id) WHERE name LIKE 'cpu%' GROUP BY name; DEBUG: try to push down a join on a reference table - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Group (actual rows=2 loops=1) Output: metric_name.name Group Key: metric_name.name @@ -1166,13 +1166,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS LAST + Remote SQL: SELECT r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS LAST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST + Remote SQL: SELECT r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST (19 rows) :PREFIX @@ -1180,8 +1180,8 @@ SELECT name, max(value), min(value) FROM metric LEFT JOIN metric_name USING (id) LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, max(value), min(value) FROM metric LEFT JOIN metric_name USING (id) WHERE name LIKE 'cpu%' GROUP BY name; DEBUG: try to push down a join on a reference table - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate (actual rows=2 loops=1) Output: metric_name.name, max(metric.value), min(metric.value) Group Key: metric_name.name @@ -1194,13 +1194,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS LAST + Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS LAST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST + Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST (19 rows) :PREFIX @@ -1208,8 +1208,8 @@ SELECT name, max(value) FROM metric LEFT JOIN metric_name USING (id) WHERE name LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, max(value) FROM metric LEFT JOIN metric_name USING (id) WHERE name LIKE 'cpu%' AND ts BETWEEN '2022-02-02 02:02:02+03' AND '2022-02-02 02:12:02+03' GROUP BY name; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate (actual rows=1 loops=1) Output: metric_name.name, max(metric.value) Group Key: metric_name.name @@ -1220,7 +1220,7 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT r5.value, r2.name FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_internal.chunks_in(r5, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST + Remote SQL: SELECT r5.value, r2.name FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_functions.chunks_in(r5, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST (11 rows) -- Grouping and sorting @@ -1229,8 +1229,8 @@ SELECT name, max(value), min(value) FROM metric LEFT JOIN metric_name USING (id) LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, max(value), min(value) FROM metric LEFT JOIN metric_name USING (id) WHERE name LIKE 'cpu%' and ts BETWEEN '2000-02-02 02:02:02+03' and '2022-02-02 02:12:02+03' GROUP BY name ORDER BY name DESC; DEBUG: try to push down a join on a reference table - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate (actual rows=2 loops=1) Output: metric_name.name, max(metric.value), min(metric.value) Group Key: metric_name.name @@ -1243,13 +1243,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r8.ts >= '2000-02-01 15:02:02-08'::timestamp with time zone)) AND ((r8.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name DESC NULLS FIRST + Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r8.ts >= '2000-02-01 15:02:02-08'::timestamp with time zone)) AND ((r8.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name DESC NULLS FIRST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r9.ts >= '2000-02-01 15:02:02-08'::timestamp with time zone)) AND ((r9.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r2.name DESC NULLS FIRST + Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r9.ts >= '2000-02-01 15:02:02-08'::timestamp with time zone)) AND ((r9.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r2.name DESC NULLS FIRST (19 rows) -- Having @@ -1258,8 +1258,8 @@ SELECT name, max(value), min(value) FROM metric LEFT JOIN metric_name USING (id) LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, max(value), min(value) FROM metric LEFT JOIN metric_name USING (id) WHERE name LIKE 'cpu%' and ts BETWEEN '2000-02-02 02:02:02+03' and '2022-02-02 02:12:02+03' GROUP BY name having min(value) > 0 ORDER BY name DESC; DEBUG: try to push down a join on a reference table - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate (actual rows=2 loops=1) Output: metric_name.name, max(metric.value), min(metric.value) Group Key: metric_name.name @@ -1273,13 +1273,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r8.ts >= '2000-02-01 15:02:02-08'::timestamp with time zone)) AND ((r8.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name DESC NULLS FIRST + Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r8.ts >= '2000-02-01 15:02:02-08'::timestamp with time zone)) AND ((r8.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name DESC NULLS FIRST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r9.ts >= '2000-02-01 15:02:02-08'::timestamp with time zone)) AND ((r9.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r2.name DESC NULLS FIRST + Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r9.ts >= '2000-02-01 15:02:02-08'::timestamp with time zone)) AND ((r9.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r2.name DESC NULLS FIRST (20 rows) -- Rank @@ -1287,8 +1287,8 @@ DEBUG: try to push down a join on a reference table SELECT name, value, RANK () OVER (ORDER by value) from metric join metric_name_local USING (id); LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value, RANK () OVER (ORDER by value) from metric join metric_name_local USING (id); - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- WindowAgg (actual rows=4 loops=1) Output: metric_name_local.name, metric.value, rank() OVER (?) -> Nested Loop (actual rows=4 loops=1) @@ -1303,13 +1303,13 @@ SELECT name, value, RANK () OVER (ORDER by value) from metric join metric_name_l Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1, 2, 3]) ORDER BY value ASC NULLS LAST + Remote SQL: SELECT id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1, 2, 3]) ORDER BY value ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.metric metric_2 (actual rows=1 loops=1) Output: metric_2.value, metric_2.id Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1]) ORDER BY value ASC NULLS LAST + Remote SQL: SELECT id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1]) ORDER BY value ASC NULLS LAST -> Index Scan using metric_name_local_pkey on public.metric_name_local (actual rows=1 loops=4) Output: metric_name_local.id, metric_name_local.name Index Cond: (metric_name_local.id = metric.id) @@ -1331,8 +1331,8 @@ DEBUG: try to push down a join on a reference table SELECT * FROM metric_name LEFT JOIN metric USING (id) WHERE name LIKE 'cpu%'; LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric_name LEFT JOIN metric USING (id) WHERE name LIKE 'cpu%'; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------- Nested Loop Left Join (actual rows=4 loops=1) Output: metric_name.id, metric_name.name, metric.ts, metric.value Join Filter: (metric_name.id = metric.id) @@ -1350,13 +1350,13 @@ SELECT * FROM metric_name LEFT JOIN metric USING (id) WHERE name LIKE 'cpu%'; Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1, 2, 3]) + Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) on public.metric metric_2 (actual rows=1 loops=1) Output: metric_2.ts, metric_2.value, metric_2.id Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1]) + Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1]) (24 rows) -- Right join reference table on the left, hypertable on the right (can be converted into a left join by PostgreSQL, pushdown) @@ -1365,8 +1365,8 @@ SELECT * FROM metric_name RIGHT JOIN metric USING (id) WHERE name LIKE 'cpu%'; LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric_name RIGHT JOIN metric USING (id) WHERE name LIKE 'cpu%'; DEBUG: try to push down a join on a reference table - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric.id, metric_name.name, metric.ts, metric.value -> Append (actual rows=4 loops=1) @@ -1375,13 +1375,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r1.name, r8.id, r8.ts, r8.value FROM (public.metric r8 INNER JOIN public.metric_name r1 ON (((r1.id = r8.id)) AND ((r1.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r1.name, r8.id, r8.ts, r8.value FROM (public.metric r8 INNER JOIN public.metric_name r1 ON (((r1.id = r8.id)) AND ((r1.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_name.name, metric_2.id, metric_2.ts, metric_2.value Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r1.name, r9.id, r9.ts, r9.value FROM (public.metric r9 INNER JOIN public.metric_name r1 ON (((r1.id = r9.id)) AND ((r1.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r1.name, r9.id, r9.ts, r9.value FROM (public.metric r9 INNER JOIN public.metric_name r1 ON (((r1.id = r9.id)) AND ((r1.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (15 rows) -- Right join hypertable on the left, reference table on the right (no pushdown) @@ -1389,8 +1389,8 @@ DEBUG: try to push down a join on a reference table SELECT * FROM metric RIGHT JOIN metric_name USING (id) WHERE name LIKE 'cpu%'; LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric RIGHT JOIN metric_name USING (id) WHERE name LIKE 'cpu%'; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------- Nested Loop Left Join (actual rows=4 loops=1) Output: metric_name.id, metric.ts, metric.value, metric_name.name Join Filter: (metric.id = metric_name.id) @@ -1408,13 +1408,13 @@ SELECT * FROM metric RIGHT JOIN metric_name USING (id) WHERE name LIKE 'cpu%'; Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1, 2, 3]) + Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) on public.metric metric_2 (actual rows=1 loops=1) Output: metric_2.ts, metric_2.value, metric_2.id Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1]) + Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1]) (24 rows) -- Inner join and reference table left, hypertable on the right (pushdown) @@ -1423,8 +1423,8 @@ SELECT * FROM metric_name INNER JOIN metric USING (id) WHERE name LIKE 'cpu%'; LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric_name INNER JOIN metric USING (id) WHERE name LIKE 'cpu%'; DEBUG: try to push down a join on a reference table - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric_name.id, metric_name.name, metric.ts, metric.value -> Append (actual rows=4 loops=1) @@ -1433,13 +1433,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r1.id, r1.name, r8.ts, r8.value FROM (public.metric r8 INNER JOIN public.metric_name r1 ON (((r1.id = r8.id)) AND ((r1.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r1.id, r1.name, r8.ts, r8.value FROM (public.metric r8 INNER JOIN public.metric_name r1 ON (((r1.id = r8.id)) AND ((r1.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_name.id, metric_name.name, metric_2.ts, metric_2.value Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r1.id, r1.name, r9.ts, r9.value FROM (public.metric r9 INNER JOIN public.metric_name r1 ON (((r1.id = r9.id)) AND ((r1.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r1.id, r1.name, r9.ts, r9.value FROM (public.metric r9 INNER JOIN public.metric_name r1 ON (((r1.id = r9.id)) AND ((r1.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (15 rows) -- Implicit join on two tables, hypertable left, reference table right (pushdown) @@ -1448,8 +1448,8 @@ SELECT * FROM metric m1, metric_name m2 WHERE m1.id=m2.id AND name LIKE 'cpu%'; LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric m1, metric_name m2 WHERE m1.id=m2.id AND name LIKE 'cpu%'; DEBUG: try to push down a join on a reference table - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: m1.ts, m1.id, m1.value, m2.id, m2.name -> Append (actual rows=4 loops=1) @@ -1458,13 +1458,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r7.ts, r7.id, r7.value, r2.id, r2.name FROM (public.metric r7 INNER JOIN public.metric_name r2 ON (((r7.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r7, ARRAY[1, 2, 3]) + Remote SQL: SELECT r7.ts, r7.id, r7.value, r2.id, r2.name FROM (public.metric r7 INNER JOIN public.metric_name r2 ON (((r7.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r7, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: m1_2.ts, m1_2.id, m1_2.value, m2.id, m2.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r8.ts, r8.id, r8.value, r2.id, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1]) + Remote SQL: SELECT r8.ts, r8.id, r8.value, r2.id, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1]) (15 rows) -- Implicit join on two tables, reference table left, hypertable right (pushdown) @@ -1473,8 +1473,8 @@ SELECT * FROM metric m2, metric_name m1 WHERE m1.id=m2.id AND name LIKE 'cpu%'; LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric m2, metric_name m1 WHERE m1.id=m2.id AND name LIKE 'cpu%'; DEBUG: try to push down a join on a reference table - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: m2.ts, m2.id, m2.value, m1.id, m1.name -> Append (actual rows=4 loops=1) @@ -1483,13 +1483,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r7.ts, r7.id, r7.value, r2.id, r2.name FROM (public.metric r7 INNER JOIN public.metric_name r2 ON (((r7.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r7, ARRAY[1, 2, 3]) + Remote SQL: SELECT r7.ts, r7.id, r7.value, r2.id, r2.name FROM (public.metric r7 INNER JOIN public.metric_name r2 ON (((r7.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r7, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: m2_2.ts, m2_2.id, m2_2.value, m1.id, m1.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r8.ts, r8.id, r8.value, r2.id, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1]) + Remote SQL: SELECT r8.ts, r8.id, r8.value, r2.id, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1]) (15 rows) -- Implicit join on three tables (no pushdown) @@ -1497,8 +1497,8 @@ DEBUG: try to push down a join on a reference table SELECT * FROM metric m1, metric_name m2, metric_name m3 WHERE m1.id=m2.id AND m2.id = m3.id AND m3.name LIKE 'cpu%'; LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric m1, metric_name m2, metric_name m3 WHERE m1.id=m2.id AND m2.id = m3.id AND m3.name LIKE 'cpu%'; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------- Nested Loop (actual rows=4 loops=1) Output: m1.ts, m1.id, m1.value, m2.id, m2.name, m3.id, m3.name Inner Unique: true @@ -1517,13 +1517,13 @@ SELECT * FROM metric m1, metric_name m2, metric_name m3 WHERE m1.id=m2.id AND m2 Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1, 2, 3]) + Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) on public.metric m1_2 (actual rows=1 loops=1) Output: m1_2.ts, m1_2.id, m1_2.value Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1]) + Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1]) -> Materialize (actual rows=1 loops=4) Output: m2.id, m2.name -> Seq Scan on public.metric_name m2 (actual rows=2 loops=1) @@ -1541,8 +1541,8 @@ SELECT * FROM metric LEFT JOIN (SELECT * FROM metric_name) AS sub ON metric.id=s LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric LEFT JOIN (SELECT * FROM metric_name) AS sub ON metric.id=sub.id; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric.ts, metric.id, metric.value, metric_name.id, metric_name.name -> Append (actual rows=4 loops=1) @@ -1551,13 +1551,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r9.ts, r9.id, r9.value, r4.id, r4.name FROM (public.metric r9 LEFT JOIN public.metric_name r4 ON (((r9.id = r4.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1, 2, 3]) + Remote SQL: SELECT r9.ts, r9.id, r9.value, r4.id, r4.name FROM (public.metric r9 LEFT JOIN public.metric_name r4 ON (((r9.id = r4.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.ts, metric_2.id, metric_2.value, metric_name.id, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r10.ts, r10.id, r10.value, r4.id, r4.name FROM (public.metric r10 LEFT JOIN public.metric_name r4 ON (((r10.id = r4.id)))) WHERE _timescaledb_internal.chunks_in(r10, ARRAY[1]) + Remote SQL: SELECT r10.ts, r10.id, r10.value, r4.id, r4.name FROM (public.metric r10 LEFT JOIN public.metric_name r4 ON (((r10.id = r4.id)))) WHERE _timescaledb_functions.chunks_in(r10, ARRAY[1]) (15 rows) -- Left join on a DHT and a subselect with filter on a reference table (subselect can be removed, pushdown) @@ -1566,8 +1566,8 @@ SELECT * FROM metric LEFT JOIN (SELECT * FROM metric_name WHERE name LIKE 'cpu%' LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric LEFT JOIN (SELECT * FROM metric_name WHERE name LIKE 'cpu%') AS sub ON metric.id=sub.id; DEBUG: try to push down a join on a reference table - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric.ts, metric.id, metric.value, metric_name.id, metric_name.name -> Append (actual rows=4 loops=1) @@ -1576,13 +1576,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r9.ts, r9.id, r9.value, r4.id, r4.name FROM (public.metric r9 LEFT JOIN public.metric_name r4 ON (((r9.id = r4.id)) AND ((r4.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1, 2, 3]) + Remote SQL: SELECT r9.ts, r9.id, r9.value, r4.id, r4.name FROM (public.metric r9 LEFT JOIN public.metric_name r4 ON (((r9.id = r4.id)) AND ((r4.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.ts, metric_2.id, metric_2.value, metric_name.id, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r10.ts, r10.id, r10.value, r4.id, r4.name FROM (public.metric r10 LEFT JOIN public.metric_name r4 ON (((r10.id = r4.id)) AND ((r4.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r10, ARRAY[1]) + Remote SQL: SELECT r10.ts, r10.id, r10.value, r4.id, r4.name FROM (public.metric r10 LEFT JOIN public.metric_name r4 ON (((r10.id = r4.id)) AND ((r4.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r10, ARRAY[1]) (15 rows) -- Left join on a subselect on a DHT and a reference table (subselect can be removed, pushdown) @@ -1591,8 +1591,8 @@ SELECT * FROM (SELECT * FROM metric) as sub LEFT JOIN metric_name ON sub.id=metr LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM (SELECT * FROM metric) as sub LEFT JOIN metric_name ON sub.id=metric_name.id WHERE name LIKE 'cpu%'; DEBUG: try to push down a join on a reference table - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric.ts, metric.id, metric.value, metric_name.id, metric_name.name -> Append (actual rows=4 loops=1) @@ -1601,13 +1601,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r9.ts, r9.id, r9.value, r2.id, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1, 2, 3]) + Remote SQL: SELECT r9.ts, r9.id, r9.value, r2.id, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.ts, metric_2.id, metric_2.value, metric_name.id, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r10.ts, r10.id, r10.value, r2.id, r2.name FROM (public.metric r10 INNER JOIN public.metric_name r2 ON (((r10.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r10, ARRAY[1]) + Remote SQL: SELECT r10.ts, r10.id, r10.value, r2.id, r2.name FROM (public.metric r10 INNER JOIN public.metric_name r2 ON (((r10.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r10, ARRAY[1]) (15 rows) -- Left join and hypertable on left and right (no pushdown) @@ -1615,8 +1615,8 @@ DEBUG: try to push down a join on a reference table SELECT * FROM metric m1 LEFT JOIN metric m2 USING (id) WHERE m1.id = 2; LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric m1 LEFT JOIN metric m2 USING (id) WHERE m1.id = 2; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------- Nested Loop Left Join (actual rows=1 loops=1) Output: m1.id, m1.ts, m1.value, m2.ts, m2.value Join Filter: (m1.id = m2.id) @@ -1625,7 +1625,7 @@ SELECT * FROM metric m1 LEFT JOIN metric m2 USING (id) WHERE m1.id = 2; Data node: db_dist_ref_table_join_2 Fetcher Type: Cursor Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1]) AND ((id = 2)) + Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1]) AND ((id = 2)) -> Custom Scan (AsyncAppend) (actual rows=1 loops=1) Output: m2.ts, m2.value, m2.id -> Append (actual rows=1 loops=1) @@ -1634,13 +1634,13 @@ SELECT * FROM metric m1 LEFT JOIN metric m2 USING (id) WHERE m1.id = 2; Data node: db_dist_ref_table_join_1 Fetcher Type: Cursor Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1, 2, 3]) AND ((id = 2)) + Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1, 2, 3]) AND ((id = 2)) -> Custom Scan (DataNodeScan) on public.metric m2_2 (actual rows=1 loops=1) Output: m2_2.ts, m2_2.value, m2_2.id Data node: db_dist_ref_table_join_2 Fetcher Type: Cursor Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1]) AND ((id = 2)) + Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1]) AND ((id = 2)) (24 rows) -- Left join and reference table on left and right @@ -1670,8 +1670,8 @@ SELECT count(*) FROM metric m1 LEFT JOIN metric_name m2 USING (id) WHERE m2.name LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT count(*) FROM metric m1 LEFT JOIN metric_name m2 USING (id) WHERE m2.name LIKE 'cpu%'; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (actual rows=1 loops=1) Output: count(*) -> Custom Scan (AsyncAppend) (actual rows=4 loops=1) @@ -1680,12 +1680,12 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT NULL FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT NULL FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT NULL FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT NULL FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (14 rows) -- Lateral joins that can be converted into regular joins @@ -1694,8 +1694,8 @@ SELECT * FROM metric m1 LEFT JOIN LATERAL (SELECT * FROM metric_name m2 WHERE m1 LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric m1 LEFT JOIN LATERAL (SELECT * FROM metric_name m2 WHERE m1.id = m2.id) t ON TRUE; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: m1.ts, m1.id, m1.value, m2.id, m2.name -> Append (actual rows=4 loops=1) @@ -1704,13 +1704,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r9.ts, r9.id, r9.value, r4.id, r4.name FROM (public.metric r9 LEFT JOIN public.metric_name r4 ON (((r9.id = r4.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1, 2, 3]) + Remote SQL: SELECT r9.ts, r9.id, r9.value, r4.id, r4.name FROM (public.metric r9 LEFT JOIN public.metric_name r4 ON (((r9.id = r4.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: m1_2.ts, m1_2.id, m1_2.value, m2.id, m2.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r10.ts, r10.id, r10.value, r4.id, r4.name FROM (public.metric r10 LEFT JOIN public.metric_name r4 ON (((r10.id = r4.id)))) WHERE _timescaledb_internal.chunks_in(r10, ARRAY[1]) + Remote SQL: SELECT r10.ts, r10.id, r10.value, r4.id, r4.name FROM (public.metric r10 LEFT JOIN public.metric_name r4 ON (((r10.id = r4.id)))) WHERE _timescaledb_functions.chunks_in(r10, ARRAY[1]) (15 rows) :PREFIX @@ -1718,8 +1718,8 @@ SELECT * FROM metric m1 LEFT JOIN LATERAL (SELECT * FROM metric_name m2 WHERE m1 LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric m1 LEFT JOIN LATERAL (SELECT * FROM metric_name m2 WHERE m1.id > m2.id) t ON TRUE; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: m1.ts, m1.id, m1.value, m2.id, m2.name -> Append (actual rows=4 loops=1) @@ -1728,13 +1728,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r9.ts, r9.id, r9.value, r4.id, r4.name FROM (public.metric r9 LEFT JOIN public.metric_name r4 ON (((r9.id > r4.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1, 2, 3]) + Remote SQL: SELECT r9.ts, r9.id, r9.value, r4.id, r4.name FROM (public.metric r9 LEFT JOIN public.metric_name r4 ON (((r9.id > r4.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: m1_2.ts, m1_2.id, m1_2.value, m2.id, m2.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r10.ts, r10.id, r10.value, r4.id, r4.name FROM (public.metric r10 LEFT JOIN public.metric_name r4 ON (((r10.id > r4.id)))) WHERE _timescaledb_internal.chunks_in(r10, ARRAY[1]) + Remote SQL: SELECT r10.ts, r10.id, r10.value, r4.id, r4.name FROM (public.metric r10 LEFT JOIN public.metric_name r4 ON (((r10.id > r4.id)))) WHERE _timescaledb_functions.chunks_in(r10, ARRAY[1]) (15 rows) -- Lateral join that can not be converted and pushed down @@ -1742,8 +1742,8 @@ DEBUG: try to push down a join on a reference table SELECT * FROM metric m1 LEFT JOIN LATERAL (SELECT * FROM metric_name m2 WHERE m1.id > m2.id ORDER BY m2.name LIMIT 1) t ON TRUE; LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric m1 LEFT JOIN LATERAL (SELECT * FROM metric_name m2 WHERE m1.id > m2.id ORDER BY m2.name LIMIT 1) t ON TRUE; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------- Nested Loop Left Join (actual rows=4 loops=1) Output: m1.ts, m1.id, m1.value, m2.id, m2.name -> Custom Scan (AsyncAppend) (actual rows=4 loops=1) @@ -1754,13 +1754,13 @@ SELECT * FROM metric m1 LEFT JOIN LATERAL (SELECT * FROM metric_name m2 WHERE m1 Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1, 2, 3]) + Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) on public.metric m1_2 (actual rows=1 loops=1) Output: m1_2.ts, m1_2.id, m1_2.value Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1]) + Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1]) -> Limit (actual rows=0 loops=4) Output: m2.id, m2.name -> Sort (actual rows=0 loops=4) @@ -1778,8 +1778,8 @@ SELECT * FROM metric m1 LEFT JOIN LATERAL (SELECT * FROM metric_name m2 WHERE m1 SELECT * FROM metric m1 LEFT JOIN metric m2 USING (id) LEFT JOIN metric_name mn USING(id); LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric m1 LEFT JOIN metric m2 USING (id) LEFT JOIN metric_name mn USING(id); - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------- Hash Left Join (actual rows=10 loops=1) Output: m1.id, m1.ts, m1.value, m2.ts, m2.value, mn.name Inner Unique: true @@ -1796,13 +1796,13 @@ SELECT * FROM metric m1 LEFT JOIN metric m2 USING (id) LEFT JOIN metric_name mn Data node: db_dist_ref_table_join_1 Fetcher Type: Cursor Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1, 2, 3]) + Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) on public.metric m1_2 (actual rows=1 loops=1) Output: m1_2.id, m1_2.ts, m1_2.value Data node: db_dist_ref_table_join_2 Fetcher Type: Cursor Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1]) + Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1]) -> Materialize (actual rows=4 loops=4) Output: m2.ts, m2.value, m2.id -> Custom Scan (AsyncAppend) (actual rows=4 loops=1) @@ -1813,13 +1813,13 @@ SELECT * FROM metric m1 LEFT JOIN metric m2 USING (id) LEFT JOIN metric_name mn Data node: db_dist_ref_table_join_1 Fetcher Type: Cursor Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1, 2, 3]) + Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) on public.metric m2_2 (actual rows=1 loops=1) Output: m2_2.ts, m2_2.value, m2_2.id Data node: db_dist_ref_table_join_2 Fetcher Type: Cursor Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1]) + Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1]) -> Hash (actual rows=2 loops=1) Output: mn.name, mn.id Buckets: 1024 Batches: 1 @@ -1844,8 +1844,8 @@ FROM metric JOIN metric_name ON texteq('cpu' || textin(int4out(metric.id)), name GROUP BY name ORDER BY name; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ GroupAggregate (actual rows=2 loops=1) Output: metric_name.name, max(metric.value), count(*) Group Key: metric_name.name @@ -1858,13 +1858,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON ((texteq(('cpu'::text || textin(int4out(r8.id))), r2.name)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS LAST + Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON ((texteq(('cpu'::text || textin(int4out(r8.id))), r2.name)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS LAST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON ((texteq(('cpu'::text || textin(int4out(r9.id))), r2.name)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST + Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON ((texteq(('cpu'::text || textin(int4out(r9.id))), r2.name)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST (19 rows) -- Non-shippable equality class join @@ -1880,8 +1880,8 @@ GROUP BY name ORDER BY name; DEBUG: try to push down a join on a reference table DEBUG: join pushdown on reference table is not supported for the used query - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate (actual rows=2 loops=1) Output: metric_name.name, max(metric.value), count(*) Group Key: metric_name.name @@ -1900,13 +1900,13 @@ DEBUG: join pushdown on reference table is not supported for the used query Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1, 2, 3]) + Remote SQL: SELECT id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) on public.metric metric_2 (actual rows=1 loops=1) Output: metric_2.value, metric_2.id Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1]) + Remote SQL: SELECT id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1]) -> Sort (actual rows=4 loops=1) Output: metric_name.name Sort Key: metric_name.name @@ -1928,8 +1928,8 @@ GROUP BY name ORDER BY name; DEBUG: try to push down a join on a reference table DEBUG: join pushdown on reference table is not supported for the used query - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate (actual rows=2 loops=1) Output: metric_name.name, max(metric.value), count(*) Group Key: metric_name.name @@ -1949,13 +1949,13 @@ DEBUG: join pushdown on reference table is not supported for the used query Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1, 2, 3]) + Remote SQL: SELECT id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) on public.metric metric_2 (actual rows=1 loops=1) Output: metric_2.value, metric_2.id Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1]) + Remote SQL: SELECT id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1]) -> Materialize (actual rows=2 loops=4) Output: metric_name.name -> Seq Scan on public.metric_name (actual rows=2 loops=1) @@ -2047,8 +2047,8 @@ SELECT * FROM metric LEFT JOIN metric_name USING (id); :PREFIX SELECT * FROM metric LEFT JOIN metric_name USING (id); - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric.id, metric.ts, metric.value, metric_name.name -> Append (actual rows=4 loops=1) @@ -2057,13 +2057,13 @@ SELECT * FROM metric LEFT JOIN metric_name USING (id); Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.id, metric_2.ts, metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (15 rows) -- Inner join @@ -2074,8 +2074,8 @@ SELECT * FROM metric JOIN metric_name USING (id); :PREFIX SELECT * FROM metric JOIN metric_name USING (id); - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=0 loops=1) Output: metric.id, metric.ts, metric.value, metric_name.name -> Append (actual rows=0 loops=1) @@ -2084,20 +2084,20 @@ SELECT * FROM metric JOIN metric_name USING (id); Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=0 loops=1) Output: metric_2.id, metric_2.ts, metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (15 rows) -- Filter on the NULL column :PREFIX SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE name IS NOT NULL; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=0 loops=1) Output: metric.id, metric.ts, metric.value, metric_name.name -> Append (actual rows=0 loops=1) @@ -2106,19 +2106,19 @@ SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE name IS NOT NULL; Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name IS NOT NULL)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name IS NOT NULL)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=0 loops=1) Output: metric_2.id, metric_2.ts, metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name IS NOT NULL)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name IS NOT NULL)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (15 rows) :PREFIX SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE name = 'cpu1'; - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=0 loops=1) Output: metric.id, metric.ts, metric.value, metric_name.name -> Append (actual rows=0 loops=1) @@ -2127,13 +2127,13 @@ SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE name = 'cpu1'; Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name = 'cpu1'::text)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name = 'cpu1'::text)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=0 loops=1) Output: metric_2.id, metric_2.ts, metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name = 'cpu1'::text)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name = 'cpu1'::text)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (15 rows) ------- diff --git a/tsl/test/expected/dist_ref_table_join-14.out b/tsl/test/expected/dist_ref_table_join-14.out index aecc93252da..41268acea0a 100644 --- a/tsl/test/expected/dist_ref_table_join-14.out +++ b/tsl/test/expected/dist_ref_table_join-14.out @@ -338,8 +338,8 @@ SELECT * FROM metric LEFT JOIN metric_name USING (id); LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric LEFT JOIN metric_name USING (id); DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric.id, metric.ts, metric.value, metric_name.name -> Append (actual rows=4 loops=1) @@ -348,13 +348,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.id, metric_2.ts, metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (15 rows) :PREFIX @@ -362,8 +362,8 @@ SELECT * FROM metric LEFT JOIN metric_name ON metric.id = metric_name.id; LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric LEFT JOIN metric_name ON metric.id = metric_name.id; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric.ts, metric.id, metric.value, metric_name.id, metric_name.name -> Append (actual rows=4 loops=1) @@ -372,13 +372,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.ts, r8.id, r8.value, r2.id, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r8.ts, r8.id, r8.value, r2.id, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.ts, metric_2.id, metric_2.value, metric_name.id, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.ts, r9.id, r9.value, r2.id, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r9.ts, r9.id, r9.value, r2.id, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (15 rows) -- Tests without filter (DHT reftable) @@ -387,8 +387,8 @@ SELECT * FROM metric LEFT JOIN metric_name_dht USING (id); LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric LEFT JOIN metric_name_dht USING (id); DEBUG: try to push down a join on a reference table - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric.id, metric.ts, metric.value, metric_name_dht.name -> Append (actual rows=4 loops=1) @@ -397,13 +397,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: Cursor Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name_dht r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name_dht r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.id, metric_2.ts, metric_2.value, metric_name_dht.name Data node: db_dist_ref_table_join_2 Fetcher Type: Cursor Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name_dht r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name_dht r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (15 rows) -- Tests with filter pushdown @@ -412,8 +412,8 @@ SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE value > 10; LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE value > 10; DEBUG: try to push down a join on a reference table - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric.id, metric.ts, metric.value, metric_name.name -> Append (actual rows=4 loops=1) @@ -422,13 +422,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) AND ((r8.value > 10::double precision)) + Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) AND ((r8.value > 10::double precision)) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.id, metric_2.ts, metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) AND ((r9.value > 10::double precision)) + Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) AND ((r9.value > 10::double precision)) (15 rows) PREPARE prepared_join_pushdown_value (int) AS @@ -440,8 +440,8 @@ EXECUTE prepared_join_pushdown_value(10); LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) EXECUTE prepared_join_pushdown_value(10); DEBUG: try to push down a join on a reference table - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric.id, metric.ts, metric.value, metric_name.name -> Append (actual rows=4 loops=1) @@ -450,13 +450,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) AND ((r8.value > 10::double precision)) + Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) AND ((r8.value > 10::double precision)) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.id, metric_2.ts, metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) AND ((r9.value > 10::double precision)) + Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) AND ((r9.value > 10::double precision)) (15 rows) :PREFIX @@ -464,14 +464,14 @@ SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE ts > '2022-02-02 02: LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE ts > '2022-02-02 02:02:02+03'; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) (actual rows=0 loops=1) Output: metric.id, metric.ts, metric.value, metric_name.name Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT r5.id, r5.ts, r5.value, r2.name FROM (public.metric r5 LEFT JOIN public.metric_name r2 ON (((r5.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r5, ARRAY[1]) AND ((r5.ts > '2022-02-01 15:02:02-08'::timestamp with time zone)) + Remote SQL: SELECT r5.id, r5.ts, r5.value, r2.name FROM (public.metric r5 LEFT JOIN public.metric_name r2 ON (((r5.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r5, ARRAY[1]) AND ((r5.ts > '2022-02-01 15:02:02-08'::timestamp with time zone)) (6 rows) :PREFIX @@ -479,14 +479,14 @@ SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE ts BETWEEN '2022-02- LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE ts BETWEEN '2022-02-02 02:02:02+03' AND '2022-02-02 02:12:02+03'; DEBUG: try to push down a join on a reference table - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric.id, metric.ts, metric.value, metric_name.name Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT r5.id, r5.ts, r5.value, r2.name FROM (public.metric r5 LEFT JOIN public.metric_name r2 ON (((r5.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r5, ARRAY[1]) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)) + Remote SQL: SELECT r5.id, r5.ts, r5.value, r2.name FROM (public.metric r5 LEFT JOIN public.metric_name r2 ON (((r5.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r5, ARRAY[1]) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)) (6 rows) :PREFIX @@ -494,14 +494,14 @@ SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE name LIKE 'cpu%' AND LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE name LIKE 'cpu%' AND ts BETWEEN '2022-02-02 02:02:02+03' AND '2022-02-02 02:12:02+03'; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric.id, metric.ts, metric.value, metric_name.name Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT r5.id, r5.ts, r5.value, r2.name FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_internal.chunks_in(r5, ARRAY[1]) + Remote SQL: SELECT r5.id, r5.ts, r5.value, r2.name FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_functions.chunks_in(r5, ARRAY[1]) (6 rows) :PREFIX @@ -509,8 +509,8 @@ SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE name LIKE 'cpu%'; LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE name LIKE 'cpu%'; DEBUG: try to push down a join on a reference table - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric.id, metric.ts, metric.value, metric_name.name -> Append (actual rows=4 loops=1) @@ -519,13 +519,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.id, metric_2.ts, metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (15 rows) :PREFIX @@ -533,8 +533,8 @@ SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE name = 'cpu2'; LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE name = 'cpu2'; DEBUG: try to push down a join on a reference table - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=1 loops=1) Output: metric.id, metric.ts, metric.value, metric_name.name -> Append (actual rows=1 loops=1) @@ -543,13 +543,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name = 'cpu2'::text)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name = 'cpu2'::text)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.id, metric_2.ts, metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name = 'cpu2'::text)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name = 'cpu2'::text)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (15 rows) :PREFIX @@ -557,8 +557,8 @@ SELECT * FROM metric LEFT JOIN metric_name_dht USING (id) WHERE name LIKE 'cpu%' LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric LEFT JOIN metric_name_dht USING (id) WHERE name LIKE 'cpu%'; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric.id, metric.ts, metric.value, metric_name_dht.name -> Append (actual rows=4 loops=1) @@ -567,13 +567,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: Cursor Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name_dht r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name_dht r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.id, metric_2.ts, metric_2.value, metric_name_dht.name Data node: db_dist_ref_table_join_2 Fetcher Type: Cursor Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name_dht r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name_dht r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (15 rows) -- Tests with an expression that evaluates to false @@ -582,8 +582,8 @@ SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE name LIKE 'cpu1' AND LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE name LIKE 'cpu1' AND name LIKE 'cpu2'; DEBUG: try to push down a join on a reference table - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=0 loops=1) Output: metric.id, metric.ts, metric.value, metric_name.name -> Append (actual rows=0 loops=1) @@ -592,13 +592,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu1'::text)) AND ((r2.name ~~ 'cpu2'::text)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu1'::text)) AND ((r2.name ~~ 'cpu2'::text)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=0 loops=1) Output: metric_2.id, metric_2.ts, metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu1'::text)) AND ((r2.name ~~ 'cpu2'::text)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu1'::text)) AND ((r2.name ~~ 'cpu2'::text)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (15 rows) -- Tests with aliases @@ -607,8 +607,8 @@ SELECT * FROM metric m1 LEFT JOIN metric_name m2 USING (id); LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric m1 LEFT JOIN metric_name m2 USING (id); DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: m1.id, m1.ts, m1.value, m2.name -> Append (actual rows=4 loops=1) @@ -617,13 +617,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: m1_2.id, m1_2.ts, m1_2.value, m2.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (15 rows) :PREFIX @@ -631,8 +631,8 @@ SELECT * FROM metric m1 LEFT JOIN metric_name m2 ON m1.id = m2.id; LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric m1 LEFT JOIN metric_name m2 ON m1.id = m2.id; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: m1.ts, m1.id, m1.value, m2.id, m2.name -> Append (actual rows=4 loops=1) @@ -641,13 +641,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.ts, r8.id, r8.value, r2.id, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r8.ts, r8.id, r8.value, r2.id, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: m1_2.ts, m1_2.id, m1_2.value, m2.id, m2.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.ts, r9.id, r9.value, r2.id, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r9.ts, r9.id, r9.value, r2.id, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (15 rows) :PREFIX @@ -655,8 +655,8 @@ SELECT * FROM metric m1 LEFT JOIN metric_name m2 ON m1.id = m2.id WHERE m1.value LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric m1 LEFT JOIN metric_name m2 ON m1.id = m2.id WHERE m1.value > 10; DEBUG: try to push down a join on a reference table - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: m1.ts, m1.id, m1.value, m2.id, m2.name -> Append (actual rows=4 loops=1) @@ -665,13 +665,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.ts, r8.id, r8.value, r2.id, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) AND ((r8.value > 10::double precision)) + Remote SQL: SELECT r8.ts, r8.id, r8.value, r2.id, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) AND ((r8.value > 10::double precision)) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: m1_2.ts, m1_2.id, m1_2.value, m2.id, m2.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.ts, r9.id, r9.value, r2.id, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) AND ((r9.value > 10::double precision)) + Remote SQL: SELECT r9.ts, r9.id, r9.value, r2.id, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) AND ((r9.value > 10::double precision)) (15 rows) :PREFIX @@ -679,8 +679,8 @@ SELECT * FROM metric m1 LEFT JOIN metric_name m2 ON m1.id = m2.id WHERE m1.value LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric m1 LEFT JOIN metric_name m2 ON m1.id = m2.id WHERE m1.value > 10 AND m2.name LIKE 'cpu%'; DEBUG: try to push down a join on a reference table - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: m1.ts, m1.id, m1.value, m2.id, m2.name -> Append (actual rows=4 loops=1) @@ -689,13 +689,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.ts, r8.id, r8.value, r2.id, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r8.value > 10::double precision)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r8.ts, r8.id, r8.value, r2.id, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r8.value > 10::double precision)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: m1_2.ts, m1_2.id, m1_2.value, m2.id, m2.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.ts, r9.id, r9.value, r2.id, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r9.value > 10::double precision)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r9.ts, r9.id, r9.value, r2.id, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r9.value > 10::double precision)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (15 rows) -- Tests with projections @@ -704,8 +704,8 @@ SELECT name, value FROM metric LEFT JOIN metric_name USING (id) WHERE name LIKE LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value FROM metric LEFT JOIN metric_name USING (id) WHERE name LIKE 'cpu%' AND ts BETWEEN '2022-02-02 02:02:02+03' AND '2022-02-02 02:12:02+03'; DEBUG: try to push down a join on a reference table - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Result (actual rows=1 loops=1) Output: metric_name.name, metric.value -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) @@ -713,7 +713,7 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT r5.value, r2.name FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_internal.chunks_in(r5, ARRAY[1]) + Remote SQL: SELECT r5.value, r2.name FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_functions.chunks_in(r5, ARRAY[1]) (8 rows) :PREFIX @@ -721,14 +721,14 @@ SELECT m1.ts, m1.value FROM metric m1 LEFT JOIN metric_name m2 USING (id) WHERE LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT m1.ts, m1.value FROM metric m1 LEFT JOIN metric_name m2 USING (id) WHERE name LIKE 'cpu%' AND ts BETWEEN '2022-02-02 02:02:02+03' AND '2022-02-02 02:12:02+03'; DEBUG: try to push down a join on a reference table - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: m1.ts, m1.value Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT r5.ts, r5.value FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_internal.chunks_in(r5, ARRAY[1]) + Remote SQL: SELECT r5.ts, r5.value FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_functions.chunks_in(r5, ARRAY[1]) (6 rows) :PREFIX @@ -736,8 +736,8 @@ SELECT m1.id, m1.id FROM metric m1 LEFT JOIN metric_name m2 USING (id) WHERE nam LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT m1.id, m1.id FROM metric m1 LEFT JOIN metric_name m2 USING (id) WHERE name LIKE 'cpu%' AND ts BETWEEN '2022-02-02 02:02:02+03' AND '2022-02-02 02:12:02+03'; DEBUG: try to push down a join on a reference table - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Result (actual rows=1 loops=1) Output: m1.id, m1.id -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) @@ -745,7 +745,7 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT r5.id FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_internal.chunks_in(r5, ARRAY[1]) + Remote SQL: SELECT r5.id FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_functions.chunks_in(r5, ARRAY[1]) (8 rows) :PREFIX @@ -753,14 +753,14 @@ SELECT m1.id, m2.id FROM metric m1 LEFT JOIN metric_name m2 USING (id) WHERE nam LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT m1.id, m2.id FROM metric m1 LEFT JOIN metric_name m2 USING (id) WHERE name LIKE 'cpu%' AND ts BETWEEN '2022-02-02 02:02:02+03' AND '2022-02-02 02:12:02+03'; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: m1.id, m2.id Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT r5.id, r2.id FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_internal.chunks_in(r5, ARRAY[1]) + Remote SQL: SELECT r5.id, r2.id FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_functions.chunks_in(r5, ARRAY[1]) (6 rows) :PREFIX @@ -768,14 +768,14 @@ SELECT m1.*, m2.* FROM metric m1 LEFT JOIN metric_name m2 USING (id) WHERE name LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT m1.*, m2.* FROM metric m1 LEFT JOIN metric_name m2 USING (id) WHERE name LIKE 'cpu%' AND ts BETWEEN '2022-02-02 02:02:02+03' AND '2022-02-02 02:12:02+03'; DEBUG: try to push down a join on a reference table - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: m1.ts, m1.id, m1.value, m2.id, m2.name Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT r5.ts, r5.id, r5.value, r2.id, r2.name FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_internal.chunks_in(r5, ARRAY[1]) + Remote SQL: SELECT r5.ts, r5.id, r5.value, r2.id, r2.name FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_functions.chunks_in(r5, ARRAY[1]) (6 rows) :PREFIX @@ -783,14 +783,14 @@ SELECT * FROM metric m1 LEFT JOIN metric_name m2 USING (id) WHERE name LIKE 'cpu LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric m1 LEFT JOIN metric_name m2 USING (id) WHERE name LIKE 'cpu%' AND ts BETWEEN '2022-02-02 02:02:02+03' AND '2022-02-02 02:12:02+03'; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: m1.id, m1.ts, m1.value, m2.name Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT r5.id, r5.ts, r5.value, r2.name FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_internal.chunks_in(r5, ARRAY[1]) + Remote SQL: SELECT r5.id, r5.ts, r5.value, r2.name FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_functions.chunks_in(r5, ARRAY[1]) (6 rows) -- Ordering @@ -799,8 +799,8 @@ SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name; LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric_name.name, metric.value -> Merge Append (actual rows=4 loops=1) @@ -810,13 +810,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS LAST + Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS LAST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST + Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST (16 rows) :PREFIX @@ -824,8 +824,8 @@ SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name AS LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name ASC; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric_name.name, metric.value -> Merge Append (actual rows=4 loops=1) @@ -835,13 +835,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS LAST + Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS LAST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST + Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST (16 rows) :PREFIX @@ -849,8 +849,8 @@ SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name DE LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name DESC; DEBUG: try to push down a join on a reference table - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric_name.name, metric.value -> Merge Append (actual rows=4 loops=1) @@ -860,13 +860,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name DESC NULLS FIRST + Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name DESC NULLS FIRST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r2.name DESC NULLS FIRST + Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r2.name DESC NULLS FIRST (16 rows) :PREFIX @@ -874,8 +874,8 @@ SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name AS LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name ASC NULLS first; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric_name.name, metric.value -> Merge Append (actual rows=4 loops=1) @@ -885,13 +885,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS FIRST + Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS FIRST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS FIRST + Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS FIRST (16 rows) :PREFIX @@ -899,8 +899,8 @@ SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name AS LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name ASC NULLS last; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric_name.name, metric.value -> Merge Append (actual rows=4 loops=1) @@ -910,13 +910,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS LAST + Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS LAST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST + Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST (16 rows) :PREFIX @@ -924,8 +924,8 @@ SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name DE LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name DESC NULLS first; DEBUG: try to push down a join on a reference table - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric_name.name, metric.value -> Merge Append (actual rows=4 loops=1) @@ -935,13 +935,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name DESC NULLS FIRST + Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name DESC NULLS FIRST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r2.name DESC NULLS FIRST + Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r2.name DESC NULLS FIRST (16 rows) :PREFIX @@ -949,8 +949,8 @@ SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name DE LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name DESC NULLS last; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric_name.name, metric.value -> Merge Append (actual rows=4 loops=1) @@ -960,13 +960,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name DESC NULLS LAST + Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name DESC NULLS LAST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r2.name DESC NULLS LAST + Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r2.name DESC NULLS LAST (16 rows) :PREFIX @@ -974,8 +974,8 @@ SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name, v LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name, value DESC; DEBUG: try to push down a join on a reference table - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric_name.name, metric.value -> Merge Append (actual rows=4 loops=1) @@ -985,13 +985,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS LAST, r8.value DESC NULLS FIRST + Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS LAST, r8.value DESC NULLS FIRST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST, r9.value DESC NULLS FIRST + Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST, r9.value DESC NULLS FIRST (16 rows) :PREFIX @@ -999,8 +999,8 @@ SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY value, LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY value, name DESC; DEBUG: try to push down a join on a reference table - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric_name.name, metric.value -> Merge Append (actual rows=4 loops=1) @@ -1010,13 +1010,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r8.value ASC NULLS LAST, r2.name DESC NULLS FIRST + Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r8.value ASC NULLS LAST, r2.name DESC NULLS FIRST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r9.value ASC NULLS LAST, r2.name DESC NULLS FIRST + Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r9.value ASC NULLS LAST, r2.name DESC NULLS FIRST (16 rows) :PREFIX @@ -1024,8 +1024,8 @@ SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY value A LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY value ASC, name DESC; DEBUG: try to push down a join on a reference table - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric_name.name, metric.value -> Merge Append (actual rows=4 loops=1) @@ -1035,13 +1035,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r8.value ASC NULLS LAST, r2.name DESC NULLS FIRST + Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r8.value ASC NULLS LAST, r2.name DESC NULLS FIRST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r9.value ASC NULLS LAST, r2.name DESC NULLS FIRST + Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r9.value ASC NULLS LAST, r2.name DESC NULLS FIRST (16 rows) :PREFIX @@ -1049,8 +1049,8 @@ SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY value A LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY value ASC NULLS last, name DESC NULLS first; DEBUG: try to push down a join on a reference table - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric_name.name, metric.value -> Merge Append (actual rows=4 loops=1) @@ -1060,13 +1060,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r8.value ASC NULLS LAST, r2.name DESC NULLS FIRST + Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r8.value ASC NULLS LAST, r2.name DESC NULLS FIRST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r9.value ASC NULLS LAST, r2.name DESC NULLS FIRST + Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r9.value ASC NULLS LAST, r2.name DESC NULLS FIRST (16 rows) -- Ordering with explicit table qualification @@ -1075,8 +1075,8 @@ SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY value, LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY value, name, metric_name.id; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric_name.name, metric.value, metric_name.id -> Merge Append (actual rows=4 loops=1) @@ -1086,13 +1086,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name, r2.id FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r8.value ASC NULLS LAST, r2.name ASC NULLS LAST, r2.id ASC NULLS LAST + Remote SQL: SELECT r8.value, r2.name, r2.id FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r8.value ASC NULLS LAST, r2.name ASC NULLS LAST, r2.id ASC NULLS LAST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name, metric_name.id Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name, r2.id FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r9.value ASC NULLS LAST, r2.name ASC NULLS LAST, r2.id ASC NULLS LAST + Remote SQL: SELECT r9.value, r2.name, r2.id FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r9.value ASC NULLS LAST, r2.name ASC NULLS LAST, r2.id ASC NULLS LAST (16 rows) :PREFIX @@ -1100,8 +1100,8 @@ SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY value, LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY value, name, metric_name.id, metric.id; DEBUG: try to push down a join on a reference table - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric_name.name, metric.value, metric_name.id, metric.id -> Merge Append (actual rows=4 loops=1) @@ -1111,13 +1111,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r8.id, r2.name, r2.id FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r8.value ASC NULLS LAST, r2.name ASC NULLS LAST, r2.id ASC NULLS LAST, r8.id ASC NULLS LAST + Remote SQL: SELECT r8.value, r8.id, r2.name, r2.id FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r8.value ASC NULLS LAST, r2.name ASC NULLS LAST, r2.id ASC NULLS LAST, r8.id ASC NULLS LAST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_2.id, metric_name.name, metric_name.id Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r9.id, r2.name, r2.id FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r9.value ASC NULLS LAST, r2.name ASC NULLS LAST, r2.id ASC NULLS LAST, r9.id ASC NULLS LAST + Remote SQL: SELECT r9.value, r9.id, r2.name, r2.id FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r9.value ASC NULLS LAST, r2.name ASC NULLS LAST, r2.id ASC NULLS LAST, r9.id ASC NULLS LAST (16 rows) -- Ordering with explicit table qualification and aliases @@ -1126,8 +1126,8 @@ SELECT name, value FROM metric m1 LEFT JOIN metric_name m2 USING (id) ORDER BY v LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value FROM metric m1 LEFT JOIN metric_name m2 USING (id) ORDER BY value, name, m1.id, m2.id; DEBUG: try to push down a join on a reference table - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: m2.name, m1.value, m1.id, m2.id -> Merge Append (actual rows=4 loops=1) @@ -1137,13 +1137,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r8.id, r2.name, r2.id FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r8.value ASC NULLS LAST, r2.name ASC NULLS LAST, r8.id ASC NULLS LAST, r2.id ASC NULLS LAST + Remote SQL: SELECT r8.value, r8.id, r2.name, r2.id FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r8.value ASC NULLS LAST, r2.name ASC NULLS LAST, r8.id ASC NULLS LAST, r2.id ASC NULLS LAST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: m1_2.value, m1_2.id, m2.name, m2.id Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r9.id, r2.name, r2.id FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r9.value ASC NULLS LAST, r2.name ASC NULLS LAST, r9.id ASC NULLS LAST, r2.id ASC NULLS LAST + Remote SQL: SELECT r9.value, r9.id, r2.name, r2.id FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r9.value ASC NULLS LAST, r2.name ASC NULLS LAST, r9.id ASC NULLS LAST, r2.id ASC NULLS LAST (16 rows) -- Grouping @@ -1152,8 +1152,8 @@ SELECT name FROM metric LEFT JOIN metric_name USING (id) WHERE name LIKE 'cpu%' LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name FROM metric LEFT JOIN metric_name USING (id) WHERE name LIKE 'cpu%' GROUP BY name; DEBUG: try to push down a join on a reference table - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Group (actual rows=2 loops=1) Output: metric_name.name Group Key: metric_name.name @@ -1166,13 +1166,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS LAST + Remote SQL: SELECT r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS LAST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST + Remote SQL: SELECT r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST (19 rows) :PREFIX @@ -1180,8 +1180,8 @@ SELECT name, max(value), min(value) FROM metric LEFT JOIN metric_name USING (id) LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, max(value), min(value) FROM metric LEFT JOIN metric_name USING (id) WHERE name LIKE 'cpu%' GROUP BY name; DEBUG: try to push down a join on a reference table - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate (actual rows=2 loops=1) Output: metric_name.name, max(metric.value), min(metric.value) Group Key: metric_name.name @@ -1194,13 +1194,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS LAST + Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS LAST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST + Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST (19 rows) :PREFIX @@ -1208,8 +1208,8 @@ SELECT name, max(value) FROM metric LEFT JOIN metric_name USING (id) WHERE name LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, max(value) FROM metric LEFT JOIN metric_name USING (id) WHERE name LIKE 'cpu%' AND ts BETWEEN '2022-02-02 02:02:02+03' AND '2022-02-02 02:12:02+03' GROUP BY name; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate (actual rows=1 loops=1) Output: metric_name.name, max(metric.value) Group Key: metric_name.name @@ -1220,7 +1220,7 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT r5.value, r2.name FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_internal.chunks_in(r5, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST + Remote SQL: SELECT r5.value, r2.name FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_functions.chunks_in(r5, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST (11 rows) -- Grouping and sorting @@ -1229,8 +1229,8 @@ SELECT name, max(value), min(value) FROM metric LEFT JOIN metric_name USING (id) LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, max(value), min(value) FROM metric LEFT JOIN metric_name USING (id) WHERE name LIKE 'cpu%' and ts BETWEEN '2000-02-02 02:02:02+03' and '2022-02-02 02:12:02+03' GROUP BY name ORDER BY name DESC; DEBUG: try to push down a join on a reference table - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate (actual rows=2 loops=1) Output: metric_name.name, max(metric.value), min(metric.value) Group Key: metric_name.name @@ -1243,13 +1243,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r8.ts >= '2000-02-01 15:02:02-08'::timestamp with time zone)) AND ((r8.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name DESC NULLS FIRST + Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r8.ts >= '2000-02-01 15:02:02-08'::timestamp with time zone)) AND ((r8.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name DESC NULLS FIRST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r9.ts >= '2000-02-01 15:02:02-08'::timestamp with time zone)) AND ((r9.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r2.name DESC NULLS FIRST + Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r9.ts >= '2000-02-01 15:02:02-08'::timestamp with time zone)) AND ((r9.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r2.name DESC NULLS FIRST (19 rows) -- Having @@ -1258,8 +1258,8 @@ SELECT name, max(value), min(value) FROM metric LEFT JOIN metric_name USING (id) LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, max(value), min(value) FROM metric LEFT JOIN metric_name USING (id) WHERE name LIKE 'cpu%' and ts BETWEEN '2000-02-02 02:02:02+03' and '2022-02-02 02:12:02+03' GROUP BY name having min(value) > 0 ORDER BY name DESC; DEBUG: try to push down a join on a reference table - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate (actual rows=2 loops=1) Output: metric_name.name, max(metric.value), min(metric.value) Group Key: metric_name.name @@ -1273,13 +1273,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r8.ts >= '2000-02-01 15:02:02-08'::timestamp with time zone)) AND ((r8.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name DESC NULLS FIRST + Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r8.ts >= '2000-02-01 15:02:02-08'::timestamp with time zone)) AND ((r8.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name DESC NULLS FIRST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r9.ts >= '2000-02-01 15:02:02-08'::timestamp with time zone)) AND ((r9.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r2.name DESC NULLS FIRST + Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r9.ts >= '2000-02-01 15:02:02-08'::timestamp with time zone)) AND ((r9.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r2.name DESC NULLS FIRST (20 rows) -- Rank @@ -1287,8 +1287,8 @@ DEBUG: try to push down a join on a reference table SELECT name, value, RANK () OVER (ORDER by value) from metric join metric_name_local USING (id); LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value, RANK () OVER (ORDER by value) from metric join metric_name_local USING (id); - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- WindowAgg (actual rows=4 loops=1) Output: metric_name_local.name, metric.value, rank() OVER (?) -> Nested Loop (actual rows=4 loops=1) @@ -1303,13 +1303,13 @@ SELECT name, value, RANK () OVER (ORDER by value) from metric join metric_name_l Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1, 2, 3]) ORDER BY value ASC NULLS LAST + Remote SQL: SELECT id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1, 2, 3]) ORDER BY value ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.metric metric_2 (actual rows=1 loops=1) Output: metric_2.value, metric_2.id Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1]) ORDER BY value ASC NULLS LAST + Remote SQL: SELECT id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1]) ORDER BY value ASC NULLS LAST -> Index Scan using metric_name_local_pkey on public.metric_name_local (actual rows=1 loops=4) Output: metric_name_local.id, metric_name_local.name Index Cond: (metric_name_local.id = metric.id) @@ -1331,8 +1331,8 @@ DEBUG: try to push down a join on a reference table SELECT * FROM metric_name LEFT JOIN metric USING (id) WHERE name LIKE 'cpu%'; LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric_name LEFT JOIN metric USING (id) WHERE name LIKE 'cpu%'; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------- Nested Loop Left Join (actual rows=4 loops=1) Output: metric_name.id, metric_name.name, metric.ts, metric.value Join Filter: (metric_name.id = metric.id) @@ -1350,13 +1350,13 @@ SELECT * FROM metric_name LEFT JOIN metric USING (id) WHERE name LIKE 'cpu%'; Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1, 2, 3]) + Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) on public.metric metric_2 (actual rows=1 loops=1) Output: metric_2.ts, metric_2.value, metric_2.id Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1]) + Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1]) (24 rows) -- Right join reference table on the left, hypertable on the right (can be converted into a left join by PostgreSQL, pushdown) @@ -1365,8 +1365,8 @@ SELECT * FROM metric_name RIGHT JOIN metric USING (id) WHERE name LIKE 'cpu%'; LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric_name RIGHT JOIN metric USING (id) WHERE name LIKE 'cpu%'; DEBUG: try to push down a join on a reference table - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric.id, metric_name.name, metric.ts, metric.value -> Append (actual rows=4 loops=1) @@ -1375,13 +1375,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r1.name, r8.id, r8.ts, r8.value FROM (public.metric r8 INNER JOIN public.metric_name r1 ON (((r1.id = r8.id)) AND ((r1.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r1.name, r8.id, r8.ts, r8.value FROM (public.metric r8 INNER JOIN public.metric_name r1 ON (((r1.id = r8.id)) AND ((r1.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_name.name, metric_2.id, metric_2.ts, metric_2.value Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r1.name, r9.id, r9.ts, r9.value FROM (public.metric r9 INNER JOIN public.metric_name r1 ON (((r1.id = r9.id)) AND ((r1.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r1.name, r9.id, r9.ts, r9.value FROM (public.metric r9 INNER JOIN public.metric_name r1 ON (((r1.id = r9.id)) AND ((r1.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (15 rows) -- Right join hypertable on the left, reference table on the right (no pushdown) @@ -1389,8 +1389,8 @@ DEBUG: try to push down a join on a reference table SELECT * FROM metric RIGHT JOIN metric_name USING (id) WHERE name LIKE 'cpu%'; LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric RIGHT JOIN metric_name USING (id) WHERE name LIKE 'cpu%'; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------- Nested Loop Left Join (actual rows=4 loops=1) Output: metric_name.id, metric.ts, metric.value, metric_name.name Join Filter: (metric.id = metric_name.id) @@ -1408,13 +1408,13 @@ SELECT * FROM metric RIGHT JOIN metric_name USING (id) WHERE name LIKE 'cpu%'; Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1, 2, 3]) + Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) on public.metric metric_2 (actual rows=1 loops=1) Output: metric_2.ts, metric_2.value, metric_2.id Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1]) + Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1]) (24 rows) -- Inner join and reference table left, hypertable on the right (pushdown) @@ -1423,8 +1423,8 @@ SELECT * FROM metric_name INNER JOIN metric USING (id) WHERE name LIKE 'cpu%'; LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric_name INNER JOIN metric USING (id) WHERE name LIKE 'cpu%'; DEBUG: try to push down a join on a reference table - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric_name.id, metric_name.name, metric.ts, metric.value -> Append (actual rows=4 loops=1) @@ -1433,13 +1433,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r1.id, r1.name, r8.ts, r8.value FROM (public.metric r8 INNER JOIN public.metric_name r1 ON (((r1.id = r8.id)) AND ((r1.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r1.id, r1.name, r8.ts, r8.value FROM (public.metric r8 INNER JOIN public.metric_name r1 ON (((r1.id = r8.id)) AND ((r1.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_name.id, metric_name.name, metric_2.ts, metric_2.value Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r1.id, r1.name, r9.ts, r9.value FROM (public.metric r9 INNER JOIN public.metric_name r1 ON (((r1.id = r9.id)) AND ((r1.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r1.id, r1.name, r9.ts, r9.value FROM (public.metric r9 INNER JOIN public.metric_name r1 ON (((r1.id = r9.id)) AND ((r1.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (15 rows) -- Implicit join on two tables, hypertable left, reference table right (pushdown) @@ -1448,8 +1448,8 @@ SELECT * FROM metric m1, metric_name m2 WHERE m1.id=m2.id AND name LIKE 'cpu%'; LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric m1, metric_name m2 WHERE m1.id=m2.id AND name LIKE 'cpu%'; DEBUG: try to push down a join on a reference table - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: m1.ts, m1.id, m1.value, m2.id, m2.name -> Append (actual rows=4 loops=1) @@ -1458,13 +1458,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r7.ts, r7.id, r7.value, r2.id, r2.name FROM (public.metric r7 INNER JOIN public.metric_name r2 ON (((r7.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r7, ARRAY[1, 2, 3]) + Remote SQL: SELECT r7.ts, r7.id, r7.value, r2.id, r2.name FROM (public.metric r7 INNER JOIN public.metric_name r2 ON (((r7.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r7, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: m1_2.ts, m1_2.id, m1_2.value, m2.id, m2.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r8.ts, r8.id, r8.value, r2.id, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1]) + Remote SQL: SELECT r8.ts, r8.id, r8.value, r2.id, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1]) (15 rows) -- Implicit join on two tables, reference table left, hypertable right (pushdown) @@ -1473,8 +1473,8 @@ SELECT * FROM metric m2, metric_name m1 WHERE m1.id=m2.id AND name LIKE 'cpu%'; LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric m2, metric_name m1 WHERE m1.id=m2.id AND name LIKE 'cpu%'; DEBUG: try to push down a join on a reference table - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: m2.ts, m2.id, m2.value, m1.id, m1.name -> Append (actual rows=4 loops=1) @@ -1483,13 +1483,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r7.ts, r7.id, r7.value, r2.id, r2.name FROM (public.metric r7 INNER JOIN public.metric_name r2 ON (((r7.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r7, ARRAY[1, 2, 3]) + Remote SQL: SELECT r7.ts, r7.id, r7.value, r2.id, r2.name FROM (public.metric r7 INNER JOIN public.metric_name r2 ON (((r7.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r7, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: m2_2.ts, m2_2.id, m2_2.value, m1.id, m1.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r8.ts, r8.id, r8.value, r2.id, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1]) + Remote SQL: SELECT r8.ts, r8.id, r8.value, r2.id, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1]) (15 rows) -- Implicit join on three tables (no pushdown) @@ -1497,8 +1497,8 @@ DEBUG: try to push down a join on a reference table SELECT * FROM metric m1, metric_name m2, metric_name m3 WHERE m1.id=m2.id AND m2.id = m3.id AND m3.name LIKE 'cpu%'; LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric m1, metric_name m2, metric_name m3 WHERE m1.id=m2.id AND m2.id = m3.id AND m3.name LIKE 'cpu%'; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------- Nested Loop (actual rows=4 loops=1) Output: m1.ts, m1.id, m1.value, m2.id, m2.name, m3.id, m3.name Inner Unique: true @@ -1517,13 +1517,13 @@ SELECT * FROM metric m1, metric_name m2, metric_name m3 WHERE m1.id=m2.id AND m2 Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1, 2, 3]) + Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) on public.metric m1_2 (actual rows=1 loops=1) Output: m1_2.ts, m1_2.id, m1_2.value Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1]) + Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1]) -> Materialize (actual rows=1 loops=4) Output: m2.id, m2.name -> Seq Scan on public.metric_name m2 (actual rows=2 loops=1) @@ -1541,8 +1541,8 @@ SELECT * FROM metric LEFT JOIN (SELECT * FROM metric_name) AS sub ON metric.id=s LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric LEFT JOIN (SELECT * FROM metric_name) AS sub ON metric.id=sub.id; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric.ts, metric.id, metric.value, metric_name.id, metric_name.name -> Append (actual rows=4 loops=1) @@ -1551,13 +1551,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r9.ts, r9.id, r9.value, r4.id, r4.name FROM (public.metric r9 LEFT JOIN public.metric_name r4 ON (((r9.id = r4.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1, 2, 3]) + Remote SQL: SELECT r9.ts, r9.id, r9.value, r4.id, r4.name FROM (public.metric r9 LEFT JOIN public.metric_name r4 ON (((r9.id = r4.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.ts, metric_2.id, metric_2.value, metric_name.id, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r10.ts, r10.id, r10.value, r4.id, r4.name FROM (public.metric r10 LEFT JOIN public.metric_name r4 ON (((r10.id = r4.id)))) WHERE _timescaledb_internal.chunks_in(r10, ARRAY[1]) + Remote SQL: SELECT r10.ts, r10.id, r10.value, r4.id, r4.name FROM (public.metric r10 LEFT JOIN public.metric_name r4 ON (((r10.id = r4.id)))) WHERE _timescaledb_functions.chunks_in(r10, ARRAY[1]) (15 rows) -- Left join on a DHT and a subselect with filter on a reference table (subselect can be removed, pushdown) @@ -1566,8 +1566,8 @@ SELECT * FROM metric LEFT JOIN (SELECT * FROM metric_name WHERE name LIKE 'cpu%' LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric LEFT JOIN (SELECT * FROM metric_name WHERE name LIKE 'cpu%') AS sub ON metric.id=sub.id; DEBUG: try to push down a join on a reference table - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric.ts, metric.id, metric.value, metric_name.id, metric_name.name -> Append (actual rows=4 loops=1) @@ -1576,13 +1576,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r9.ts, r9.id, r9.value, r4.id, r4.name FROM (public.metric r9 LEFT JOIN public.metric_name r4 ON (((r9.id = r4.id)) AND ((r4.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1, 2, 3]) + Remote SQL: SELECT r9.ts, r9.id, r9.value, r4.id, r4.name FROM (public.metric r9 LEFT JOIN public.metric_name r4 ON (((r9.id = r4.id)) AND ((r4.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.ts, metric_2.id, metric_2.value, metric_name.id, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r10.ts, r10.id, r10.value, r4.id, r4.name FROM (public.metric r10 LEFT JOIN public.metric_name r4 ON (((r10.id = r4.id)) AND ((r4.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r10, ARRAY[1]) + Remote SQL: SELECT r10.ts, r10.id, r10.value, r4.id, r4.name FROM (public.metric r10 LEFT JOIN public.metric_name r4 ON (((r10.id = r4.id)) AND ((r4.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r10, ARRAY[1]) (15 rows) -- Left join on a subselect on a DHT and a reference table (subselect can be removed, pushdown) @@ -1591,8 +1591,8 @@ SELECT * FROM (SELECT * FROM metric) as sub LEFT JOIN metric_name ON sub.id=metr LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM (SELECT * FROM metric) as sub LEFT JOIN metric_name ON sub.id=metric_name.id WHERE name LIKE 'cpu%'; DEBUG: try to push down a join on a reference table - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric.ts, metric.id, metric.value, metric_name.id, metric_name.name -> Append (actual rows=4 loops=1) @@ -1601,13 +1601,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r9.ts, r9.id, r9.value, r2.id, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1, 2, 3]) + Remote SQL: SELECT r9.ts, r9.id, r9.value, r2.id, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.ts, metric_2.id, metric_2.value, metric_name.id, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r10.ts, r10.id, r10.value, r2.id, r2.name FROM (public.metric r10 INNER JOIN public.metric_name r2 ON (((r10.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r10, ARRAY[1]) + Remote SQL: SELECT r10.ts, r10.id, r10.value, r2.id, r2.name FROM (public.metric r10 INNER JOIN public.metric_name r2 ON (((r10.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r10, ARRAY[1]) (15 rows) -- Left join and hypertable on left and right (no pushdown) @@ -1615,8 +1615,8 @@ DEBUG: try to push down a join on a reference table SELECT * FROM metric m1 LEFT JOIN metric m2 USING (id) WHERE m1.id = 2; LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric m1 LEFT JOIN metric m2 USING (id) WHERE m1.id = 2; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------- Nested Loop Left Join (actual rows=1 loops=1) Output: m1.id, m1.ts, m1.value, m2.ts, m2.value Join Filter: (m1.id = m2.id) @@ -1625,7 +1625,7 @@ SELECT * FROM metric m1 LEFT JOIN metric m2 USING (id) WHERE m1.id = 2; Data node: db_dist_ref_table_join_2 Fetcher Type: Cursor Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1]) AND ((id = 2)) + Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1]) AND ((id = 2)) -> Custom Scan (AsyncAppend) (actual rows=1 loops=1) Output: m2.ts, m2.value, m2.id -> Append (actual rows=1 loops=1) @@ -1634,13 +1634,13 @@ SELECT * FROM metric m1 LEFT JOIN metric m2 USING (id) WHERE m1.id = 2; Data node: db_dist_ref_table_join_1 Fetcher Type: Cursor Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1, 2, 3]) AND ((id = 2)) + Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1, 2, 3]) AND ((id = 2)) -> Custom Scan (DataNodeScan) on public.metric m2_2 (actual rows=1 loops=1) Output: m2_2.ts, m2_2.value, m2_2.id Data node: db_dist_ref_table_join_2 Fetcher Type: Cursor Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1]) AND ((id = 2)) + Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1]) AND ((id = 2)) (24 rows) -- Left join and reference table on left and right @@ -1670,8 +1670,8 @@ SELECT count(*) FROM metric m1 LEFT JOIN metric_name m2 USING (id) WHERE m2.name LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT count(*) FROM metric m1 LEFT JOIN metric_name m2 USING (id) WHERE m2.name LIKE 'cpu%'; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (actual rows=1 loops=1) Output: count(*) -> Custom Scan (AsyncAppend) (actual rows=4 loops=1) @@ -1680,12 +1680,12 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT NULL FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT NULL FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT NULL FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT NULL FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (14 rows) -- Lateral joins that can be converted into regular joins @@ -1694,8 +1694,8 @@ SELECT * FROM metric m1 LEFT JOIN LATERAL (SELECT * FROM metric_name m2 WHERE m1 LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric m1 LEFT JOIN LATERAL (SELECT * FROM metric_name m2 WHERE m1.id = m2.id) t ON TRUE; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: m1.ts, m1.id, m1.value, m2.id, m2.name -> Append (actual rows=4 loops=1) @@ -1704,13 +1704,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r9.ts, r9.id, r9.value, r4.id, r4.name FROM (public.metric r9 LEFT JOIN public.metric_name r4 ON (((r9.id = r4.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1, 2, 3]) + Remote SQL: SELECT r9.ts, r9.id, r9.value, r4.id, r4.name FROM (public.metric r9 LEFT JOIN public.metric_name r4 ON (((r9.id = r4.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: m1_2.ts, m1_2.id, m1_2.value, m2.id, m2.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r10.ts, r10.id, r10.value, r4.id, r4.name FROM (public.metric r10 LEFT JOIN public.metric_name r4 ON (((r10.id = r4.id)))) WHERE _timescaledb_internal.chunks_in(r10, ARRAY[1]) + Remote SQL: SELECT r10.ts, r10.id, r10.value, r4.id, r4.name FROM (public.metric r10 LEFT JOIN public.metric_name r4 ON (((r10.id = r4.id)))) WHERE _timescaledb_functions.chunks_in(r10, ARRAY[1]) (15 rows) :PREFIX @@ -1718,8 +1718,8 @@ SELECT * FROM metric m1 LEFT JOIN LATERAL (SELECT * FROM metric_name m2 WHERE m1 LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric m1 LEFT JOIN LATERAL (SELECT * FROM metric_name m2 WHERE m1.id > m2.id) t ON TRUE; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: m1.ts, m1.id, m1.value, m2.id, m2.name -> Append (actual rows=4 loops=1) @@ -1728,13 +1728,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r9.ts, r9.id, r9.value, r4.id, r4.name FROM (public.metric r9 LEFT JOIN public.metric_name r4 ON (((r9.id > r4.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1, 2, 3]) + Remote SQL: SELECT r9.ts, r9.id, r9.value, r4.id, r4.name FROM (public.metric r9 LEFT JOIN public.metric_name r4 ON (((r9.id > r4.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: m1_2.ts, m1_2.id, m1_2.value, m2.id, m2.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r10.ts, r10.id, r10.value, r4.id, r4.name FROM (public.metric r10 LEFT JOIN public.metric_name r4 ON (((r10.id > r4.id)))) WHERE _timescaledb_internal.chunks_in(r10, ARRAY[1]) + Remote SQL: SELECT r10.ts, r10.id, r10.value, r4.id, r4.name FROM (public.metric r10 LEFT JOIN public.metric_name r4 ON (((r10.id > r4.id)))) WHERE _timescaledb_functions.chunks_in(r10, ARRAY[1]) (15 rows) -- Lateral join that can not be converted and pushed down @@ -1742,8 +1742,8 @@ DEBUG: try to push down a join on a reference table SELECT * FROM metric m1 LEFT JOIN LATERAL (SELECT * FROM metric_name m2 WHERE m1.id > m2.id ORDER BY m2.name LIMIT 1) t ON TRUE; LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric m1 LEFT JOIN LATERAL (SELECT * FROM metric_name m2 WHERE m1.id > m2.id ORDER BY m2.name LIMIT 1) t ON TRUE; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------- Nested Loop Left Join (actual rows=4 loops=1) Output: m1.ts, m1.id, m1.value, m2.id, m2.name -> Custom Scan (AsyncAppend) (actual rows=4 loops=1) @@ -1754,13 +1754,13 @@ SELECT * FROM metric m1 LEFT JOIN LATERAL (SELECT * FROM metric_name m2 WHERE m1 Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1, 2, 3]) + Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) on public.metric m1_2 (actual rows=1 loops=1) Output: m1_2.ts, m1_2.id, m1_2.value Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1]) + Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1]) -> Limit (actual rows=0 loops=4) Output: m2.id, m2.name -> Sort (actual rows=0 loops=4) @@ -1778,8 +1778,8 @@ SELECT * FROM metric m1 LEFT JOIN LATERAL (SELECT * FROM metric_name m2 WHERE m1 SELECT * FROM metric m1 LEFT JOIN metric m2 USING (id) LEFT JOIN metric_name mn USING(id); LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric m1 LEFT JOIN metric m2 USING (id) LEFT JOIN metric_name mn USING(id); - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------- Hash Left Join (actual rows=10 loops=1) Output: m1.id, m1.ts, m1.value, m2.ts, m2.value, mn.name Inner Unique: true @@ -1796,13 +1796,13 @@ SELECT * FROM metric m1 LEFT JOIN metric m2 USING (id) LEFT JOIN metric_name mn Data node: db_dist_ref_table_join_1 Fetcher Type: Cursor Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1, 2, 3]) + Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) on public.metric m1_2 (actual rows=1 loops=1) Output: m1_2.id, m1_2.ts, m1_2.value Data node: db_dist_ref_table_join_2 Fetcher Type: Cursor Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1]) + Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1]) -> Materialize (actual rows=4 loops=4) Output: m2.ts, m2.value, m2.id -> Custom Scan (AsyncAppend) (actual rows=4 loops=1) @@ -1813,13 +1813,13 @@ SELECT * FROM metric m1 LEFT JOIN metric m2 USING (id) LEFT JOIN metric_name mn Data node: db_dist_ref_table_join_1 Fetcher Type: Cursor Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1, 2, 3]) + Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) on public.metric m2_2 (actual rows=1 loops=1) Output: m2_2.ts, m2_2.value, m2_2.id Data node: db_dist_ref_table_join_2 Fetcher Type: Cursor Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1]) + Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1]) -> Hash (actual rows=2 loops=1) Output: mn.name, mn.id Buckets: 1024 Batches: 1 @@ -1844,8 +1844,8 @@ FROM metric JOIN metric_name ON texteq('cpu' || textin(int4out(metric.id)), name GROUP BY name ORDER BY name; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ GroupAggregate (actual rows=2 loops=1) Output: metric_name.name, max(metric.value), count(*) Group Key: metric_name.name @@ -1858,13 +1858,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON ((texteq(('cpu'::text || textin(int4out(r8.id))), r2.name)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS LAST + Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON ((texteq(('cpu'::text || textin(int4out(r8.id))), r2.name)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS LAST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON ((texteq(('cpu'::text || textin(int4out(r9.id))), r2.name)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST + Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON ((texteq(('cpu'::text || textin(int4out(r9.id))), r2.name)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST (19 rows) -- Non-shippable equality class join @@ -1880,8 +1880,8 @@ GROUP BY name ORDER BY name; DEBUG: try to push down a join on a reference table DEBUG: join pushdown on reference table is not supported for the used query - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate (actual rows=2 loops=1) Output: metric_name.name, max(metric.value), count(*) Group Key: metric_name.name @@ -1900,13 +1900,13 @@ DEBUG: join pushdown on reference table is not supported for the used query Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1, 2, 3]) + Remote SQL: SELECT id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) on public.metric metric_2 (actual rows=1 loops=1) Output: metric_2.value, metric_2.id Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1]) + Remote SQL: SELECT id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1]) -> Sort (actual rows=4 loops=1) Output: metric_name.name Sort Key: metric_name.name @@ -1928,8 +1928,8 @@ GROUP BY name ORDER BY name; DEBUG: try to push down a join on a reference table DEBUG: join pushdown on reference table is not supported for the used query - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate (actual rows=2 loops=1) Output: metric_name.name, max(metric.value), count(*) Group Key: metric_name.name @@ -1949,13 +1949,13 @@ DEBUG: join pushdown on reference table is not supported for the used query Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1, 2, 3]) + Remote SQL: SELECT id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) on public.metric metric_2 (actual rows=1 loops=1) Output: metric_2.value, metric_2.id Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1]) + Remote SQL: SELECT id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1]) -> Materialize (actual rows=2 loops=4) Output: metric_name.name -> Seq Scan on public.metric_name (actual rows=2 loops=1) @@ -2047,8 +2047,8 @@ SELECT * FROM metric LEFT JOIN metric_name USING (id); :PREFIX SELECT * FROM metric LEFT JOIN metric_name USING (id); - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric.id, metric.ts, metric.value, metric_name.name -> Append (actual rows=4 loops=1) @@ -2057,13 +2057,13 @@ SELECT * FROM metric LEFT JOIN metric_name USING (id); Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.id, metric_2.ts, metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (15 rows) -- Inner join @@ -2074,8 +2074,8 @@ SELECT * FROM metric JOIN metric_name USING (id); :PREFIX SELECT * FROM metric JOIN metric_name USING (id); - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=0 loops=1) Output: metric.id, metric.ts, metric.value, metric_name.name -> Append (actual rows=0 loops=1) @@ -2084,20 +2084,20 @@ SELECT * FROM metric JOIN metric_name USING (id); Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=0 loops=1) Output: metric_2.id, metric_2.ts, metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (15 rows) -- Filter on the NULL column :PREFIX SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE name IS NOT NULL; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=0 loops=1) Output: metric.id, metric.ts, metric.value, metric_name.name -> Append (actual rows=0 loops=1) @@ -2106,19 +2106,19 @@ SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE name IS NOT NULL; Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name IS NOT NULL)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name IS NOT NULL)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=0 loops=1) Output: metric_2.id, metric_2.ts, metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name IS NOT NULL)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name IS NOT NULL)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (15 rows) :PREFIX SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE name = 'cpu1'; - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=0 loops=1) Output: metric.id, metric.ts, metric.value, metric_name.name -> Append (actual rows=0 loops=1) @@ -2127,13 +2127,13 @@ SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE name = 'cpu1'; Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name = 'cpu1'::text)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name = 'cpu1'::text)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=0 loops=1) Output: metric_2.id, metric_2.ts, metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name = 'cpu1'::text)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name = 'cpu1'::text)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (15 rows) ------- diff --git a/tsl/test/expected/dist_ref_table_join-15.out b/tsl/test/expected/dist_ref_table_join-15.out index 01abeaf14a2..f0fc68ad5b9 100644 --- a/tsl/test/expected/dist_ref_table_join-15.out +++ b/tsl/test/expected/dist_ref_table_join-15.out @@ -338,8 +338,8 @@ SELECT * FROM metric LEFT JOIN metric_name USING (id); LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric LEFT JOIN metric_name USING (id); DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric.id, metric.ts, metric.value, metric_name.name -> Append (actual rows=4 loops=1) @@ -348,13 +348,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.id, metric_2.ts, metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (15 rows) :PREFIX @@ -362,8 +362,8 @@ SELECT * FROM metric LEFT JOIN metric_name ON metric.id = metric_name.id; LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric LEFT JOIN metric_name ON metric.id = metric_name.id; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric.ts, metric.id, metric.value, metric_name.id, metric_name.name -> Append (actual rows=4 loops=1) @@ -372,13 +372,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.ts, r8.id, r8.value, r2.id, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r8.ts, r8.id, r8.value, r2.id, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.ts, metric_2.id, metric_2.value, metric_name.id, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.ts, r9.id, r9.value, r2.id, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r9.ts, r9.id, r9.value, r2.id, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (15 rows) -- Tests without filter (DHT reftable) @@ -387,8 +387,8 @@ SELECT * FROM metric LEFT JOIN metric_name_dht USING (id); LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric LEFT JOIN metric_name_dht USING (id); DEBUG: try to push down a join on a reference table - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Result (actual rows=4 loops=1) Output: metric.id, metric.ts, metric.value, metric_name_dht.name -> Custom Scan (AsyncAppend) (actual rows=4 loops=1) @@ -399,13 +399,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: Cursor Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name_dht r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name_dht r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.id, metric_2.ts, metric_2.value, metric_name_dht.name Data node: db_dist_ref_table_join_2 Fetcher Type: Cursor Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name_dht r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name_dht r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (17 rows) -- Tests with filter pushdown @@ -414,8 +414,8 @@ SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE value > 10; LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE value > 10; DEBUG: try to push down a join on a reference table - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric.id, metric.ts, metric.value, metric_name.name -> Append (actual rows=4 loops=1) @@ -424,13 +424,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) AND ((r8.value > 10::double precision)) + Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) AND ((r8.value > 10::double precision)) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.id, metric_2.ts, metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) AND ((r9.value > 10::double precision)) + Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) AND ((r9.value > 10::double precision)) (15 rows) PREPARE prepared_join_pushdown_value (int) AS @@ -442,8 +442,8 @@ EXECUTE prepared_join_pushdown_value(10); LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) EXECUTE prepared_join_pushdown_value(10); DEBUG: try to push down a join on a reference table - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric.id, metric.ts, metric.value, metric_name.name -> Append (actual rows=4 loops=1) @@ -452,13 +452,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) AND ((r8.value > 10::double precision)) + Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) AND ((r8.value > 10::double precision)) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.id, metric_2.ts, metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) AND ((r9.value > 10::double precision)) + Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) AND ((r9.value > 10::double precision)) (15 rows) :PREFIX @@ -466,14 +466,14 @@ SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE ts > '2022-02-02 02: LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE ts > '2022-02-02 02:02:02+03'; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) (actual rows=0 loops=1) Output: metric.id, metric.ts, metric.value, metric_name.name Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT r5.id, r5.ts, r5.value, r2.name FROM (public.metric r5 LEFT JOIN public.metric_name r2 ON (((r5.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r5, ARRAY[1]) AND ((r5.ts > '2022-02-01 15:02:02-08'::timestamp with time zone)) + Remote SQL: SELECT r5.id, r5.ts, r5.value, r2.name FROM (public.metric r5 LEFT JOIN public.metric_name r2 ON (((r5.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r5, ARRAY[1]) AND ((r5.ts > '2022-02-01 15:02:02-08'::timestamp with time zone)) (6 rows) :PREFIX @@ -481,14 +481,14 @@ SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE ts BETWEEN '2022-02- LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE ts BETWEEN '2022-02-02 02:02:02+03' AND '2022-02-02 02:12:02+03'; DEBUG: try to push down a join on a reference table - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric.id, metric.ts, metric.value, metric_name.name Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT r5.id, r5.ts, r5.value, r2.name FROM (public.metric r5 LEFT JOIN public.metric_name r2 ON (((r5.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r5, ARRAY[1]) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)) + Remote SQL: SELECT r5.id, r5.ts, r5.value, r2.name FROM (public.metric r5 LEFT JOIN public.metric_name r2 ON (((r5.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r5, ARRAY[1]) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)) (6 rows) :PREFIX @@ -496,14 +496,14 @@ SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE name LIKE 'cpu%' AND LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE name LIKE 'cpu%' AND ts BETWEEN '2022-02-02 02:02:02+03' AND '2022-02-02 02:12:02+03'; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric.id, metric.ts, metric.value, metric_name.name Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT r5.id, r5.ts, r5.value, r2.name FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_internal.chunks_in(r5, ARRAY[1]) + Remote SQL: SELECT r5.id, r5.ts, r5.value, r2.name FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_functions.chunks_in(r5, ARRAY[1]) (6 rows) :PREFIX @@ -511,8 +511,8 @@ SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE name LIKE 'cpu%'; LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE name LIKE 'cpu%'; DEBUG: try to push down a join on a reference table - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric.id, metric.ts, metric.value, metric_name.name -> Append (actual rows=4 loops=1) @@ -521,13 +521,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.id, metric_2.ts, metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (15 rows) :PREFIX @@ -535,8 +535,8 @@ SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE name = 'cpu2'; LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE name = 'cpu2'; DEBUG: try to push down a join on a reference table - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=1 loops=1) Output: metric.id, metric.ts, metric.value, metric_name.name -> Append (actual rows=1 loops=1) @@ -545,13 +545,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name = 'cpu2'::text)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name = 'cpu2'::text)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.id, metric_2.ts, metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name = 'cpu2'::text)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name = 'cpu2'::text)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (15 rows) :PREFIX @@ -559,8 +559,8 @@ SELECT * FROM metric LEFT JOIN metric_name_dht USING (id) WHERE name LIKE 'cpu%' LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric LEFT JOIN metric_name_dht USING (id) WHERE name LIKE 'cpu%'; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Result (actual rows=4 loops=1) Output: metric.id, metric.ts, metric.value, metric_name_dht.name -> Custom Scan (AsyncAppend) (actual rows=4 loops=1) @@ -571,13 +571,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: Cursor Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name_dht r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name_dht r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.id, metric_2.ts, metric_2.value, metric_name_dht.name Data node: db_dist_ref_table_join_2 Fetcher Type: Cursor Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name_dht r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name_dht r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (17 rows) -- Tests with an expression that evaluates to false @@ -586,8 +586,8 @@ SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE name LIKE 'cpu1' AND LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE name LIKE 'cpu1' AND name LIKE 'cpu2'; DEBUG: try to push down a join on a reference table - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=0 loops=1) Output: metric.id, metric.ts, metric.value, metric_name.name -> Append (actual rows=0 loops=1) @@ -596,13 +596,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu1'::text)) AND ((r2.name ~~ 'cpu2'::text)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu1'::text)) AND ((r2.name ~~ 'cpu2'::text)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=0 loops=1) Output: metric_2.id, metric_2.ts, metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu1'::text)) AND ((r2.name ~~ 'cpu2'::text)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu1'::text)) AND ((r2.name ~~ 'cpu2'::text)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (15 rows) -- Tests with aliases @@ -611,8 +611,8 @@ SELECT * FROM metric m1 LEFT JOIN metric_name m2 USING (id); LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric m1 LEFT JOIN metric_name m2 USING (id); DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: m1.id, m1.ts, m1.value, m2.name -> Append (actual rows=4 loops=1) @@ -621,13 +621,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: m1_2.id, m1_2.ts, m1_2.value, m2.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (15 rows) :PREFIX @@ -635,8 +635,8 @@ SELECT * FROM metric m1 LEFT JOIN metric_name m2 ON m1.id = m2.id; LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric m1 LEFT JOIN metric_name m2 ON m1.id = m2.id; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: m1.ts, m1.id, m1.value, m2.id, m2.name -> Append (actual rows=4 loops=1) @@ -645,13 +645,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.ts, r8.id, r8.value, r2.id, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r8.ts, r8.id, r8.value, r2.id, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: m1_2.ts, m1_2.id, m1_2.value, m2.id, m2.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.ts, r9.id, r9.value, r2.id, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r9.ts, r9.id, r9.value, r2.id, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (15 rows) :PREFIX @@ -659,8 +659,8 @@ SELECT * FROM metric m1 LEFT JOIN metric_name m2 ON m1.id = m2.id WHERE m1.value LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric m1 LEFT JOIN metric_name m2 ON m1.id = m2.id WHERE m1.value > 10; DEBUG: try to push down a join on a reference table - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: m1.ts, m1.id, m1.value, m2.id, m2.name -> Append (actual rows=4 loops=1) @@ -669,13 +669,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.ts, r8.id, r8.value, r2.id, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) AND ((r8.value > 10::double precision)) + Remote SQL: SELECT r8.ts, r8.id, r8.value, r2.id, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) AND ((r8.value > 10::double precision)) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: m1_2.ts, m1_2.id, m1_2.value, m2.id, m2.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.ts, r9.id, r9.value, r2.id, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) AND ((r9.value > 10::double precision)) + Remote SQL: SELECT r9.ts, r9.id, r9.value, r2.id, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) AND ((r9.value > 10::double precision)) (15 rows) :PREFIX @@ -683,8 +683,8 @@ SELECT * FROM metric m1 LEFT JOIN metric_name m2 ON m1.id = m2.id WHERE m1.value LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric m1 LEFT JOIN metric_name m2 ON m1.id = m2.id WHERE m1.value > 10 AND m2.name LIKE 'cpu%'; DEBUG: try to push down a join on a reference table - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: m1.ts, m1.id, m1.value, m2.id, m2.name -> Append (actual rows=4 loops=1) @@ -693,13 +693,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.ts, r8.id, r8.value, r2.id, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r8.value > 10::double precision)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r8.ts, r8.id, r8.value, r2.id, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r8.value > 10::double precision)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: m1_2.ts, m1_2.id, m1_2.value, m2.id, m2.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.ts, r9.id, r9.value, r2.id, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r9.value > 10::double precision)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r9.ts, r9.id, r9.value, r2.id, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r9.value > 10::double precision)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (15 rows) -- Tests with projections @@ -708,8 +708,8 @@ SELECT name, value FROM metric LEFT JOIN metric_name USING (id) WHERE name LIKE LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value FROM metric LEFT JOIN metric_name USING (id) WHERE name LIKE 'cpu%' AND ts BETWEEN '2022-02-02 02:02:02+03' AND '2022-02-02 02:12:02+03'; DEBUG: try to push down a join on a reference table - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Result (actual rows=1 loops=1) Output: metric_name.name, metric.value -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) @@ -717,7 +717,7 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT r5.value, r2.name FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_internal.chunks_in(r5, ARRAY[1]) + Remote SQL: SELECT r5.value, r2.name FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_functions.chunks_in(r5, ARRAY[1]) (8 rows) :PREFIX @@ -725,14 +725,14 @@ SELECT m1.ts, m1.value FROM metric m1 LEFT JOIN metric_name m2 USING (id) WHERE LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT m1.ts, m1.value FROM metric m1 LEFT JOIN metric_name m2 USING (id) WHERE name LIKE 'cpu%' AND ts BETWEEN '2022-02-02 02:02:02+03' AND '2022-02-02 02:12:02+03'; DEBUG: try to push down a join on a reference table - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: m1.ts, m1.value Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT r5.ts, r5.value FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_internal.chunks_in(r5, ARRAY[1]) + Remote SQL: SELECT r5.ts, r5.value FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_functions.chunks_in(r5, ARRAY[1]) (6 rows) :PREFIX @@ -740,8 +740,8 @@ SELECT m1.id, m1.id FROM metric m1 LEFT JOIN metric_name m2 USING (id) WHERE nam LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT m1.id, m1.id FROM metric m1 LEFT JOIN metric_name m2 USING (id) WHERE name LIKE 'cpu%' AND ts BETWEEN '2022-02-02 02:02:02+03' AND '2022-02-02 02:12:02+03'; DEBUG: try to push down a join on a reference table - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Result (actual rows=1 loops=1) Output: m1.id, m1.id -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) @@ -749,7 +749,7 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT r5.id FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_internal.chunks_in(r5, ARRAY[1]) + Remote SQL: SELECT r5.id FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_functions.chunks_in(r5, ARRAY[1]) (8 rows) :PREFIX @@ -757,14 +757,14 @@ SELECT m1.id, m2.id FROM metric m1 LEFT JOIN metric_name m2 USING (id) WHERE nam LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT m1.id, m2.id FROM metric m1 LEFT JOIN metric_name m2 USING (id) WHERE name LIKE 'cpu%' AND ts BETWEEN '2022-02-02 02:02:02+03' AND '2022-02-02 02:12:02+03'; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: m1.id, m2.id Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT r5.id, r2.id FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_internal.chunks_in(r5, ARRAY[1]) + Remote SQL: SELECT r5.id, r2.id FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_functions.chunks_in(r5, ARRAY[1]) (6 rows) :PREFIX @@ -772,14 +772,14 @@ SELECT m1.*, m2.* FROM metric m1 LEFT JOIN metric_name m2 USING (id) WHERE name LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT m1.*, m2.* FROM metric m1 LEFT JOIN metric_name m2 USING (id) WHERE name LIKE 'cpu%' AND ts BETWEEN '2022-02-02 02:02:02+03' AND '2022-02-02 02:12:02+03'; DEBUG: try to push down a join on a reference table - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: m1.ts, m1.id, m1.value, m2.id, m2.name Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT r5.ts, r5.id, r5.value, r2.id, r2.name FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_internal.chunks_in(r5, ARRAY[1]) + Remote SQL: SELECT r5.ts, r5.id, r5.value, r2.id, r2.name FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_functions.chunks_in(r5, ARRAY[1]) (6 rows) :PREFIX @@ -787,14 +787,14 @@ SELECT * FROM metric m1 LEFT JOIN metric_name m2 USING (id) WHERE name LIKE 'cpu LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric m1 LEFT JOIN metric_name m2 USING (id) WHERE name LIKE 'cpu%' AND ts BETWEEN '2022-02-02 02:02:02+03' AND '2022-02-02 02:12:02+03'; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: m1.id, m1.ts, m1.value, m2.name Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT r5.id, r5.ts, r5.value, r2.name FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_internal.chunks_in(r5, ARRAY[1]) + Remote SQL: SELECT r5.id, r5.ts, r5.value, r2.name FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_functions.chunks_in(r5, ARRAY[1]) (6 rows) -- Ordering @@ -803,8 +803,8 @@ SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name; LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Result (actual rows=4 loops=1) Output: metric_name.name, metric.value -> Custom Scan (AsyncAppend) (actual rows=4 loops=1) @@ -816,13 +816,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS LAST + Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS LAST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST + Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST (18 rows) :PREFIX @@ -830,8 +830,8 @@ SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name AS LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name ASC; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Result (actual rows=4 loops=1) Output: metric_name.name, metric.value -> Custom Scan (AsyncAppend) (actual rows=4 loops=1) @@ -843,13 +843,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS LAST + Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS LAST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST + Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST (18 rows) :PREFIX @@ -857,8 +857,8 @@ SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name DE LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name DESC; DEBUG: try to push down a join on a reference table - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Result (actual rows=4 loops=1) Output: metric_name.name, metric.value -> Custom Scan (AsyncAppend) (actual rows=4 loops=1) @@ -870,13 +870,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name DESC NULLS FIRST + Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name DESC NULLS FIRST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r2.name DESC NULLS FIRST + Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r2.name DESC NULLS FIRST (18 rows) :PREFIX @@ -884,8 +884,8 @@ SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name AS LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name ASC NULLS first; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Result (actual rows=4 loops=1) Output: metric_name.name, metric.value -> Custom Scan (AsyncAppend) (actual rows=4 loops=1) @@ -897,13 +897,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS FIRST + Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS FIRST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS FIRST + Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS FIRST (18 rows) :PREFIX @@ -911,8 +911,8 @@ SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name AS LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name ASC NULLS last; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Result (actual rows=4 loops=1) Output: metric_name.name, metric.value -> Custom Scan (AsyncAppend) (actual rows=4 loops=1) @@ -924,13 +924,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS LAST + Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS LAST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST + Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST (18 rows) :PREFIX @@ -938,8 +938,8 @@ SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name DE LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name DESC NULLS first; DEBUG: try to push down a join on a reference table - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Result (actual rows=4 loops=1) Output: metric_name.name, metric.value -> Custom Scan (AsyncAppend) (actual rows=4 loops=1) @@ -951,13 +951,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name DESC NULLS FIRST + Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name DESC NULLS FIRST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r2.name DESC NULLS FIRST + Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r2.name DESC NULLS FIRST (18 rows) :PREFIX @@ -965,8 +965,8 @@ SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name DE LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name DESC NULLS last; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Result (actual rows=4 loops=1) Output: metric_name.name, metric.value -> Custom Scan (AsyncAppend) (actual rows=4 loops=1) @@ -978,13 +978,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name DESC NULLS LAST + Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name DESC NULLS LAST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r2.name DESC NULLS LAST + Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r2.name DESC NULLS LAST (18 rows) :PREFIX @@ -992,8 +992,8 @@ SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name, v LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY name, value DESC; DEBUG: try to push down a join on a reference table - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Result (actual rows=4 loops=1) Output: metric_name.name, metric.value -> Custom Scan (AsyncAppend) (actual rows=4 loops=1) @@ -1005,13 +1005,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS LAST, r8.value DESC NULLS FIRST + Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS LAST, r8.value DESC NULLS FIRST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST, r9.value DESC NULLS FIRST + Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST, r9.value DESC NULLS FIRST (18 rows) :PREFIX @@ -1019,8 +1019,8 @@ SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY value, LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY value, name DESC; DEBUG: try to push down a join on a reference table - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Result (actual rows=4 loops=1) Output: metric_name.name, metric.value -> Custom Scan (AsyncAppend) (actual rows=4 loops=1) @@ -1032,13 +1032,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r8.value ASC NULLS LAST, r2.name DESC NULLS FIRST + Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r8.value ASC NULLS LAST, r2.name DESC NULLS FIRST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r9.value ASC NULLS LAST, r2.name DESC NULLS FIRST + Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r9.value ASC NULLS LAST, r2.name DESC NULLS FIRST (18 rows) :PREFIX @@ -1046,8 +1046,8 @@ SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY value A LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY value ASC, name DESC; DEBUG: try to push down a join on a reference table - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Result (actual rows=4 loops=1) Output: metric_name.name, metric.value -> Custom Scan (AsyncAppend) (actual rows=4 loops=1) @@ -1059,13 +1059,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r8.value ASC NULLS LAST, r2.name DESC NULLS FIRST + Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r8.value ASC NULLS LAST, r2.name DESC NULLS FIRST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r9.value ASC NULLS LAST, r2.name DESC NULLS FIRST + Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r9.value ASC NULLS LAST, r2.name DESC NULLS FIRST (18 rows) :PREFIX @@ -1073,8 +1073,8 @@ SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY value A LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY value ASC NULLS last, name DESC NULLS first; DEBUG: try to push down a join on a reference table - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Result (actual rows=4 loops=1) Output: metric_name.name, metric.value -> Custom Scan (AsyncAppend) (actual rows=4 loops=1) @@ -1086,13 +1086,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r8.value ASC NULLS LAST, r2.name DESC NULLS FIRST + Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r8.value ASC NULLS LAST, r2.name DESC NULLS FIRST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r9.value ASC NULLS LAST, r2.name DESC NULLS FIRST + Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r9.value ASC NULLS LAST, r2.name DESC NULLS FIRST (18 rows) -- Ordering with explicit table qualification @@ -1101,8 +1101,8 @@ SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY value, LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY value, name, metric_name.id; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Result (actual rows=4 loops=1) Output: metric_name.name, metric.value, metric_name.id -> Custom Scan (AsyncAppend) (actual rows=4 loops=1) @@ -1114,13 +1114,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name, r2.id FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r8.value ASC NULLS LAST, r2.name ASC NULLS LAST, r2.id ASC NULLS LAST + Remote SQL: SELECT r8.value, r2.name, r2.id FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r8.value ASC NULLS LAST, r2.name ASC NULLS LAST, r2.id ASC NULLS LAST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name, metric_name.id Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name, r2.id FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r9.value ASC NULLS LAST, r2.name ASC NULLS LAST, r2.id ASC NULLS LAST + Remote SQL: SELECT r9.value, r2.name, r2.id FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r9.value ASC NULLS LAST, r2.name ASC NULLS LAST, r2.id ASC NULLS LAST (18 rows) :PREFIX @@ -1128,8 +1128,8 @@ SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY value, LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value FROM metric LEFT JOIN metric_name USING (id) ORDER BY value, name, metric_name.id, metric.id; DEBUG: try to push down a join on a reference table - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Result (actual rows=4 loops=1) Output: metric_name.name, metric.value, metric_name.id, metric.id -> Custom Scan (AsyncAppend) (actual rows=4 loops=1) @@ -1141,13 +1141,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r8.id, r2.name, r2.id FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r8.value ASC NULLS LAST, r2.name ASC NULLS LAST, r2.id ASC NULLS LAST, r8.id ASC NULLS LAST + Remote SQL: SELECT r8.value, r8.id, r2.name, r2.id FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r8.value ASC NULLS LAST, r2.name ASC NULLS LAST, r2.id ASC NULLS LAST, r8.id ASC NULLS LAST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_2.id, metric_name.name, metric_name.id Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r9.id, r2.name, r2.id FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r9.value ASC NULLS LAST, r2.name ASC NULLS LAST, r2.id ASC NULLS LAST, r9.id ASC NULLS LAST + Remote SQL: SELECT r9.value, r9.id, r2.name, r2.id FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r9.value ASC NULLS LAST, r2.name ASC NULLS LAST, r2.id ASC NULLS LAST, r9.id ASC NULLS LAST (18 rows) -- Ordering with explicit table qualification and aliases @@ -1156,8 +1156,8 @@ SELECT name, value FROM metric m1 LEFT JOIN metric_name m2 USING (id) ORDER BY v LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value FROM metric m1 LEFT JOIN metric_name m2 USING (id) ORDER BY value, name, m1.id, m2.id; DEBUG: try to push down a join on a reference table - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Result (actual rows=4 loops=1) Output: m2.name, m1.value, m1.id, m2.id -> Custom Scan (AsyncAppend) (actual rows=4 loops=1) @@ -1169,13 +1169,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r8.id, r2.name, r2.id FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r8.value ASC NULLS LAST, r2.name ASC NULLS LAST, r8.id ASC NULLS LAST, r2.id ASC NULLS LAST + Remote SQL: SELECT r8.value, r8.id, r2.name, r2.id FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r8.value ASC NULLS LAST, r2.name ASC NULLS LAST, r8.id ASC NULLS LAST, r2.id ASC NULLS LAST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: m1_2.value, m1_2.id, m2.name, m2.id Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r9.id, r2.name, r2.id FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r9.value ASC NULLS LAST, r2.name ASC NULLS LAST, r9.id ASC NULLS LAST, r2.id ASC NULLS LAST + Remote SQL: SELECT r9.value, r9.id, r2.name, r2.id FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r9.value ASC NULLS LAST, r2.name ASC NULLS LAST, r9.id ASC NULLS LAST, r2.id ASC NULLS LAST (18 rows) -- Grouping @@ -1184,8 +1184,8 @@ SELECT name FROM metric LEFT JOIN metric_name USING (id) WHERE name LIKE 'cpu%' LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name FROM metric LEFT JOIN metric_name USING (id) WHERE name LIKE 'cpu%' GROUP BY name; DEBUG: try to push down a join on a reference table - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Group (actual rows=2 loops=1) Output: metric_name.name Group Key: metric_name.name @@ -1198,13 +1198,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS LAST + Remote SQL: SELECT r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS LAST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST + Remote SQL: SELECT r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST (19 rows) :PREFIX @@ -1212,8 +1212,8 @@ SELECT name, max(value), min(value) FROM metric LEFT JOIN metric_name USING (id) LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, max(value), min(value) FROM metric LEFT JOIN metric_name USING (id) WHERE name LIKE 'cpu%' GROUP BY name; DEBUG: try to push down a join on a reference table - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate (actual rows=2 loops=1) Output: metric_name.name, max(metric.value), min(metric.value) Group Key: metric_name.name @@ -1228,13 +1228,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS LAST + Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS LAST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST + Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST (21 rows) :PREFIX @@ -1242,8 +1242,8 @@ SELECT name, max(value) FROM metric LEFT JOIN metric_name USING (id) WHERE name LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, max(value) FROM metric LEFT JOIN metric_name USING (id) WHERE name LIKE 'cpu%' AND ts BETWEEN '2022-02-02 02:02:02+03' AND '2022-02-02 02:12:02+03' GROUP BY name; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate (actual rows=1 loops=1) Output: metric_name.name, max(metric.value) Group Key: metric_name.name @@ -1254,7 +1254,7 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk - Remote SQL: SELECT r5.value, r2.name FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_internal.chunks_in(r5, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST + Remote SQL: SELECT r5.value, r2.name FROM (public.metric r5 INNER JOIN public.metric_name r2 ON (((r5.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r5.ts >= '2022-02-01 15:02:02-08'::timestamp with time zone)) AND ((r5.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_functions.chunks_in(r5, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST (11 rows) -- Grouping and sorting @@ -1263,8 +1263,8 @@ SELECT name, max(value), min(value) FROM metric LEFT JOIN metric_name USING (id) LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, max(value), min(value) FROM metric LEFT JOIN metric_name USING (id) WHERE name LIKE 'cpu%' and ts BETWEEN '2000-02-02 02:02:02+03' and '2022-02-02 02:12:02+03' GROUP BY name ORDER BY name DESC; DEBUG: try to push down a join on a reference table - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate (actual rows=2 loops=1) Output: metric_name.name, max(metric.value), min(metric.value) Group Key: metric_name.name @@ -1279,13 +1279,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r8.ts >= '2000-02-01 15:02:02-08'::timestamp with time zone)) AND ((r8.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name DESC NULLS FIRST + Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r8.ts >= '2000-02-01 15:02:02-08'::timestamp with time zone)) AND ((r8.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name DESC NULLS FIRST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r9.ts >= '2000-02-01 15:02:02-08'::timestamp with time zone)) AND ((r9.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r2.name DESC NULLS FIRST + Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r9.ts >= '2000-02-01 15:02:02-08'::timestamp with time zone)) AND ((r9.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r2.name DESC NULLS FIRST (21 rows) -- Having @@ -1294,8 +1294,8 @@ SELECT name, max(value), min(value) FROM metric LEFT JOIN metric_name USING (id) LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, max(value), min(value) FROM metric LEFT JOIN metric_name USING (id) WHERE name LIKE 'cpu%' and ts BETWEEN '2000-02-02 02:02:02+03' and '2022-02-02 02:12:02+03' GROUP BY name having min(value) > 0 ORDER BY name DESC; DEBUG: try to push down a join on a reference table - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate (actual rows=2 loops=1) Output: metric_name.name, max(metric.value), min(metric.value) Group Key: metric_name.name @@ -1311,13 +1311,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r8.ts >= '2000-02-01 15:02:02-08'::timestamp with time zone)) AND ((r8.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name DESC NULLS FIRST + Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r8.ts >= '2000-02-01 15:02:02-08'::timestamp with time zone)) AND ((r8.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name DESC NULLS FIRST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r9.ts >= '2000-02-01 15:02:02-08'::timestamp with time zone)) AND ((r9.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r2.name DESC NULLS FIRST + Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)) AND ((r9.ts >= '2000-02-01 15:02:02-08'::timestamp with time zone)) AND ((r9.ts <= '2022-02-01 15:12:02-08'::timestamp with time zone)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r2.name DESC NULLS FIRST (22 rows) -- Rank @@ -1325,8 +1325,8 @@ DEBUG: try to push down a join on a reference table SELECT name, value, RANK () OVER (ORDER by value) from metric join metric_name_local USING (id); LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT name, value, RANK () OVER (ORDER by value) from metric join metric_name_local USING (id); - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- WindowAgg (actual rows=4 loops=1) Output: metric_name_local.name, metric.value, rank() OVER (?) -> Nested Loop (actual rows=4 loops=1) @@ -1341,13 +1341,13 @@ SELECT name, value, RANK () OVER (ORDER by value) from metric join metric_name_l Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1, 2, 3]) ORDER BY value ASC NULLS LAST + Remote SQL: SELECT id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1, 2, 3]) ORDER BY value ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.metric metric_2 (actual rows=1 loops=1) Output: metric_2.value, metric_2.id Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1]) ORDER BY value ASC NULLS LAST + Remote SQL: SELECT id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1]) ORDER BY value ASC NULLS LAST -> Index Scan using metric_name_local_pkey on public.metric_name_local (actual rows=1 loops=4) Output: metric_name_local.id, metric_name_local.name Index Cond: (metric_name_local.id = metric.id) @@ -1369,8 +1369,8 @@ DEBUG: try to push down a join on a reference table SELECT * FROM metric_name LEFT JOIN metric USING (id) WHERE name LIKE 'cpu%'; LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric_name LEFT JOIN metric USING (id) WHERE name LIKE 'cpu%'; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------- Nested Loop Left Join (actual rows=4 loops=1) Output: metric_name.id, metric_name.name, metric.ts, metric.value Join Filter: (metric_name.id = metric.id) @@ -1388,13 +1388,13 @@ SELECT * FROM metric_name LEFT JOIN metric USING (id) WHERE name LIKE 'cpu%'; Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1, 2, 3]) + Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) on public.metric metric_2 (actual rows=1 loops=1) Output: metric_2.ts, metric_2.value, metric_2.id Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1]) + Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1]) (24 rows) -- Right join reference table on the left, hypertable on the right (can be converted into a left join by PostgreSQL, pushdown) @@ -1403,8 +1403,8 @@ SELECT * FROM metric_name RIGHT JOIN metric USING (id) WHERE name LIKE 'cpu%'; LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric_name RIGHT JOIN metric USING (id) WHERE name LIKE 'cpu%'; DEBUG: try to push down a join on a reference table - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Result (actual rows=4 loops=1) Output: metric.id, metric_name.name, metric.ts, metric.value -> Custom Scan (AsyncAppend) (actual rows=4 loops=1) @@ -1415,13 +1415,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r1.name, r8.id, r8.ts, r8.value FROM (public.metric r8 INNER JOIN public.metric_name r1 ON (((r1.id = r8.id)) AND ((r1.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r1.name, r8.id, r8.ts, r8.value FROM (public.metric r8 INNER JOIN public.metric_name r1 ON (((r1.id = r8.id)) AND ((r1.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_name.name, metric_2.id, metric_2.ts, metric_2.value Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r1.name, r9.id, r9.ts, r9.value FROM (public.metric r9 INNER JOIN public.metric_name r1 ON (((r1.id = r9.id)) AND ((r1.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r1.name, r9.id, r9.ts, r9.value FROM (public.metric r9 INNER JOIN public.metric_name r1 ON (((r1.id = r9.id)) AND ((r1.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (17 rows) -- Right join hypertable on the left, reference table on the right (no pushdown) @@ -1429,8 +1429,8 @@ DEBUG: try to push down a join on a reference table SELECT * FROM metric RIGHT JOIN metric_name USING (id) WHERE name LIKE 'cpu%'; LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric RIGHT JOIN metric_name USING (id) WHERE name LIKE 'cpu%'; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------- Nested Loop Left Join (actual rows=4 loops=1) Output: metric_name.id, metric.ts, metric.value, metric_name.name Join Filter: (metric.id = metric_name.id) @@ -1448,13 +1448,13 @@ SELECT * FROM metric RIGHT JOIN metric_name USING (id) WHERE name LIKE 'cpu%'; Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1, 2, 3]) + Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) on public.metric metric_2 (actual rows=1 loops=1) Output: metric_2.ts, metric_2.value, metric_2.id Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1]) + Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1]) (24 rows) -- Inner join and reference table left, hypertable on the right (pushdown) @@ -1463,8 +1463,8 @@ SELECT * FROM metric_name INNER JOIN metric USING (id) WHERE name LIKE 'cpu%'; LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric_name INNER JOIN metric USING (id) WHERE name LIKE 'cpu%'; DEBUG: try to push down a join on a reference table - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric_name.id, metric_name.name, metric.ts, metric.value -> Append (actual rows=4 loops=1) @@ -1473,13 +1473,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r1.id, r1.name, r8.ts, r8.value FROM (public.metric r8 INNER JOIN public.metric_name r1 ON (((r1.id = r8.id)) AND ((r1.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r1.id, r1.name, r8.ts, r8.value FROM (public.metric r8 INNER JOIN public.metric_name r1 ON (((r1.id = r8.id)) AND ((r1.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_name.id, metric_name.name, metric_2.ts, metric_2.value Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r1.id, r1.name, r9.ts, r9.value FROM (public.metric r9 INNER JOIN public.metric_name r1 ON (((r1.id = r9.id)) AND ((r1.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r1.id, r1.name, r9.ts, r9.value FROM (public.metric r9 INNER JOIN public.metric_name r1 ON (((r1.id = r9.id)) AND ((r1.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (15 rows) -- Implicit join on two tables, hypertable left, reference table right (pushdown) @@ -1488,8 +1488,8 @@ SELECT * FROM metric m1, metric_name m2 WHERE m1.id=m2.id AND name LIKE 'cpu%'; LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric m1, metric_name m2 WHERE m1.id=m2.id AND name LIKE 'cpu%'; DEBUG: try to push down a join on a reference table - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: m1.ts, m1.id, m1.value, m2.id, m2.name -> Append (actual rows=4 loops=1) @@ -1498,13 +1498,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r7.ts, r7.id, r7.value, r2.id, r2.name FROM (public.metric r7 INNER JOIN public.metric_name r2 ON (((r7.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r7, ARRAY[1, 2, 3]) + Remote SQL: SELECT r7.ts, r7.id, r7.value, r2.id, r2.name FROM (public.metric r7 INNER JOIN public.metric_name r2 ON (((r7.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r7, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: m1_2.ts, m1_2.id, m1_2.value, m2.id, m2.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r8.ts, r8.id, r8.value, r2.id, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1]) + Remote SQL: SELECT r8.ts, r8.id, r8.value, r2.id, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1]) (15 rows) -- Implicit join on two tables, reference table left, hypertable right (pushdown) @@ -1513,8 +1513,8 @@ SELECT * FROM metric m2, metric_name m1 WHERE m1.id=m2.id AND name LIKE 'cpu%'; LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric m2, metric_name m1 WHERE m1.id=m2.id AND name LIKE 'cpu%'; DEBUG: try to push down a join on a reference table - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: m2.ts, m2.id, m2.value, m1.id, m1.name -> Append (actual rows=4 loops=1) @@ -1523,13 +1523,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r7.ts, r7.id, r7.value, r2.id, r2.name FROM (public.metric r7 INNER JOIN public.metric_name r2 ON (((r7.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r7, ARRAY[1, 2, 3]) + Remote SQL: SELECT r7.ts, r7.id, r7.value, r2.id, r2.name FROM (public.metric r7 INNER JOIN public.metric_name r2 ON (((r7.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r7, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: m2_2.ts, m2_2.id, m2_2.value, m1.id, m1.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r8.ts, r8.id, r8.value, r2.id, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1]) + Remote SQL: SELECT r8.ts, r8.id, r8.value, r2.id, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1]) (15 rows) -- Implicit join on three tables (no pushdown) @@ -1537,8 +1537,8 @@ DEBUG: try to push down a join on a reference table SELECT * FROM metric m1, metric_name m2, metric_name m3 WHERE m1.id=m2.id AND m2.id = m3.id AND m3.name LIKE 'cpu%'; LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric m1, metric_name m2, metric_name m3 WHERE m1.id=m2.id AND m2.id = m3.id AND m3.name LIKE 'cpu%'; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------- Nested Loop (actual rows=4 loops=1) Output: m1.ts, m1.id, m1.value, m2.id, m2.name, m3.id, m3.name Inner Unique: true @@ -1557,13 +1557,13 @@ SELECT * FROM metric m1, metric_name m2, metric_name m3 WHERE m1.id=m2.id AND m2 Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1, 2, 3]) + Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) on public.metric m1_2 (actual rows=1 loops=1) Output: m1_2.ts, m1_2.id, m1_2.value Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1]) + Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1]) -> Materialize (actual rows=1 loops=4) Output: m2.id, m2.name -> Seq Scan on public.metric_name m2 (actual rows=2 loops=1) @@ -1581,8 +1581,8 @@ SELECT * FROM metric LEFT JOIN (SELECT * FROM metric_name) AS sub ON metric.id=s LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric LEFT JOIN (SELECT * FROM metric_name) AS sub ON metric.id=sub.id; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric.ts, metric.id, metric.value, metric_name.id, metric_name.name -> Append (actual rows=4 loops=1) @@ -1591,13 +1591,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r9.ts, r9.id, r9.value, r4.id, r4.name FROM (public.metric r9 LEFT JOIN public.metric_name r4 ON (((r9.id = r4.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1, 2, 3]) + Remote SQL: SELECT r9.ts, r9.id, r9.value, r4.id, r4.name FROM (public.metric r9 LEFT JOIN public.metric_name r4 ON (((r9.id = r4.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.ts, metric_2.id, metric_2.value, metric_name.id, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r10.ts, r10.id, r10.value, r4.id, r4.name FROM (public.metric r10 LEFT JOIN public.metric_name r4 ON (((r10.id = r4.id)))) WHERE _timescaledb_internal.chunks_in(r10, ARRAY[1]) + Remote SQL: SELECT r10.ts, r10.id, r10.value, r4.id, r4.name FROM (public.metric r10 LEFT JOIN public.metric_name r4 ON (((r10.id = r4.id)))) WHERE _timescaledb_functions.chunks_in(r10, ARRAY[1]) (15 rows) -- Left join on a DHT and a subselect with filter on a reference table (subselect can be removed, pushdown) @@ -1606,8 +1606,8 @@ SELECT * FROM metric LEFT JOIN (SELECT * FROM metric_name WHERE name LIKE 'cpu%' LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric LEFT JOIN (SELECT * FROM metric_name WHERE name LIKE 'cpu%') AS sub ON metric.id=sub.id; DEBUG: try to push down a join on a reference table - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric.ts, metric.id, metric.value, metric_name.id, metric_name.name -> Append (actual rows=4 loops=1) @@ -1616,13 +1616,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r9.ts, r9.id, r9.value, r4.id, r4.name FROM (public.metric r9 LEFT JOIN public.metric_name r4 ON (((r9.id = r4.id)) AND ((r4.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1, 2, 3]) + Remote SQL: SELECT r9.ts, r9.id, r9.value, r4.id, r4.name FROM (public.metric r9 LEFT JOIN public.metric_name r4 ON (((r9.id = r4.id)) AND ((r4.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.ts, metric_2.id, metric_2.value, metric_name.id, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r10.ts, r10.id, r10.value, r4.id, r4.name FROM (public.metric r10 LEFT JOIN public.metric_name r4 ON (((r10.id = r4.id)) AND ((r4.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r10, ARRAY[1]) + Remote SQL: SELECT r10.ts, r10.id, r10.value, r4.id, r4.name FROM (public.metric r10 LEFT JOIN public.metric_name r4 ON (((r10.id = r4.id)) AND ((r4.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r10, ARRAY[1]) (15 rows) -- Left join on a subselect on a DHT and a reference table (subselect can be removed, pushdown) @@ -1631,8 +1631,8 @@ SELECT * FROM (SELECT * FROM metric) as sub LEFT JOIN metric_name ON sub.id=metr LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM (SELECT * FROM metric) as sub LEFT JOIN metric_name ON sub.id=metric_name.id WHERE name LIKE 'cpu%'; DEBUG: try to push down a join on a reference table - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric.ts, metric.id, metric.value, metric_name.id, metric_name.name -> Append (actual rows=4 loops=1) @@ -1641,13 +1641,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r9.ts, r9.id, r9.value, r2.id, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1, 2, 3]) + Remote SQL: SELECT r9.ts, r9.id, r9.value, r2.id, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.ts, metric_2.id, metric_2.value, metric_name.id, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r10.ts, r10.id, r10.value, r2.id, r2.name FROM (public.metric r10 INNER JOIN public.metric_name r2 ON (((r10.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r10, ARRAY[1]) + Remote SQL: SELECT r10.ts, r10.id, r10.value, r2.id, r2.name FROM (public.metric r10 INNER JOIN public.metric_name r2 ON (((r10.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r10, ARRAY[1]) (15 rows) -- Left join and hypertable on left and right (no pushdown) @@ -1655,8 +1655,8 @@ DEBUG: try to push down a join on a reference table SELECT * FROM metric m1 LEFT JOIN metric m2 USING (id) WHERE m1.id = 2; LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric m1 LEFT JOIN metric m2 USING (id) WHERE m1.id = 2; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------- Nested Loop Left Join (actual rows=1 loops=1) Output: m1.id, m1.ts, m1.value, m2.ts, m2.value Join Filter: (m1.id = m2.id) @@ -1665,7 +1665,7 @@ SELECT * FROM metric m1 LEFT JOIN metric m2 USING (id) WHERE m1.id = 2; Data node: db_dist_ref_table_join_2 Fetcher Type: Cursor Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1]) AND ((id = 2)) + Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1]) AND ((id = 2)) -> Custom Scan (AsyncAppend) (actual rows=1 loops=1) Output: m2.ts, m2.value, m2.id -> Append (actual rows=1 loops=1) @@ -1674,13 +1674,13 @@ SELECT * FROM metric m1 LEFT JOIN metric m2 USING (id) WHERE m1.id = 2; Data node: db_dist_ref_table_join_1 Fetcher Type: Cursor Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1, 2, 3]) AND ((id = 2)) + Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1, 2, 3]) AND ((id = 2)) -> Custom Scan (DataNodeScan) on public.metric m2_2 (actual rows=1 loops=1) Output: m2_2.ts, m2_2.value, m2_2.id Data node: db_dist_ref_table_join_2 Fetcher Type: Cursor Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1]) AND ((id = 2)) + Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1]) AND ((id = 2)) (24 rows) -- Left join and reference table on left and right @@ -1710,8 +1710,8 @@ SELECT count(*) FROM metric m1 LEFT JOIN metric_name m2 USING (id) WHERE m2.name LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT count(*) FROM metric m1 LEFT JOIN metric_name m2 USING (id) WHERE m2.name LIKE 'cpu%'; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (actual rows=1 loops=1) Output: count(*) -> Custom Scan (AsyncAppend) (actual rows=4 loops=1) @@ -1720,12 +1720,12 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT NULL FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT NULL FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT NULL FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT NULL FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name ~~ 'cpu%'::text)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (14 rows) -- Lateral joins that can be converted into regular joins @@ -1734,8 +1734,8 @@ SELECT * FROM metric m1 LEFT JOIN LATERAL (SELECT * FROM metric_name m2 WHERE m1 LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric m1 LEFT JOIN LATERAL (SELECT * FROM metric_name m2 WHERE m1.id = m2.id) t ON TRUE; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: m1.ts, m1.id, m1.value, m2.id, m2.name -> Append (actual rows=4 loops=1) @@ -1744,13 +1744,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r9.ts, r9.id, r9.value, r4.id, r4.name FROM (public.metric r9 LEFT JOIN public.metric_name r4 ON (((r9.id = r4.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1, 2, 3]) + Remote SQL: SELECT r9.ts, r9.id, r9.value, r4.id, r4.name FROM (public.metric r9 LEFT JOIN public.metric_name r4 ON (((r9.id = r4.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: m1_2.ts, m1_2.id, m1_2.value, m2.id, m2.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r10.ts, r10.id, r10.value, r4.id, r4.name FROM (public.metric r10 LEFT JOIN public.metric_name r4 ON (((r10.id = r4.id)))) WHERE _timescaledb_internal.chunks_in(r10, ARRAY[1]) + Remote SQL: SELECT r10.ts, r10.id, r10.value, r4.id, r4.name FROM (public.metric r10 LEFT JOIN public.metric_name r4 ON (((r10.id = r4.id)))) WHERE _timescaledb_functions.chunks_in(r10, ARRAY[1]) (15 rows) :PREFIX @@ -1758,8 +1758,8 @@ SELECT * FROM metric m1 LEFT JOIN LATERAL (SELECT * FROM metric_name m2 WHERE m1 LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric m1 LEFT JOIN LATERAL (SELECT * FROM metric_name m2 WHERE m1.id > m2.id) t ON TRUE; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: m1.ts, m1.id, m1.value, m2.id, m2.name -> Append (actual rows=4 loops=1) @@ -1768,13 +1768,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r9.ts, r9.id, r9.value, r4.id, r4.name FROM (public.metric r9 LEFT JOIN public.metric_name r4 ON (((r9.id > r4.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1, 2, 3]) + Remote SQL: SELECT r9.ts, r9.id, r9.value, r4.id, r4.name FROM (public.metric r9 LEFT JOIN public.metric_name r4 ON (((r9.id > r4.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: m1_2.ts, m1_2.id, m1_2.value, m2.id, m2.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r10.ts, r10.id, r10.value, r4.id, r4.name FROM (public.metric r10 LEFT JOIN public.metric_name r4 ON (((r10.id > r4.id)))) WHERE _timescaledb_internal.chunks_in(r10, ARRAY[1]) + Remote SQL: SELECT r10.ts, r10.id, r10.value, r4.id, r4.name FROM (public.metric r10 LEFT JOIN public.metric_name r4 ON (((r10.id > r4.id)))) WHERE _timescaledb_functions.chunks_in(r10, ARRAY[1]) (15 rows) -- Lateral join that can not be converted and pushed down @@ -1782,8 +1782,8 @@ DEBUG: try to push down a join on a reference table SELECT * FROM metric m1 LEFT JOIN LATERAL (SELECT * FROM metric_name m2 WHERE m1.id > m2.id ORDER BY m2.name LIMIT 1) t ON TRUE; LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric m1 LEFT JOIN LATERAL (SELECT * FROM metric_name m2 WHERE m1.id > m2.id ORDER BY m2.name LIMIT 1) t ON TRUE; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------- Nested Loop Left Join (actual rows=4 loops=1) Output: m1.ts, m1.id, m1.value, m2.id, m2.name -> Custom Scan (AsyncAppend) (actual rows=4 loops=1) @@ -1794,13 +1794,13 @@ SELECT * FROM metric m1 LEFT JOIN LATERAL (SELECT * FROM metric_name m2 WHERE m1 Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1, 2, 3]) + Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) on public.metric m1_2 (actual rows=1 loops=1) Output: m1_2.ts, m1_2.id, m1_2.value Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1]) + Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1]) -> Limit (actual rows=0 loops=4) Output: m2.id, m2.name -> Sort (actual rows=0 loops=4) @@ -1818,8 +1818,8 @@ SELECT * FROM metric m1 LEFT JOIN LATERAL (SELECT * FROM metric_name m2 WHERE m1 SELECT * FROM metric m1 LEFT JOIN metric m2 USING (id) LEFT JOIN metric_name mn USING(id); LOG: statement: EXPLAIN (analyze, verbose, costs off, timing off, summary off) SELECT * FROM metric m1 LEFT JOIN metric m2 USING (id) LEFT JOIN metric_name mn USING(id); - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------- Hash Left Join (actual rows=10 loops=1) Output: m1.id, m1.ts, m1.value, m2.ts, m2.value, mn.name Inner Unique: true @@ -1836,13 +1836,13 @@ SELECT * FROM metric m1 LEFT JOIN metric m2 USING (id) LEFT JOIN metric_name mn Data node: db_dist_ref_table_join_1 Fetcher Type: Cursor Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1, 2, 3]) + Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) on public.metric m1_2 (actual rows=1 loops=1) Output: m1_2.id, m1_2.ts, m1_2.value Data node: db_dist_ref_table_join_2 Fetcher Type: Cursor Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1]) + Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1]) -> Materialize (actual rows=4 loops=4) Output: m2.ts, m2.value, m2.id -> Custom Scan (AsyncAppend) (actual rows=4 loops=1) @@ -1853,13 +1853,13 @@ SELECT * FROM metric m1 LEFT JOIN metric m2 USING (id) LEFT JOIN metric_name mn Data node: db_dist_ref_table_join_1 Fetcher Type: Cursor Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1, 2, 3]) + Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) on public.metric m2_2 (actual rows=1 loops=1) Output: m2_2.ts, m2_2.value, m2_2.id Data node: db_dist_ref_table_join_2 Fetcher Type: Cursor Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1]) + Remote SQL: SELECT ts, id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1]) -> Hash (actual rows=2 loops=1) Output: mn.name, mn.id Buckets: 1024 Batches: 1 @@ -1884,8 +1884,8 @@ FROM metric JOIN metric_name ON texteq('cpu' || textin(int4out(metric.id)), name GROUP BY name ORDER BY name; DEBUG: try to push down a join on a reference table - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ GroupAggregate (actual rows=2 loops=1) Output: metric_name.name, max(metric.value), count(*) Group Key: metric_name.name @@ -1900,13 +1900,13 @@ DEBUG: try to push down a join on a reference table Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON ((texteq(('cpu'::text || textin(int4out(r8.id))), r2.name)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS LAST + Remote SQL: SELECT r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON ((texteq(('cpu'::text || textin(int4out(r8.id))), r2.name)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) ORDER BY r2.name ASC NULLS LAST -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON ((texteq(('cpu'::text || textin(int4out(r9.id))), r2.name)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST + Remote SQL: SELECT r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON ((texteq(('cpu'::text || textin(int4out(r9.id))), r2.name)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) ORDER BY r2.name ASC NULLS LAST (21 rows) -- Non-shippable equality class join @@ -1922,8 +1922,8 @@ GROUP BY name ORDER BY name; DEBUG: try to push down a join on a reference table DEBUG: join pushdown on reference table is not supported for the used query - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate (actual rows=2 loops=1) Output: metric_name.name, max(metric.value), count(*) Group Key: metric_name.name @@ -1944,13 +1944,13 @@ DEBUG: join pushdown on reference table is not supported for the used query Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1, 2, 3]) + Remote SQL: SELECT id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) on public.metric metric_2 (actual rows=1 loops=1) Output: metric_2.value, metric_2.id Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1]) + Remote SQL: SELECT id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1]) -> Sort (actual rows=4 loops=1) Output: metric_name.name Sort Key: metric_name.name @@ -1972,8 +1972,8 @@ GROUP BY name ORDER BY name; DEBUG: try to push down a join on a reference table DEBUG: join pushdown on reference table is not supported for the used query - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------- GroupAggregate (actual rows=2 loops=1) Output: metric_name.name, max(metric.value), count(*) Group Key: metric_name.name @@ -1993,13 +1993,13 @@ DEBUG: join pushdown on reference table is not supported for the used query Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1, 2, 3]) + Remote SQL: SELECT id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) on public.metric metric_2 (actual rows=1 loops=1) Output: metric_2.value, metric_2.id Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT id, value FROM public.metric WHERE _timescaledb_internal.chunks_in(public.metric.*, ARRAY[1]) + Remote SQL: SELECT id, value FROM public.metric WHERE _timescaledb_functions.chunks_in(public.metric.*, ARRAY[1]) -> Materialize (actual rows=2 loops=4) Output: metric_name.name -> Seq Scan on public.metric_name (actual rows=2 loops=1) @@ -2091,8 +2091,8 @@ SELECT * FROM metric LEFT JOIN metric_name USING (id); :PREFIX SELECT * FROM metric LEFT JOIN metric_name USING (id); - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Custom Scan (AsyncAppend) (actual rows=4 loops=1) Output: metric.id, metric.ts, metric.value, metric_name.name -> Append (actual rows=4 loops=1) @@ -2101,13 +2101,13 @@ SELECT * FROM metric LEFT JOIN metric_name USING (id); Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 LEFT JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=1 loops=1) Output: metric_2.id, metric_2.ts, metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 LEFT JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (15 rows) -- Inner join @@ -2118,8 +2118,8 @@ SELECT * FROM metric JOIN metric_name USING (id); :PREFIX SELECT * FROM metric JOIN metric_name USING (id); - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=0 loops=1) Output: metric.id, metric.ts, metric.value, metric_name.name -> Append (actual rows=0 loops=1) @@ -2128,20 +2128,20 @@ SELECT * FROM metric JOIN metric_name USING (id); Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=0 loops=1) Output: metric_2.id, metric_2.ts, metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (15 rows) -- Filter on the NULL column :PREFIX SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE name IS NOT NULL; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=0 loops=1) Output: metric.id, metric.ts, metric.value, metric_name.name -> Append (actual rows=0 loops=1) @@ -2150,19 +2150,19 @@ SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE name IS NOT NULL; Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name IS NOT NULL)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name IS NOT NULL)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=0 loops=1) Output: metric_2.id, metric_2.ts, metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name IS NOT NULL)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name IS NOT NULL)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (15 rows) :PREFIX SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE name = 'cpu1'; - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (AsyncAppend) (actual rows=0 loops=1) Output: metric.id, metric.ts, metric.value, metric_name.name -> Append (actual rows=0 loops=1) @@ -2171,13 +2171,13 @@ SELECT * FROM metric LEFT JOIN metric_name USING (id) WHERE name = 'cpu1'; Data node: db_dist_ref_table_join_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk - Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name = 'cpu1'::text)))) WHERE _timescaledb_internal.chunks_in(r8, ARRAY[1, 2, 3]) + Remote SQL: SELECT r8.id, r8.ts, r8.value, r2.name FROM (public.metric r8 INNER JOIN public.metric_name r2 ON (((r8.id = r2.id)) AND ((r2.name = 'cpu1'::text)))) WHERE _timescaledb_functions.chunks_in(r8, ARRAY[1, 2, 3]) -> Custom Scan (DataNodeScan) (actual rows=0 loops=1) Output: metric_2.id, metric_2.ts, metric_2.value, metric_name.name Data node: db_dist_ref_table_join_2 Fetcher Type: COPY Chunks: _dist_hyper_1_4_chunk - Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name = 'cpu1'::text)))) WHERE _timescaledb_internal.chunks_in(r9, ARRAY[1]) + Remote SQL: SELECT r9.id, r9.ts, r9.value, r2.name FROM (public.metric r9 INNER JOIN public.metric_name r2 ON (((r9.id = r2.id)) AND ((r2.name = 'cpu1'::text)))) WHERE _timescaledb_functions.chunks_in(r9, ARRAY[1]) (15 rows) ------- diff --git a/tsl/test/expected/dist_remote_error-14.out b/tsl/test/expected/dist_remote_error-14.out index c8ae7cb1ebd..23da8c1f7b8 100644 --- a/tsl/test/expected/dist_remote_error-14.out +++ b/tsl/test/expected/dist_remote_error-14.out @@ -74,14 +74,14 @@ select 1 from metrics_dist_remote_error where ts_debug_shippable_error_after_n_r ERROR: []: debug point: requested to error out after 16384 rows, 16384 rows seen explain (analyze, verbose, costs off, timing off, summary off) select 1 from metrics_dist_remote_error where ts_debug_shippable_error_after_n_rows(10000000, device_id)::int != 0; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) on public.metrics_dist_remote_error (actual rows=22799 loops=1) Output: 1 Data node: db_dist_remote_error_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_9_chunk - Remote SQL: SELECT NULL FROM public.metrics_dist_remote_error WHERE _timescaledb_internal.chunks_in(public.metrics_dist_remote_error.*, ARRAY[1, 2, 3, 4, 5, 6, 7, 8, 9]) AND ((public.ts_debug_shippable_error_after_n_rows(10000000, device_id) <> 0)) + Remote SQL: SELECT NULL FROM public.metrics_dist_remote_error WHERE _timescaledb_functions.chunks_in(public.metrics_dist_remote_error.*, ARRAY[1, 2, 3, 4, 5, 6, 7, 8, 9]) AND ((public.ts_debug_shippable_error_after_n_rows(10000000, device_id) <> 0)) (6 rows) -- We don't test fatal errors here, because PG versions before 14 are unable to @@ -106,14 +106,14 @@ select 1 from metrics_dist_remote_error where ts_debug_shippable_error_after_n_r ERROR: []: debug point: requested to error out after 10000 rows, 10000 rows seen explain (analyze, verbose, costs off, timing off, summary off) select 1 from metrics_dist_remote_error where ts_debug_shippable_error_after_n_rows(10000000, device_id)::int != 0; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) on public.metrics_dist_remote_error (actual rows=22799 loops=1) Output: 1 Data node: db_dist_remote_error_1 Fetcher Type: Cursor Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_9_chunk - Remote SQL: SELECT NULL FROM public.metrics_dist_remote_error WHERE _timescaledb_internal.chunks_in(public.metrics_dist_remote_error.*, ARRAY[1, 2, 3, 4, 5, 6, 7, 8, 9]) AND ((public.ts_debug_shippable_error_after_n_rows(10000000, device_id) <> 0)) + Remote SQL: SELECT NULL FROM public.metrics_dist_remote_error WHERE _timescaledb_functions.chunks_in(public.metrics_dist_remote_error.*, ARRAY[1, 2, 3, 4, 5, 6, 7, 8, 9]) AND ((public.ts_debug_shippable_error_after_n_rows(10000000, device_id) <> 0)) (6 rows) -- Now test the same with the prepared statement fetcher. @@ -135,14 +135,14 @@ select 1 from metrics_dist_remote_error where ts_debug_shippable_error_after_n_r ERROR: []: debug point: requested to error out after 10000 rows, 10000 rows seen explain (analyze, verbose, costs off, timing off, summary off) select 1 from metrics_dist_remote_error where ts_debug_shippable_error_after_n_rows(10000000, device_id)::int != 0; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Custom Scan (DataNodeScan) on public.metrics_dist_remote_error (actual rows=22799 loops=1) Output: 1 Data node: db_dist_remote_error_1 Fetcher Type: Prepared statement Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_9_chunk - Remote SQL: SELECT NULL FROM public.metrics_dist_remote_error WHERE _timescaledb_internal.chunks_in(public.metrics_dist_remote_error.*, ARRAY[1, 2, 3, 4, 5, 6, 7, 8, 9]) AND ((public.ts_debug_shippable_error_after_n_rows(10000000, device_id) <> 0)) + Remote SQL: SELECT NULL FROM public.metrics_dist_remote_error WHERE _timescaledb_functions.chunks_in(public.metrics_dist_remote_error.*, ARRAY[1, 2, 3, 4, 5, 6, 7, 8, 9]) AND ((public.ts_debug_shippable_error_after_n_rows(10000000, device_id) <> 0)) (6 rows) reset timescaledb.remote_data_fetcher; @@ -313,8 +313,8 @@ set timescaledb.enable_connection_binary_data = true; set timescaledb.remote_data_fetcher = 'prepared'; explain (analyze, verbose, costs off, timing off, summary off) select * from metrics_dist_ss; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Custom Scan (AsyncAppend) (actual rows=22800 loops=1) Output: metrics_dist_ss."time", metrics_dist_ss.device_id, metrics_dist_ss.v0, metrics_dist_ss.v1, metrics_dist_ss.v2, metrics_dist_ss.v3 -> Append (actual rows=22800 loops=1) @@ -323,26 +323,26 @@ select * from metrics_dist_ss; Data node: db_dist_remote_error_1 Fetcher Type: Prepared statement Chunks: _dist_hyper_5_123_chunk, _dist_hyper_5_126_chunk, _dist_hyper_5_129_chunk - Remote SQL: SELECT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist_ss WHERE _timescaledb_internal.chunks_in(public.metrics_dist_ss.*, ARRAY[57, 58, 59]) + Remote SQL: SELECT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist_ss WHERE _timescaledb_functions.chunks_in(public.metrics_dist_ss.*, ARRAY[57, 58, 59]) -> Custom Scan (DataNodeScan) on public.metrics_dist_ss metrics_dist_ss_2 (actual rows=13680 loops=1) Output: metrics_dist_ss_2."time", metrics_dist_ss_2.device_id, metrics_dist_ss_2.v0, metrics_dist_ss_2.v1, metrics_dist_ss_2.v2, metrics_dist_ss_2.v3 Data node: db_dist_remote_error_2 Fetcher Type: Prepared statement Chunks: _dist_hyper_5_124_chunk, _dist_hyper_5_127_chunk, _dist_hyper_5_130_chunk - Remote SQL: SELECT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist_ss WHERE _timescaledb_internal.chunks_in(public.metrics_dist_ss.*, ARRAY[49, 50, 51]) + Remote SQL: SELECT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist_ss WHERE _timescaledb_functions.chunks_in(public.metrics_dist_ss.*, ARRAY[49, 50, 51]) -> Custom Scan (DataNodeScan) on public.metrics_dist_ss metrics_dist_ss_3 (actual rows=4560 loops=1) Output: metrics_dist_ss_3."time", metrics_dist_ss_3.device_id, metrics_dist_ss_3.v0, metrics_dist_ss_3.v1, metrics_dist_ss_3.v2, metrics_dist_ss_3.v3 Data node: db_dist_remote_error_3 Fetcher Type: Prepared statement Chunks: _dist_hyper_5_125_chunk, _dist_hyper_5_128_chunk, _dist_hyper_5_131_chunk - Remote SQL: SELECT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist_ss WHERE _timescaledb_internal.chunks_in(public.metrics_dist_ss.*, ARRAY[38, 39, 40]) + Remote SQL: SELECT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist_ss WHERE _timescaledb_functions.chunks_in(public.metrics_dist_ss.*, ARRAY[38, 39, 40]) (21 rows) set timescaledb.remote_data_fetcher = 'copy'; explain (analyze, verbose, costs off, timing off, summary off) select * from metrics_dist_ss; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Custom Scan (AsyncAppend) (actual rows=22800 loops=1) Output: metrics_dist_ss."time", metrics_dist_ss.device_id, metrics_dist_ss.v0, metrics_dist_ss.v1, metrics_dist_ss.v2, metrics_dist_ss.v3 -> Append (actual rows=22800 loops=1) @@ -351,26 +351,26 @@ select * from metrics_dist_ss; Data node: db_dist_remote_error_1 Fetcher Type: COPY Chunks: _dist_hyper_5_123_chunk, _dist_hyper_5_126_chunk, _dist_hyper_5_129_chunk - Remote SQL: SELECT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist_ss WHERE _timescaledb_internal.chunks_in(public.metrics_dist_ss.*, ARRAY[57, 58, 59]) + Remote SQL: SELECT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist_ss WHERE _timescaledb_functions.chunks_in(public.metrics_dist_ss.*, ARRAY[57, 58, 59]) -> Custom Scan (DataNodeScan) on public.metrics_dist_ss metrics_dist_ss_2 (actual rows=13680 loops=1) Output: metrics_dist_ss_2."time", metrics_dist_ss_2.device_id, metrics_dist_ss_2.v0, metrics_dist_ss_2.v1, metrics_dist_ss_2.v2, metrics_dist_ss_2.v3 Data node: db_dist_remote_error_2 Fetcher Type: COPY Chunks: _dist_hyper_5_124_chunk, _dist_hyper_5_127_chunk, _dist_hyper_5_130_chunk - Remote SQL: SELECT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist_ss WHERE _timescaledb_internal.chunks_in(public.metrics_dist_ss.*, ARRAY[49, 50, 51]) + Remote SQL: SELECT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist_ss WHERE _timescaledb_functions.chunks_in(public.metrics_dist_ss.*, ARRAY[49, 50, 51]) -> Custom Scan (DataNodeScan) on public.metrics_dist_ss metrics_dist_ss_3 (actual rows=4560 loops=1) Output: metrics_dist_ss_3."time", metrics_dist_ss_3.device_id, metrics_dist_ss_3.v0, metrics_dist_ss_3.v1, metrics_dist_ss_3.v2, metrics_dist_ss_3.v3 Data node: db_dist_remote_error_3 Fetcher Type: COPY Chunks: _dist_hyper_5_125_chunk, _dist_hyper_5_128_chunk, _dist_hyper_5_131_chunk - Remote SQL: SELECT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist_ss WHERE _timescaledb_internal.chunks_in(public.metrics_dist_ss.*, ARRAY[38, 39, 40]) + Remote SQL: SELECT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist_ss WHERE _timescaledb_functions.chunks_in(public.metrics_dist_ss.*, ARRAY[38, 39, 40]) (21 rows) set timescaledb.remote_data_fetcher = 'cursor'; explain (analyze, verbose, costs off, timing off, summary off) select * from metrics_dist_ss; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Custom Scan (AsyncAppend) (actual rows=22800 loops=1) Output: metrics_dist_ss."time", metrics_dist_ss.device_id, metrics_dist_ss.v0, metrics_dist_ss.v1, metrics_dist_ss.v2, metrics_dist_ss.v3 -> Append (actual rows=22800 loops=1) @@ -379,19 +379,19 @@ select * from metrics_dist_ss; Data node: db_dist_remote_error_1 Fetcher Type: Cursor Chunks: _dist_hyper_5_123_chunk, _dist_hyper_5_126_chunk, _dist_hyper_5_129_chunk - Remote SQL: SELECT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist_ss WHERE _timescaledb_internal.chunks_in(public.metrics_dist_ss.*, ARRAY[57, 58, 59]) + Remote SQL: SELECT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist_ss WHERE _timescaledb_functions.chunks_in(public.metrics_dist_ss.*, ARRAY[57, 58, 59]) -> Custom Scan (DataNodeScan) on public.metrics_dist_ss metrics_dist_ss_2 (actual rows=13680 loops=1) Output: metrics_dist_ss_2."time", metrics_dist_ss_2.device_id, metrics_dist_ss_2.v0, metrics_dist_ss_2.v1, metrics_dist_ss_2.v2, metrics_dist_ss_2.v3 Data node: db_dist_remote_error_2 Fetcher Type: Cursor Chunks: _dist_hyper_5_124_chunk, _dist_hyper_5_127_chunk, _dist_hyper_5_130_chunk - Remote SQL: SELECT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist_ss WHERE _timescaledb_internal.chunks_in(public.metrics_dist_ss.*, ARRAY[49, 50, 51]) + Remote SQL: SELECT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist_ss WHERE _timescaledb_functions.chunks_in(public.metrics_dist_ss.*, ARRAY[49, 50, 51]) -> Custom Scan (DataNodeScan) on public.metrics_dist_ss metrics_dist_ss_3 (actual rows=4560 loops=1) Output: metrics_dist_ss_3."time", metrics_dist_ss_3.device_id, metrics_dist_ss_3.v0, metrics_dist_ss_3.v1, metrics_dist_ss_3.v2, metrics_dist_ss_3.v3 Data node: db_dist_remote_error_3 Fetcher Type: Cursor Chunks: _dist_hyper_5_125_chunk, _dist_hyper_5_128_chunk, _dist_hyper_5_131_chunk - Remote SQL: SELECT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist_ss WHERE _timescaledb_internal.chunks_in(public.metrics_dist_ss.*, ARRAY[38, 39, 40]) + Remote SQL: SELECT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist_ss WHERE _timescaledb_functions.chunks_in(public.metrics_dist_ss.*, ARRAY[38, 39, 40]) (21 rows) -- Incorrect int output, to cover the error handling in tuplefactory. diff --git a/tsl/test/expected/dist_remote_error-15.out b/tsl/test/expected/dist_remote_error-15.out index 707a574530c..5af02df7f86 100644 --- a/tsl/test/expected/dist_remote_error-15.out +++ b/tsl/test/expected/dist_remote_error-15.out @@ -74,15 +74,15 @@ select 1 from metrics_dist_remote_error where ts_debug_shippable_error_after_n_r ERROR: []: debug point: requested to error out after 16384 rows, 16384 rows seen explain (analyze, verbose, costs off, timing off, summary off) select 1 from metrics_dist_remote_error where ts_debug_shippable_error_after_n_rows(10000000, device_id)::int != 0; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Result (actual rows=22799 loops=1) Output: 1 -> Custom Scan (DataNodeScan) on public.metrics_dist_remote_error (actual rows=22799 loops=1) Data node: db_dist_remote_error_1 Fetcher Type: COPY Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_9_chunk - Remote SQL: SELECT NULL FROM public.metrics_dist_remote_error WHERE _timescaledb_internal.chunks_in(public.metrics_dist_remote_error.*, ARRAY[1, 2, 3, 4, 5, 6, 7, 8, 9]) AND ((public.ts_debug_shippable_error_after_n_rows(10000000, device_id) <> 0)) + Remote SQL: SELECT NULL FROM public.metrics_dist_remote_error WHERE _timescaledb_functions.chunks_in(public.metrics_dist_remote_error.*, ARRAY[1, 2, 3, 4, 5, 6, 7, 8, 9]) AND ((public.ts_debug_shippable_error_after_n_rows(10000000, device_id) <> 0)) (7 rows) -- We don't test fatal errors here, because PG versions before 14 are unable to @@ -107,15 +107,15 @@ select 1 from metrics_dist_remote_error where ts_debug_shippable_error_after_n_r ERROR: []: debug point: requested to error out after 10000 rows, 10000 rows seen explain (analyze, verbose, costs off, timing off, summary off) select 1 from metrics_dist_remote_error where ts_debug_shippable_error_after_n_rows(10000000, device_id)::int != 0; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Result (actual rows=22799 loops=1) Output: 1 -> Custom Scan (DataNodeScan) on public.metrics_dist_remote_error (actual rows=22799 loops=1) Data node: db_dist_remote_error_1 Fetcher Type: Cursor Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_9_chunk - Remote SQL: SELECT NULL FROM public.metrics_dist_remote_error WHERE _timescaledb_internal.chunks_in(public.metrics_dist_remote_error.*, ARRAY[1, 2, 3, 4, 5, 6, 7, 8, 9]) AND ((public.ts_debug_shippable_error_after_n_rows(10000000, device_id) <> 0)) + Remote SQL: SELECT NULL FROM public.metrics_dist_remote_error WHERE _timescaledb_functions.chunks_in(public.metrics_dist_remote_error.*, ARRAY[1, 2, 3, 4, 5, 6, 7, 8, 9]) AND ((public.ts_debug_shippable_error_after_n_rows(10000000, device_id) <> 0)) (7 rows) -- Now test the same with the prepared statement fetcher. @@ -137,15 +137,15 @@ select 1 from metrics_dist_remote_error where ts_debug_shippable_error_after_n_r ERROR: []: debug point: requested to error out after 10000 rows, 10000 rows seen explain (analyze, verbose, costs off, timing off, summary off) select 1 from metrics_dist_remote_error where ts_debug_shippable_error_after_n_rows(10000000, device_id)::int != 0; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Result (actual rows=22799 loops=1) Output: 1 -> Custom Scan (DataNodeScan) on public.metrics_dist_remote_error (actual rows=22799 loops=1) Data node: db_dist_remote_error_1 Fetcher Type: Prepared statement Chunks: _dist_hyper_1_1_chunk, _dist_hyper_1_2_chunk, _dist_hyper_1_3_chunk, _dist_hyper_1_4_chunk, _dist_hyper_1_5_chunk, _dist_hyper_1_6_chunk, _dist_hyper_1_7_chunk, _dist_hyper_1_8_chunk, _dist_hyper_1_9_chunk - Remote SQL: SELECT NULL FROM public.metrics_dist_remote_error WHERE _timescaledb_internal.chunks_in(public.metrics_dist_remote_error.*, ARRAY[1, 2, 3, 4, 5, 6, 7, 8, 9]) AND ((public.ts_debug_shippable_error_after_n_rows(10000000, device_id) <> 0)) + Remote SQL: SELECT NULL FROM public.metrics_dist_remote_error WHERE _timescaledb_functions.chunks_in(public.metrics_dist_remote_error.*, ARRAY[1, 2, 3, 4, 5, 6, 7, 8, 9]) AND ((public.ts_debug_shippable_error_after_n_rows(10000000, device_id) <> 0)) (7 rows) reset timescaledb.remote_data_fetcher; @@ -316,8 +316,8 @@ set timescaledb.enable_connection_binary_data = true; set timescaledb.remote_data_fetcher = 'prepared'; explain (analyze, verbose, costs off, timing off, summary off) select * from metrics_dist_ss; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Custom Scan (AsyncAppend) (actual rows=22800 loops=1) Output: metrics_dist_ss."time", metrics_dist_ss.device_id, metrics_dist_ss.v0, metrics_dist_ss.v1, metrics_dist_ss.v2, metrics_dist_ss.v3 -> Append (actual rows=22800 loops=1) @@ -326,26 +326,26 @@ select * from metrics_dist_ss; Data node: db_dist_remote_error_1 Fetcher Type: Prepared statement Chunks: _dist_hyper_5_123_chunk, _dist_hyper_5_126_chunk, _dist_hyper_5_129_chunk - Remote SQL: SELECT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist_ss WHERE _timescaledb_internal.chunks_in(public.metrics_dist_ss.*, ARRAY[57, 58, 59]) + Remote SQL: SELECT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist_ss WHERE _timescaledb_functions.chunks_in(public.metrics_dist_ss.*, ARRAY[57, 58, 59]) -> Custom Scan (DataNodeScan) on public.metrics_dist_ss metrics_dist_ss_2 (actual rows=13680 loops=1) Output: metrics_dist_ss_2."time", metrics_dist_ss_2.device_id, metrics_dist_ss_2.v0, metrics_dist_ss_2.v1, metrics_dist_ss_2.v2, metrics_dist_ss_2.v3 Data node: db_dist_remote_error_2 Fetcher Type: Prepared statement Chunks: _dist_hyper_5_124_chunk, _dist_hyper_5_127_chunk, _dist_hyper_5_130_chunk - Remote SQL: SELECT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist_ss WHERE _timescaledb_internal.chunks_in(public.metrics_dist_ss.*, ARRAY[49, 50, 51]) + Remote SQL: SELECT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist_ss WHERE _timescaledb_functions.chunks_in(public.metrics_dist_ss.*, ARRAY[49, 50, 51]) -> Custom Scan (DataNodeScan) on public.metrics_dist_ss metrics_dist_ss_3 (actual rows=4560 loops=1) Output: metrics_dist_ss_3."time", metrics_dist_ss_3.device_id, metrics_dist_ss_3.v0, metrics_dist_ss_3.v1, metrics_dist_ss_3.v2, metrics_dist_ss_3.v3 Data node: db_dist_remote_error_3 Fetcher Type: Prepared statement Chunks: _dist_hyper_5_125_chunk, _dist_hyper_5_128_chunk, _dist_hyper_5_131_chunk - Remote SQL: SELECT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist_ss WHERE _timescaledb_internal.chunks_in(public.metrics_dist_ss.*, ARRAY[38, 39, 40]) + Remote SQL: SELECT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist_ss WHERE _timescaledb_functions.chunks_in(public.metrics_dist_ss.*, ARRAY[38, 39, 40]) (21 rows) set timescaledb.remote_data_fetcher = 'copy'; explain (analyze, verbose, costs off, timing off, summary off) select * from metrics_dist_ss; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Custom Scan (AsyncAppend) (actual rows=22800 loops=1) Output: metrics_dist_ss."time", metrics_dist_ss.device_id, metrics_dist_ss.v0, metrics_dist_ss.v1, metrics_dist_ss.v2, metrics_dist_ss.v3 -> Append (actual rows=22800 loops=1) @@ -354,26 +354,26 @@ select * from metrics_dist_ss; Data node: db_dist_remote_error_1 Fetcher Type: COPY Chunks: _dist_hyper_5_123_chunk, _dist_hyper_5_126_chunk, _dist_hyper_5_129_chunk - Remote SQL: SELECT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist_ss WHERE _timescaledb_internal.chunks_in(public.metrics_dist_ss.*, ARRAY[57, 58, 59]) + Remote SQL: SELECT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist_ss WHERE _timescaledb_functions.chunks_in(public.metrics_dist_ss.*, ARRAY[57, 58, 59]) -> Custom Scan (DataNodeScan) on public.metrics_dist_ss metrics_dist_ss_2 (actual rows=13680 loops=1) Output: metrics_dist_ss_2."time", metrics_dist_ss_2.device_id, metrics_dist_ss_2.v0, metrics_dist_ss_2.v1, metrics_dist_ss_2.v2, metrics_dist_ss_2.v3 Data node: db_dist_remote_error_2 Fetcher Type: COPY Chunks: _dist_hyper_5_124_chunk, _dist_hyper_5_127_chunk, _dist_hyper_5_130_chunk - Remote SQL: SELECT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist_ss WHERE _timescaledb_internal.chunks_in(public.metrics_dist_ss.*, ARRAY[49, 50, 51]) + Remote SQL: SELECT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist_ss WHERE _timescaledb_functions.chunks_in(public.metrics_dist_ss.*, ARRAY[49, 50, 51]) -> Custom Scan (DataNodeScan) on public.metrics_dist_ss metrics_dist_ss_3 (actual rows=4560 loops=1) Output: metrics_dist_ss_3."time", metrics_dist_ss_3.device_id, metrics_dist_ss_3.v0, metrics_dist_ss_3.v1, metrics_dist_ss_3.v2, metrics_dist_ss_3.v3 Data node: db_dist_remote_error_3 Fetcher Type: COPY Chunks: _dist_hyper_5_125_chunk, _dist_hyper_5_128_chunk, _dist_hyper_5_131_chunk - Remote SQL: SELECT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist_ss WHERE _timescaledb_internal.chunks_in(public.metrics_dist_ss.*, ARRAY[38, 39, 40]) + Remote SQL: SELECT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist_ss WHERE _timescaledb_functions.chunks_in(public.metrics_dist_ss.*, ARRAY[38, 39, 40]) (21 rows) set timescaledb.remote_data_fetcher = 'cursor'; explain (analyze, verbose, costs off, timing off, summary off) select * from metrics_dist_ss; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Custom Scan (AsyncAppend) (actual rows=22800 loops=1) Output: metrics_dist_ss."time", metrics_dist_ss.device_id, metrics_dist_ss.v0, metrics_dist_ss.v1, metrics_dist_ss.v2, metrics_dist_ss.v3 -> Append (actual rows=22800 loops=1) @@ -382,19 +382,19 @@ select * from metrics_dist_ss; Data node: db_dist_remote_error_1 Fetcher Type: Cursor Chunks: _dist_hyper_5_123_chunk, _dist_hyper_5_126_chunk, _dist_hyper_5_129_chunk - Remote SQL: SELECT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist_ss WHERE _timescaledb_internal.chunks_in(public.metrics_dist_ss.*, ARRAY[57, 58, 59]) + Remote SQL: SELECT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist_ss WHERE _timescaledb_functions.chunks_in(public.metrics_dist_ss.*, ARRAY[57, 58, 59]) -> Custom Scan (DataNodeScan) on public.metrics_dist_ss metrics_dist_ss_2 (actual rows=13680 loops=1) Output: metrics_dist_ss_2."time", metrics_dist_ss_2.device_id, metrics_dist_ss_2.v0, metrics_dist_ss_2.v1, metrics_dist_ss_2.v2, metrics_dist_ss_2.v3 Data node: db_dist_remote_error_2 Fetcher Type: Cursor Chunks: _dist_hyper_5_124_chunk, _dist_hyper_5_127_chunk, _dist_hyper_5_130_chunk - Remote SQL: SELECT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist_ss WHERE _timescaledb_internal.chunks_in(public.metrics_dist_ss.*, ARRAY[49, 50, 51]) + Remote SQL: SELECT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist_ss WHERE _timescaledb_functions.chunks_in(public.metrics_dist_ss.*, ARRAY[49, 50, 51]) -> Custom Scan (DataNodeScan) on public.metrics_dist_ss metrics_dist_ss_3 (actual rows=4560 loops=1) Output: metrics_dist_ss_3."time", metrics_dist_ss_3.device_id, metrics_dist_ss_3.v0, metrics_dist_ss_3.v1, metrics_dist_ss_3.v2, metrics_dist_ss_3.v3 Data node: db_dist_remote_error_3 Fetcher Type: Cursor Chunks: _dist_hyper_5_125_chunk, _dist_hyper_5_128_chunk, _dist_hyper_5_131_chunk - Remote SQL: SELECT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist_ss WHERE _timescaledb_internal.chunks_in(public.metrics_dist_ss.*, ARRAY[38, 39, 40]) + Remote SQL: SELECT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist_ss WHERE _timescaledb_functions.chunks_in(public.metrics_dist_ss.*, ARRAY[38, 39, 40]) (21 rows) -- Incorrect int output, to cover the error handling in tuplefactory. diff --git a/tsl/test/isolation/expected/freeze_chunk.out b/tsl/test/isolation/expected/freeze_chunk.out index a40b0e87b64..1d225988686 100644 --- a/tsl/test/isolation/expected/freeze_chunk.out +++ b/tsl/test/isolation/expected/freeze_chunk.out @@ -14,7 +14,7 @@ debug_waitpoint_release (1 row) -step s1_freeze: SELECT _timescaledb_internal.freeze_chunk(ch) FROM (SELECT show_chunks('measurements') ch ) q; +step s1_freeze: SELECT _timescaledb_functions.freeze_chunk(ch) FROM (SELECT show_chunks('measurements') ch ) q; step ins_s2_commit: COMMIT; step s1_freeze: <... completed> freeze_chunk @@ -53,7 +53,7 @@ debug_waitpoint_release (1 row) -step s1_freeze: SELECT _timescaledb_internal.freeze_chunk(ch) FROM (SELECT show_chunks('measurements') ch ) q; +step s1_freeze: SELECT _timescaledb_functions.freeze_chunk(ch) FROM (SELECT show_chunks('measurements') ch ) q; step upd_s2_commit: COMMIT; step s1_freeze: <... completed> freeze_chunk @@ -91,7 +91,7 @@ debug_waitpoint_release (1 row) -step s1_freeze: SELECT _timescaledb_internal.freeze_chunk(ch) FROM (SELECT show_chunks('measurements') ch ) q; +step s1_freeze: SELECT _timescaledb_functions.freeze_chunk(ch) FROM (SELECT show_chunks('measurements') ch ) q; step del_s2_commit: COMMIT; step s1_freeze: <... completed> freeze_chunk @@ -134,7 +134,7 @@ debug_waitpoint_release (1 row) -step s1_freeze: SELECT _timescaledb_internal.freeze_chunk(ch) FROM (SELECT show_chunks('measurements') ch ) q; +step s1_freeze: SELECT _timescaledb_functions.freeze_chunk(ch) FROM (SELECT show_chunks('measurements') ch ) q; freeze_chunk ------------ t @@ -165,7 +165,7 @@ lock_chunktable (1 row) step comp_s2_compress: BEGIN; SELECT CASE WHEN compress_chunk(ch) IS NOT NULL THEN 'Success' ELSE 'Failed' END as COL FROM (SELECT show_chunks('measurements') ch ) q; -step s1_freeze: SELECT _timescaledb_internal.freeze_chunk(ch) FROM (SELECT show_chunks('measurements') ch ) q; +step s1_freeze: SELECT _timescaledb_functions.freeze_chunk(ch) FROM (SELECT show_chunks('measurements') ch ) q; step UnlockChunk: ROLLBACK; step comp_s2_compress: <... completed> col diff --git a/tsl/test/isolation/expected/remote_create_chunk.out b/tsl/test/isolation/expected/remote_create_chunk.out index 8fb42b33239..e35d0655eec 100644 --- a/tsl/test/isolation/expected/remote_create_chunk.out +++ b/tsl/test/isolation/expected/remote_create_chunk.out @@ -14,10 +14,10 @@ debug_waitpoint_enable (1 row) step s1_create_chunk_1: - SELECT slices, created FROM _timescaledb_internal.create_chunk('conditions', jsonb_build_object('time', ARRAY[1514764800000000, 1514851200000000], 'device', ARRAY[-9223372036854775808, 1073741823])); + SELECT slices, created FROM _timescaledb_functions.create_chunk('conditions', jsonb_build_object('time', ARRAY[1514764800000000, 1514851200000000], 'device', ARRAY[-9223372036854775808, 1073741823])); step s2_create_chunk_1: - SELECT slices, created FROM _timescaledb_internal.create_chunk('conditions', jsonb_build_object('time', ARRAY[1514764800000000, 1514851200000000], 'device', ARRAY[-9223372036854775808, 1073741823])); + SELECT slices, created FROM _timescaledb_functions.create_chunk('conditions', jsonb_build_object('time', ARRAY[1514764800000000, 1514851200000000], 'device', ARRAY[-9223372036854775808, 1073741823])); step s3_conditions_locks: SELECT root_table_lock_count() AS table_lock, @@ -80,10 +80,10 @@ debug_waitpoint_enable (1 row) step s1_create_chunk_1: - SELECT slices, created FROM _timescaledb_internal.create_chunk('conditions', jsonb_build_object('time', ARRAY[1514764800000000, 1514851200000000], 'device', ARRAY[-9223372036854775808, 1073741823])); + SELECT slices, created FROM _timescaledb_functions.create_chunk('conditions', jsonb_build_object('time', ARRAY[1514764800000000, 1514851200000000], 'device', ARRAY[-9223372036854775808, 1073741823])); step s2_create_chunk_2: - SELECT slices, created FROM _timescaledb_internal.create_chunk('conditions', jsonb_build_object('time', ARRAY[1514764800000000, 1514851200000000], 'device', ARRAY[1073741823, 9223372036854775807])); + SELECT slices, created FROM _timescaledb_functions.create_chunk('conditions', jsonb_build_object('time', ARRAY[1514764800000000, 1514851200000000], 'device', ARRAY[1073741823, 9223372036854775807])); step s3_conditions_locks: SELECT root_table_lock_count() AS table_lock, @@ -140,7 +140,7 @@ debug_waitpoint_enable (1 row) step s1_create_chunk_1: - SELECT slices, created FROM _timescaledb_internal.create_chunk('conditions', jsonb_build_object('time', ARRAY[1514764800000000, 1514851200000000], 'device', ARRAY[-9223372036854775808, 1073741823])); + SELECT slices, created FROM _timescaledb_functions.create_chunk('conditions', jsonb_build_object('time', ARRAY[1514764800000000, 1514851200000000], 'device', ARRAY[-9223372036854775808, 1073741823])); step s4_wait_start: SELECT debug_waitpoint_enable('find_or_create_chunk_start'); debug_waitpoint_enable @@ -149,7 +149,7 @@ debug_waitpoint_enable (1 row) step s2_create_chunk_1: - SELECT slices, created FROM _timescaledb_internal.create_chunk('conditions', jsonb_build_object('time', ARRAY[1514764800000000, 1514851200000000], 'device', ARRAY[-9223372036854775808, 1073741823])); + SELECT slices, created FROM _timescaledb_functions.create_chunk('conditions', jsonb_build_object('time', ARRAY[1514764800000000, 1514851200000000], 'device', ARRAY[-9223372036854775808, 1073741823])); step s3_conditions_locks: SELECT root_table_lock_count() AS table_lock, diff --git a/tsl/test/isolation/specs/freeze_chunk.spec b/tsl/test/isolation/specs/freeze_chunk.spec index fc6b12c23cd..df4928049db 100644 --- a/tsl/test/isolation/specs/freeze_chunk.spec +++ b/tsl/test/isolation/specs/freeze_chunk.spec @@ -24,7 +24,7 @@ teardown { # before a lock is acquired for freezing the chunk. session "s1" -step "s1_freeze" { SELECT _timescaledb_internal.freeze_chunk(ch) FROM (SELECT show_chunks('measurements') ch ) q; } +step "s1_freeze" { SELECT _timescaledb_functions.freeze_chunk(ch) FROM (SELECT show_chunks('measurements') ch ) q; } step "s1_status" { SELECT ch.status FROM _timescaledb_catalog.chunk ch WHERE hypertable_id = (SELECT id FROM _timescaledb_catalog.hypertable WHERE table_name = 'measurements'); } diff --git a/tsl/test/isolation/specs/remote_create_chunk.spec b/tsl/test/isolation/specs/remote_create_chunk.spec index 2ede364b5a0..ced30e20f9b 100644 --- a/tsl/test/isolation/specs/remote_create_chunk.spec +++ b/tsl/test/isolation/specs/remote_create_chunk.spec @@ -45,7 +45,7 @@ setup { # Try to create a chunk step "s1_create_chunk_1" { - SELECT slices, created FROM _timescaledb_internal.create_chunk('conditions', jsonb_build_object('time', ARRAY[1514764800000000, 1514851200000000], 'device', ARRAY[-9223372036854775808, 1073741823])); + SELECT slices, created FROM _timescaledb_functions.create_chunk('conditions', jsonb_build_object('time', ARRAY[1514764800000000, 1514851200000000], 'device', ARRAY[-9223372036854775808, 1073741823])); } # Create a chunk that does not exist @@ -58,11 +58,11 @@ setup { } step "s2_create_chunk_1" { - SELECT slices, created FROM _timescaledb_internal.create_chunk('conditions', jsonb_build_object('time', ARRAY[1514764800000000, 1514851200000000], 'device', ARRAY[-9223372036854775808, 1073741823])); + SELECT slices, created FROM _timescaledb_functions.create_chunk('conditions', jsonb_build_object('time', ARRAY[1514764800000000, 1514851200000000], 'device', ARRAY[-9223372036854775808, 1073741823])); } step "s2_create_chunk_2" { - SELECT slices, created FROM _timescaledb_internal.create_chunk('conditions', jsonb_build_object('time', ARRAY[1514764800000000, 1514851200000000], 'device', ARRAY[1073741823, 9223372036854775807])); + SELECT slices, created FROM _timescaledb_functions.create_chunk('conditions', jsonb_build_object('time', ARRAY[1514764800000000, 1514851200000000], 'device', ARRAY[1073741823, 9223372036854775807])); } session "s3" diff --git a/tsl/test/shared/expected/dist_distinct-13.out b/tsl/test/shared/expected/dist_distinct-13.out index bf2dc951f42..88a03608a40 100644 --- a/tsl/test/shared/expected/dist_distinct-13.out +++ b/tsl/test/shared/expected/dist_distinct-13.out @@ -39,17 +39,17 @@ QUERY PLAN Output: metrics_dist_1.device_id Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST + Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_2 Output: metrics_dist_2.device_id Data node: data_node_2 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST + Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_3 Output: metrics_dist_3.device_id Data node: data_node_3 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST + Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST (23 rows) RESET enable_hashagg; @@ -73,17 +73,17 @@ QUERY PLAN Output: (metrics_dist_1.device_id * metrics_dist_1.v1) Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT device_id, v1 FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY (device_id * v1) ASC NULLS LAST + Remote SQL: SELECT device_id, v1 FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY (device_id * v1) ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_2 Output: (metrics_dist_2.device_id * metrics_dist_2.v1) Data node: data_node_2 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT device_id, v1 FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY (device_id * v1) ASC NULLS LAST + Remote SQL: SELECT device_id, v1 FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY (device_id * v1) ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_3 Output: (metrics_dist_3.device_id * metrics_dist_3.v1) Data node: data_node_3 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT device_id, v1 FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY (device_id * v1) ASC NULLS LAST + Remote SQL: SELECT device_id, v1 FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY (device_id * v1) ASC NULLS LAST (23 rows) SET timescaledb.enable_remote_explain = ON; @@ -106,7 +106,7 @@ QUERY PLAN Output: metrics_dist_1.device_id Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST + Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk.device_id @@ -132,7 +132,7 @@ QUERY PLAN Output: metrics_dist_2.device_id Data node: data_node_2 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST + Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk.device_id @@ -158,7 +158,7 @@ QUERY PLAN Output: metrics_dist_3.device_id Data node: data_node_3 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST + Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk.device_id @@ -201,7 +201,7 @@ QUERY PLAN Output: metrics_dist_1.device_id, NULL::text, 'const1'::text Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST + Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk.device_id @@ -227,7 +227,7 @@ QUERY PLAN Output: metrics_dist_2.device_id, NULL::text, 'const1'::text Data node: data_node_2 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST + Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk.device_id @@ -253,7 +253,7 @@ QUERY PLAN Output: metrics_dist_3.device_id, NULL::text, 'const1'::text Data node: data_node_3 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST + Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk.device_id @@ -296,7 +296,7 @@ QUERY PLAN Output: metrics_dist_1.device_id, metrics_dist_1."time", NULL::text, 'const1'::text Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT "time", device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk."time", _dist_hyper_X_X_chunk.device_id @@ -315,7 +315,7 @@ QUERY PLAN Output: metrics_dist_2.device_id, metrics_dist_2."time", NULL::text, 'const1'::text Data node: data_node_2 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT "time", device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST Remote EXPLAIN: Sort Output: _dist_hyper_X_X_chunk."time", _dist_hyper_X_X_chunk.device_id @@ -335,7 +335,7 @@ QUERY PLAN Output: metrics_dist_3.device_id, metrics_dist_3."time", NULL::text, 'const1'::text Data node: data_node_3 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT "time", device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk."time", _dist_hyper_X_X_chunk.device_id @@ -371,7 +371,7 @@ QUERY PLAN Output: metrics_dist_1.device_id, metrics_dist_1."time" Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT "time", device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk."time", _dist_hyper_X_X_chunk.device_id @@ -390,7 +390,7 @@ QUERY PLAN Output: metrics_dist_2.device_id, metrics_dist_2."time" Data node: data_node_2 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT "time", device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST Remote EXPLAIN: Sort Output: _dist_hyper_X_X_chunk."time", _dist_hyper_X_X_chunk.device_id @@ -410,7 +410,7 @@ QUERY PLAN Output: metrics_dist_3.device_id, metrics_dist_3."time" Data node: data_node_3 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT "time", device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk."time", _dist_hyper_X_X_chunk.device_id @@ -446,7 +446,7 @@ QUERY PLAN Output: metrics_dist_1.device_id, metrics_dist_1."time" Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT ON (device_id, "time") "time", device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device_id, "time") "time", device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk."time", _dist_hyper_X_X_chunk.device_id @@ -465,7 +465,7 @@ QUERY PLAN Output: metrics_dist_2.device_id, metrics_dist_2."time" Data node: data_node_2 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT ON (device_id, "time") "time", device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device_id, "time") "time", device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk."time", _dist_hyper_X_X_chunk.device_id @@ -484,7 +484,7 @@ QUERY PLAN Output: metrics_dist_3.device_id, metrics_dist_3."time" Data node: data_node_3 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT ON (device_id, "time") "time", device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device_id, "time") "time", device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk."time", _dist_hyper_X_X_chunk.device_id @@ -522,7 +522,7 @@ QUERY PLAN Output: metrics_dist_1.device_id, metrics_dist_1."time" Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT ON (device_id) "time", device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device_id) "time", device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk."time", _dist_hyper_X_X_chunk.device_id @@ -541,7 +541,7 @@ QUERY PLAN Output: metrics_dist_2.device_id, metrics_dist_2."time" Data node: data_node_2 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT ON (device_id) "time", device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device_id) "time", device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk."time", _dist_hyper_X_X_chunk.device_id @@ -560,7 +560,7 @@ QUERY PLAN Output: metrics_dist_3.device_id, metrics_dist_3."time" Data node: data_node_3 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT ON (device_id) "time", device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device_id) "time", device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk."time", _dist_hyper_X_X_chunk.device_id @@ -728,17 +728,17 @@ QUERY PLAN Output: metrics_dist_1.device_id, metrics_dist_1.device_id Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST + Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_2 Output: metrics_dist_2.device_id, metrics_dist_2.device_id Data node: data_node_2 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST + Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_3 Output: metrics_dist_3.device_id, metrics_dist_3.device_id Data node: data_node_3 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST + Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST (21 rows) SELECT DISTINCT handles whole row correctly @@ -760,17 +760,17 @@ QUERY PLAN Output: metrics_dist_1."time", metrics_dist_1.device_id, metrics_dist_1.v0, metrics_dist_1.v1, metrics_dist_1.v2, metrics_dist_1.v3 Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY "time" ASC NULLS LAST, device_id ASC NULLS LAST, v0 ASC NULLS LAST, v1 ASC NULLS LAST, v2 ASC NULLS LAST, v3 ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY "time" ASC NULLS LAST, device_id ASC NULLS LAST, v0 ASC NULLS LAST, v1 ASC NULLS LAST, v2 ASC NULLS LAST, v3 ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_2 Output: metrics_dist_2."time", metrics_dist_2.device_id, metrics_dist_2.v0, metrics_dist_2.v1, metrics_dist_2.v2, metrics_dist_2.v3 Data node: data_node_2 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY "time" ASC NULLS LAST, device_id ASC NULLS LAST, v0 ASC NULLS LAST, v1 ASC NULLS LAST, v2 ASC NULLS LAST, v3 ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY "time" ASC NULLS LAST, device_id ASC NULLS LAST, v0 ASC NULLS LAST, v1 ASC NULLS LAST, v2 ASC NULLS LAST, v3 ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_3 Output: metrics_dist_3."time", metrics_dist_3.device_id, metrics_dist_3.v0, metrics_dist_3.v1, metrics_dist_3.v2, metrics_dist_3.v3 Data node: data_node_3 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY "time" ASC NULLS LAST, device_id ASC NULLS LAST, v0 ASC NULLS LAST, v1 ASC NULLS LAST, v2 ASC NULLS LAST, v3 ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY "time" ASC NULLS LAST, device_id ASC NULLS LAST, v0 ASC NULLS LAST, v1 ASC NULLS LAST, v2 ASC NULLS LAST, v3 ASC NULLS LAST (23 rows) SELECT DISTINCT ON (expr) handles whole row correctly @@ -792,17 +792,17 @@ QUERY PLAN Output: metrics_dist_1."time", metrics_dist_1.device_id, metrics_dist_1.v0, metrics_dist_1.v1, metrics_dist_1.v2, metrics_dist_1.v3 Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT ON (device_id) "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device_id) "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_2 Output: metrics_dist_2."time", metrics_dist_2.device_id, metrics_dist_2.v0, metrics_dist_2.v1, metrics_dist_2.v2, metrics_dist_2.v3 Data node: data_node_2 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT ON (device_id) "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device_id) "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_3 Output: metrics_dist_3."time", metrics_dist_3.device_id, metrics_dist_3.v0, metrics_dist_3.v1, metrics_dist_3.v2, metrics_dist_3.v3 Data node: data_node_3 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT ON (device_id) "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device_id) "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST (23 rows) SELECT DISTINCT RECORD works correctly @@ -827,17 +827,17 @@ QUERY PLAN Output: metrics_dist_1.* Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) + Remote SQL: SELECT DISTINCT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_2 Output: metrics_dist_2.* Data node: data_node_2 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) + Remote SQL: SELECT DISTINCT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_3 Output: metrics_dist_3.* Data node: data_node_3 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) + Remote SQL: SELECT DISTINCT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) (25 rows) RESET enable_hashagg; @@ -860,17 +860,17 @@ QUERY PLAN Output: time_bucket('@ 1 hour'::interval, metrics_dist_1."time") Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT "time" FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY public.time_bucket('01:00:00'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT "time" FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY public.time_bucket('01:00:00'::interval, "time") ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_2 Output: time_bucket('@ 1 hour'::interval, metrics_dist_2."time") Data node: data_node_2 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT "time" FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY public.time_bucket('01:00:00'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT "time" FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY public.time_bucket('01:00:00'::interval, "time") ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_3 Output: time_bucket('@ 1 hour'::interval, metrics_dist_3."time") Data node: data_node_3 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT "time" FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY public.time_bucket('01:00:00'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT "time" FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY public.time_bucket('01:00:00'::interval, "time") ASC NULLS LAST (23 rows) SELECT DISTINCT without any var references is handled correctly @@ -887,17 +887,17 @@ QUERY PLAN Output: 1, 'constx'::text Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT NULL FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) + Remote SQL: SELECT NULL FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_2 Output: 1, 'constx'::text Data node: data_node_2 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT NULL FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) + Remote SQL: SELECT NULL FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_3 Output: 1, 'constx'::text Data node: data_node_3 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT NULL FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) + Remote SQL: SELECT NULL FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) (20 rows) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/tsl/test/shared/expected/dist_distinct-14.out b/tsl/test/shared/expected/dist_distinct-14.out index bf2dc951f42..88a03608a40 100644 --- a/tsl/test/shared/expected/dist_distinct-14.out +++ b/tsl/test/shared/expected/dist_distinct-14.out @@ -39,17 +39,17 @@ QUERY PLAN Output: metrics_dist_1.device_id Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST + Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_2 Output: metrics_dist_2.device_id Data node: data_node_2 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST + Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_3 Output: metrics_dist_3.device_id Data node: data_node_3 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST + Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST (23 rows) RESET enable_hashagg; @@ -73,17 +73,17 @@ QUERY PLAN Output: (metrics_dist_1.device_id * metrics_dist_1.v1) Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT device_id, v1 FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY (device_id * v1) ASC NULLS LAST + Remote SQL: SELECT device_id, v1 FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY (device_id * v1) ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_2 Output: (metrics_dist_2.device_id * metrics_dist_2.v1) Data node: data_node_2 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT device_id, v1 FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY (device_id * v1) ASC NULLS LAST + Remote SQL: SELECT device_id, v1 FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY (device_id * v1) ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_3 Output: (metrics_dist_3.device_id * metrics_dist_3.v1) Data node: data_node_3 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT device_id, v1 FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY (device_id * v1) ASC NULLS LAST + Remote SQL: SELECT device_id, v1 FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY (device_id * v1) ASC NULLS LAST (23 rows) SET timescaledb.enable_remote_explain = ON; @@ -106,7 +106,7 @@ QUERY PLAN Output: metrics_dist_1.device_id Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST + Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk.device_id @@ -132,7 +132,7 @@ QUERY PLAN Output: metrics_dist_2.device_id Data node: data_node_2 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST + Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk.device_id @@ -158,7 +158,7 @@ QUERY PLAN Output: metrics_dist_3.device_id Data node: data_node_3 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST + Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk.device_id @@ -201,7 +201,7 @@ QUERY PLAN Output: metrics_dist_1.device_id, NULL::text, 'const1'::text Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST + Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk.device_id @@ -227,7 +227,7 @@ QUERY PLAN Output: metrics_dist_2.device_id, NULL::text, 'const1'::text Data node: data_node_2 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST + Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk.device_id @@ -253,7 +253,7 @@ QUERY PLAN Output: metrics_dist_3.device_id, NULL::text, 'const1'::text Data node: data_node_3 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST + Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk.device_id @@ -296,7 +296,7 @@ QUERY PLAN Output: metrics_dist_1.device_id, metrics_dist_1."time", NULL::text, 'const1'::text Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT "time", device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk."time", _dist_hyper_X_X_chunk.device_id @@ -315,7 +315,7 @@ QUERY PLAN Output: metrics_dist_2.device_id, metrics_dist_2."time", NULL::text, 'const1'::text Data node: data_node_2 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT "time", device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST Remote EXPLAIN: Sort Output: _dist_hyper_X_X_chunk."time", _dist_hyper_X_X_chunk.device_id @@ -335,7 +335,7 @@ QUERY PLAN Output: metrics_dist_3.device_id, metrics_dist_3."time", NULL::text, 'const1'::text Data node: data_node_3 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT "time", device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk."time", _dist_hyper_X_X_chunk.device_id @@ -371,7 +371,7 @@ QUERY PLAN Output: metrics_dist_1.device_id, metrics_dist_1."time" Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT "time", device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk."time", _dist_hyper_X_X_chunk.device_id @@ -390,7 +390,7 @@ QUERY PLAN Output: metrics_dist_2.device_id, metrics_dist_2."time" Data node: data_node_2 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT "time", device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST Remote EXPLAIN: Sort Output: _dist_hyper_X_X_chunk."time", _dist_hyper_X_X_chunk.device_id @@ -410,7 +410,7 @@ QUERY PLAN Output: metrics_dist_3.device_id, metrics_dist_3."time" Data node: data_node_3 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT "time", device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk."time", _dist_hyper_X_X_chunk.device_id @@ -446,7 +446,7 @@ QUERY PLAN Output: metrics_dist_1.device_id, metrics_dist_1."time" Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT ON (device_id, "time") "time", device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device_id, "time") "time", device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk."time", _dist_hyper_X_X_chunk.device_id @@ -465,7 +465,7 @@ QUERY PLAN Output: metrics_dist_2.device_id, metrics_dist_2."time" Data node: data_node_2 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT ON (device_id, "time") "time", device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device_id, "time") "time", device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk."time", _dist_hyper_X_X_chunk.device_id @@ -484,7 +484,7 @@ QUERY PLAN Output: metrics_dist_3.device_id, metrics_dist_3."time" Data node: data_node_3 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT ON (device_id, "time") "time", device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device_id, "time") "time", device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk."time", _dist_hyper_X_X_chunk.device_id @@ -522,7 +522,7 @@ QUERY PLAN Output: metrics_dist_1.device_id, metrics_dist_1."time" Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT ON (device_id) "time", device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device_id) "time", device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk."time", _dist_hyper_X_X_chunk.device_id @@ -541,7 +541,7 @@ QUERY PLAN Output: metrics_dist_2.device_id, metrics_dist_2."time" Data node: data_node_2 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT ON (device_id) "time", device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device_id) "time", device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk."time", _dist_hyper_X_X_chunk.device_id @@ -560,7 +560,7 @@ QUERY PLAN Output: metrics_dist_3.device_id, metrics_dist_3."time" Data node: data_node_3 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT ON (device_id) "time", device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device_id) "time", device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk."time", _dist_hyper_X_X_chunk.device_id @@ -728,17 +728,17 @@ QUERY PLAN Output: metrics_dist_1.device_id, metrics_dist_1.device_id Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST + Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_2 Output: metrics_dist_2.device_id, metrics_dist_2.device_id Data node: data_node_2 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST + Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_3 Output: metrics_dist_3.device_id, metrics_dist_3.device_id Data node: data_node_3 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST + Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST (21 rows) SELECT DISTINCT handles whole row correctly @@ -760,17 +760,17 @@ QUERY PLAN Output: metrics_dist_1."time", metrics_dist_1.device_id, metrics_dist_1.v0, metrics_dist_1.v1, metrics_dist_1.v2, metrics_dist_1.v3 Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY "time" ASC NULLS LAST, device_id ASC NULLS LAST, v0 ASC NULLS LAST, v1 ASC NULLS LAST, v2 ASC NULLS LAST, v3 ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY "time" ASC NULLS LAST, device_id ASC NULLS LAST, v0 ASC NULLS LAST, v1 ASC NULLS LAST, v2 ASC NULLS LAST, v3 ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_2 Output: metrics_dist_2."time", metrics_dist_2.device_id, metrics_dist_2.v0, metrics_dist_2.v1, metrics_dist_2.v2, metrics_dist_2.v3 Data node: data_node_2 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY "time" ASC NULLS LAST, device_id ASC NULLS LAST, v0 ASC NULLS LAST, v1 ASC NULLS LAST, v2 ASC NULLS LAST, v3 ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY "time" ASC NULLS LAST, device_id ASC NULLS LAST, v0 ASC NULLS LAST, v1 ASC NULLS LAST, v2 ASC NULLS LAST, v3 ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_3 Output: metrics_dist_3."time", metrics_dist_3.device_id, metrics_dist_3.v0, metrics_dist_3.v1, metrics_dist_3.v2, metrics_dist_3.v3 Data node: data_node_3 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY "time" ASC NULLS LAST, device_id ASC NULLS LAST, v0 ASC NULLS LAST, v1 ASC NULLS LAST, v2 ASC NULLS LAST, v3 ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY "time" ASC NULLS LAST, device_id ASC NULLS LAST, v0 ASC NULLS LAST, v1 ASC NULLS LAST, v2 ASC NULLS LAST, v3 ASC NULLS LAST (23 rows) SELECT DISTINCT ON (expr) handles whole row correctly @@ -792,17 +792,17 @@ QUERY PLAN Output: metrics_dist_1."time", metrics_dist_1.device_id, metrics_dist_1.v0, metrics_dist_1.v1, metrics_dist_1.v2, metrics_dist_1.v3 Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT ON (device_id) "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device_id) "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_2 Output: metrics_dist_2."time", metrics_dist_2.device_id, metrics_dist_2.v0, metrics_dist_2.v1, metrics_dist_2.v2, metrics_dist_2.v3 Data node: data_node_2 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT ON (device_id) "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device_id) "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_3 Output: metrics_dist_3."time", metrics_dist_3.device_id, metrics_dist_3.v0, metrics_dist_3.v1, metrics_dist_3.v2, metrics_dist_3.v3 Data node: data_node_3 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT ON (device_id) "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device_id) "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST (23 rows) SELECT DISTINCT RECORD works correctly @@ -827,17 +827,17 @@ QUERY PLAN Output: metrics_dist_1.* Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) + Remote SQL: SELECT DISTINCT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_2 Output: metrics_dist_2.* Data node: data_node_2 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) + Remote SQL: SELECT DISTINCT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_3 Output: metrics_dist_3.* Data node: data_node_3 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) + Remote SQL: SELECT DISTINCT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) (25 rows) RESET enable_hashagg; @@ -860,17 +860,17 @@ QUERY PLAN Output: time_bucket('@ 1 hour'::interval, metrics_dist_1."time") Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT "time" FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY public.time_bucket('01:00:00'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT "time" FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY public.time_bucket('01:00:00'::interval, "time") ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_2 Output: time_bucket('@ 1 hour'::interval, metrics_dist_2."time") Data node: data_node_2 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT "time" FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY public.time_bucket('01:00:00'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT "time" FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY public.time_bucket('01:00:00'::interval, "time") ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_3 Output: time_bucket('@ 1 hour'::interval, metrics_dist_3."time") Data node: data_node_3 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT "time" FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY public.time_bucket('01:00:00'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT "time" FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY public.time_bucket('01:00:00'::interval, "time") ASC NULLS LAST (23 rows) SELECT DISTINCT without any var references is handled correctly @@ -887,17 +887,17 @@ QUERY PLAN Output: 1, 'constx'::text Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT NULL FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) + Remote SQL: SELECT NULL FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_2 Output: 1, 'constx'::text Data node: data_node_2 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT NULL FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) + Remote SQL: SELECT NULL FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_3 Output: 1, 'constx'::text Data node: data_node_3 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT NULL FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) + Remote SQL: SELECT NULL FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) (20 rows) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/tsl/test/shared/expected/dist_distinct-15.out b/tsl/test/shared/expected/dist_distinct-15.out index c30b8984171..71f8dea6399 100644 --- a/tsl/test/shared/expected/dist_distinct-15.out +++ b/tsl/test/shared/expected/dist_distinct-15.out @@ -39,17 +39,17 @@ QUERY PLAN Output: metrics_dist_1.device_id Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST + Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_2 Output: metrics_dist_2.device_id Data node: data_node_2 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST + Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_3 Output: metrics_dist_3.device_id Data node: data_node_3 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST + Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST (23 rows) RESET enable_hashagg; @@ -75,21 +75,21 @@ QUERY PLAN Output: metrics_dist_1.device_id, metrics_dist_1.v1 Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT device_id, v1 FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY (device_id * v1) ASC NULLS LAST + Remote SQL: SELECT device_id, v1 FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY (device_id * v1) ASC NULLS LAST -> Result Output: (metrics_dist_2.device_id * metrics_dist_2.v1) -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_2 Output: metrics_dist_2.device_id, metrics_dist_2.v1 Data node: data_node_2 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT device_id, v1 FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY (device_id * v1) ASC NULLS LAST + Remote SQL: SELECT device_id, v1 FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY (device_id * v1) ASC NULLS LAST -> Result Output: (metrics_dist_3.device_id * metrics_dist_3.v1) -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_3 Output: metrics_dist_3.device_id, metrics_dist_3.v1 Data node: data_node_3 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT device_id, v1 FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY (device_id * v1) ASC NULLS LAST + Remote SQL: SELECT device_id, v1 FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY (device_id * v1) ASC NULLS LAST (29 rows) SET timescaledb.enable_remote_explain = ON; @@ -112,7 +112,7 @@ QUERY PLAN Output: metrics_dist_1.device_id Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST + Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk.device_id @@ -138,7 +138,7 @@ QUERY PLAN Output: metrics_dist_2.device_id Data node: data_node_2 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST + Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk.device_id @@ -164,7 +164,7 @@ QUERY PLAN Output: metrics_dist_3.device_id Data node: data_node_3 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST + Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk.device_id @@ -209,7 +209,7 @@ QUERY PLAN Output: metrics_dist_1.device_id Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST + Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk.device_id @@ -237,7 +237,7 @@ QUERY PLAN Output: metrics_dist_2.device_id Data node: data_node_2 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST + Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk.device_id @@ -265,7 +265,7 @@ QUERY PLAN Output: metrics_dist_3.device_id Data node: data_node_3 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST + Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk.device_id @@ -310,7 +310,7 @@ QUERY PLAN Output: metrics_dist_1.device_id, metrics_dist_1."time" Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT "time", device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk."time", _dist_hyper_X_X_chunk.device_id @@ -331,7 +331,7 @@ QUERY PLAN Output: metrics_dist_2.device_id, metrics_dist_2."time" Data node: data_node_2 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT "time", device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST Remote EXPLAIN: Sort Output: _dist_hyper_X_X_chunk."time", _dist_hyper_X_X_chunk.device_id @@ -353,7 +353,7 @@ QUERY PLAN Output: metrics_dist_3.device_id, metrics_dist_3."time" Data node: data_node_3 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT "time", device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk."time", _dist_hyper_X_X_chunk.device_id @@ -389,7 +389,7 @@ QUERY PLAN Output: metrics_dist_1.device_id, metrics_dist_1."time" Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT "time", device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk."time", _dist_hyper_X_X_chunk.device_id @@ -408,7 +408,7 @@ QUERY PLAN Output: metrics_dist_2.device_id, metrics_dist_2."time" Data node: data_node_2 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT "time", device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST Remote EXPLAIN: Sort Output: _dist_hyper_X_X_chunk."time", _dist_hyper_X_X_chunk.device_id @@ -428,7 +428,7 @@ QUERY PLAN Output: metrics_dist_3.device_id, metrics_dist_3."time" Data node: data_node_3 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT "time", device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk."time", _dist_hyper_X_X_chunk.device_id @@ -464,7 +464,7 @@ QUERY PLAN Output: metrics_dist_1.device_id, metrics_dist_1."time" Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT ON (device_id, "time") "time", device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device_id, "time") "time", device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk."time", _dist_hyper_X_X_chunk.device_id @@ -483,7 +483,7 @@ QUERY PLAN Output: metrics_dist_2.device_id, metrics_dist_2."time" Data node: data_node_2 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT ON (device_id, "time") "time", device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device_id, "time") "time", device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk."time", _dist_hyper_X_X_chunk.device_id @@ -502,7 +502,7 @@ QUERY PLAN Output: metrics_dist_3.device_id, metrics_dist_3."time" Data node: data_node_3 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT ON (device_id, "time") "time", device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device_id, "time") "time", device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk."time", _dist_hyper_X_X_chunk.device_id @@ -540,7 +540,7 @@ QUERY PLAN Output: metrics_dist_1.device_id, metrics_dist_1."time" Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT ON (device_id) "time", device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device_id) "time", device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk."time", _dist_hyper_X_X_chunk.device_id @@ -559,7 +559,7 @@ QUERY PLAN Output: metrics_dist_2.device_id, metrics_dist_2."time" Data node: data_node_2 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT ON (device_id) "time", device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device_id) "time", device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk."time", _dist_hyper_X_X_chunk.device_id @@ -578,7 +578,7 @@ QUERY PLAN Output: metrics_dist_3.device_id, metrics_dist_3."time" Data node: data_node_3 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT ON (device_id) "time", device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device_id) "time", device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST Remote EXPLAIN: Unique Output: _dist_hyper_X_X_chunk."time", _dist_hyper_X_X_chunk.device_id @@ -748,21 +748,21 @@ QUERY PLAN Output: metrics_dist_1.device_id Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST + Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST -> Result Output: metrics_dist_2.device_id, metrics_dist_2.device_id -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_2 Output: metrics_dist_2.device_id Data node: data_node_2 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST + Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST -> Result Output: metrics_dist_3.device_id, metrics_dist_3.device_id -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_3 Output: metrics_dist_3.device_id Data node: data_node_3 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST + Remote SQL: SELECT DISTINCT device_id FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST (27 rows) SELECT DISTINCT handles whole row correctly @@ -784,17 +784,17 @@ QUERY PLAN Output: metrics_dist_1."time", metrics_dist_1.device_id, metrics_dist_1.v0, metrics_dist_1.v1, metrics_dist_1.v2, metrics_dist_1.v3 Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY "time" ASC NULLS LAST, device_id ASC NULLS LAST, v0 ASC NULLS LAST, v1 ASC NULLS LAST, v2 ASC NULLS LAST, v3 ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY "time" ASC NULLS LAST, device_id ASC NULLS LAST, v0 ASC NULLS LAST, v1 ASC NULLS LAST, v2 ASC NULLS LAST, v3 ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_2 Output: metrics_dist_2."time", metrics_dist_2.device_id, metrics_dist_2.v0, metrics_dist_2.v1, metrics_dist_2.v2, metrics_dist_2.v3 Data node: data_node_2 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY "time" ASC NULLS LAST, device_id ASC NULLS LAST, v0 ASC NULLS LAST, v1 ASC NULLS LAST, v2 ASC NULLS LAST, v3 ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY "time" ASC NULLS LAST, device_id ASC NULLS LAST, v0 ASC NULLS LAST, v1 ASC NULLS LAST, v2 ASC NULLS LAST, v3 ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_3 Output: metrics_dist_3."time", metrics_dist_3.device_id, metrics_dist_3.v0, metrics_dist_3.v1, metrics_dist_3.v2, metrics_dist_3.v3 Data node: data_node_3 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY "time" ASC NULLS LAST, device_id ASC NULLS LAST, v0 ASC NULLS LAST, v1 ASC NULLS LAST, v2 ASC NULLS LAST, v3 ASC NULLS LAST + Remote SQL: SELECT DISTINCT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY "time" ASC NULLS LAST, device_id ASC NULLS LAST, v0 ASC NULLS LAST, v1 ASC NULLS LAST, v2 ASC NULLS LAST, v3 ASC NULLS LAST (23 rows) SELECT DISTINCT ON (expr) handles whole row correctly @@ -816,17 +816,17 @@ QUERY PLAN Output: metrics_dist_1."time", metrics_dist_1.device_id, metrics_dist_1.v0, metrics_dist_1.v1, metrics_dist_1.v2, metrics_dist_1.v3 Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT ON (device_id) "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device_id) "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_2 Output: metrics_dist_2."time", metrics_dist_2.device_id, metrics_dist_2.v0, metrics_dist_2.v1, metrics_dist_2.v2, metrics_dist_2.v3 Data node: data_node_2 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT ON (device_id) "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device_id) "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_3 Output: metrics_dist_3."time", metrics_dist_3.device_id, metrics_dist_3.v0, metrics_dist_3.v1, metrics_dist_3.v2, metrics_dist_3.v3 Data node: data_node_3 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT ON (device_id) "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST + Remote SQL: SELECT DISTINCT ON (device_id) "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY device_id ASC NULLS LAST, "time" ASC NULLS LAST (23 rows) SELECT DISTINCT RECORD works correctly @@ -851,17 +851,17 @@ QUERY PLAN Output: metrics_dist_1.* Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) + Remote SQL: SELECT DISTINCT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_2 Output: metrics_dist_2.* Data node: data_node_2 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) + Remote SQL: SELECT DISTINCT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_3 Output: metrics_dist_3.* Data node: data_node_3 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) + Remote SQL: SELECT DISTINCT "time", device_id, v0, v1, v2, v3 FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) (25 rows) RESET enable_hashagg; @@ -886,21 +886,21 @@ QUERY PLAN Output: metrics_dist_1."time" Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT "time" FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY public.time_bucket('01:00:00'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT "time" FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY public.time_bucket('01:00:00'::interval, "time") ASC NULLS LAST -> Result Output: time_bucket('@ 1 hour'::interval, metrics_dist_2."time") -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_2 Output: metrics_dist_2."time" Data node: data_node_2 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT "time" FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY public.time_bucket('01:00:00'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT "time" FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY public.time_bucket('01:00:00'::interval, "time") ASC NULLS LAST -> Result Output: time_bucket('@ 1 hour'::interval, metrics_dist_3."time") -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_3 Output: metrics_dist_3."time" Data node: data_node_3 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT "time" FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY public.time_bucket('01:00:00'::interval, "time") ASC NULLS LAST + Remote SQL: SELECT "time" FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) ORDER BY public.time_bucket('01:00:00'::interval, "time") ASC NULLS LAST (29 rows) SELECT DISTINCT without any var references is handled correctly @@ -918,19 +918,19 @@ QUERY PLAN -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_1 Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT NULL FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) + Remote SQL: SELECT NULL FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) -> Result Output: 1, 'constx'::text -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_2 Data node: data_node_2 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT NULL FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) + Remote SQL: SELECT NULL FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) -> Result Output: 1, 'constx'::text -> Custom Scan (DataNodeScan) on public.metrics_dist metrics_dist_3 Data node: data_node_3 Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT NULL FROM public.metrics_dist WHERE _timescaledb_internal.chunks_in(public.metrics_dist.*, ARRAY[..]) + Remote SQL: SELECT NULL FROM public.metrics_dist WHERE _timescaledb_functions.chunks_in(public.metrics_dist.*, ARRAY[..]) (23 rows) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/tsl/test/shared/expected/dist_distinct_pushdown.out b/tsl/test/shared/expected/dist_distinct_pushdown.out index 9c57d58682d..51866afe03c 100644 --- a/tsl/test/shared/expected/dist_distinct_pushdown.out +++ b/tsl/test/shared/expected/dist_distinct_pushdown.out @@ -43,7 +43,7 @@ QUERY PLAN Output: distinct_on_distributed.ts, distinct_on_distributed.id Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT ON (id) ts, id FROM public.distinct_on_distributed WHERE _timescaledb_internal.chunks_in(public.distinct_on_distributed.*, ARRAY[..]) ORDER BY id ASC NULLS LAST, ts DESC NULLS FIRST + Remote SQL: SELECT DISTINCT ON (id) ts, id FROM public.distinct_on_distributed WHERE _timescaledb_functions.chunks_in(public.distinct_on_distributed.*, ARRAY[..]) ORDER BY id ASC NULLS LAST, ts DESC NULLS FIRST (7 rows) -- A case where we have a filter on the DISTINCT ON column. @@ -63,7 +63,7 @@ QUERY PLAN Output: distinct_on_distributed.ts, distinct_on_distributed.id Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT ON (id) ts, id FROM public.distinct_on_distributed WHERE _timescaledb_internal.chunks_in(public.distinct_on_distributed.*, ARRAY[..]) AND ((id = ANY ('{0,1}'::integer[]))) ORDER BY id ASC NULLS LAST, ts DESC NULLS FIRST + Remote SQL: SELECT DISTINCT ON (id) ts, id FROM public.distinct_on_distributed WHERE _timescaledb_functions.chunks_in(public.distinct_on_distributed.*, ARRAY[..]) AND ((id = ANY ('{0,1}'::integer[]))) ORDER BY id ASC NULLS LAST, ts DESC NULLS FIRST (7 rows) -- A somewhat dumb case where the DISTINCT ON column is deduced to be constant @@ -86,7 +86,7 @@ QUERY PLAN Output: distinct_on_distributed.ts, distinct_on_distributed.id Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk - Remote SQL: SELECT ts, id FROM public.distinct_on_distributed WHERE _timescaledb_internal.chunks_in(public.distinct_on_distributed.*, ARRAY[..]) AND ((id = 0)) + Remote SQL: SELECT ts, id FROM public.distinct_on_distributed WHERE _timescaledb_functions.chunks_in(public.distinct_on_distributed.*, ARRAY[..]) AND ((id = 0)) (10 rows) -- All above but with disabled local sort, to try to force more interesting plans where the sort @@ -107,7 +107,7 @@ QUERY PLAN Output: distinct_on_distributed.ts, distinct_on_distributed.id Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk - Remote SQL: SELECT ts, id FROM public.distinct_on_distributed WHERE _timescaledb_internal.chunks_in(public.distinct_on_distributed.*, ARRAY[..]) ORDER BY id ASC NULLS LAST, ts DESC NULLS FIRST LIMIT 1 + Remote SQL: SELECT ts, id FROM public.distinct_on_distributed WHERE _timescaledb_functions.chunks_in(public.distinct_on_distributed.*, ARRAY[..]) ORDER BY id ASC NULLS LAST, ts DESC NULLS FIRST LIMIT 1 (7 rows) select distinct on (id) ts, id from distinct_on_distributed order by id, ts desc; @@ -128,7 +128,7 @@ QUERY PLAN Output: distinct_on_distributed.ts, distinct_on_distributed.id Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT ON (id) ts, id FROM public.distinct_on_distributed WHERE _timescaledb_internal.chunks_in(public.distinct_on_distributed.*, ARRAY[..]) ORDER BY id ASC NULLS LAST, ts DESC NULLS FIRST + Remote SQL: SELECT DISTINCT ON (id) ts, id FROM public.distinct_on_distributed WHERE _timescaledb_functions.chunks_in(public.distinct_on_distributed.*, ARRAY[..]) ORDER BY id ASC NULLS LAST, ts DESC NULLS FIRST (7 rows) select distinct on (id) ts, id from distinct_on_distributed where id in ('0', '1') order by id, ts desc; @@ -147,7 +147,7 @@ QUERY PLAN Output: distinct_on_distributed.ts, distinct_on_distributed.id Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk - Remote SQL: SELECT DISTINCT ON (id) ts, id FROM public.distinct_on_distributed WHERE _timescaledb_internal.chunks_in(public.distinct_on_distributed.*, ARRAY[..]) AND ((id = ANY ('{0,1}'::integer[]))) ORDER BY id ASC NULLS LAST, ts DESC NULLS FIRST + Remote SQL: SELECT DISTINCT ON (id) ts, id FROM public.distinct_on_distributed WHERE _timescaledb_functions.chunks_in(public.distinct_on_distributed.*, ARRAY[..]) AND ((id = ANY ('{0,1}'::integer[]))) ORDER BY id ASC NULLS LAST, ts DESC NULLS FIRST (7 rows) select distinct on (id) ts, id from distinct_on_distributed where id in ('0') order by id, ts desc; @@ -165,7 +165,7 @@ QUERY PLAN Output: distinct_on_distributed.ts, distinct_on_distributed.id Data node: data_node_1 Chunks: _dist_hyper_X_X_chunk - Remote SQL: SELECT ts, id FROM public.distinct_on_distributed WHERE _timescaledb_internal.chunks_in(public.distinct_on_distributed.*, ARRAY[..]) AND ((id = 0)) ORDER BY ts DESC NULLS FIRST + Remote SQL: SELECT ts, id FROM public.distinct_on_distributed WHERE _timescaledb_functions.chunks_in(public.distinct_on_distributed.*, ARRAY[..]) AND ((id = 0)) ORDER BY ts DESC NULLS FIRST (7 rows) reset enable_sort; diff --git a/tsl/test/shared/expected/dist_fetcher_type-13.out b/tsl/test/shared/expected/dist_fetcher_type-13.out index 593cafa7a4d..b7bcc8f1289 100644 --- a/tsl/test/shared/expected/dist_fetcher_type-13.out +++ b/tsl/test/shared/expected/dist_fetcher_type-13.out @@ -29,7 +29,7 @@ QUERY PLAN Data node: data_node_1 Fetcher Type: COPY Chunks: _dist_hyper_X_X_chunk - Remote SQL: SELECT NULL FROM public.distinct_on_distributed WHERE _timescaledb_internal.chunks_in(public.distinct_on_distributed.*, ARRAY[..]) LIMIT 1 + Remote SQL: SELECT NULL FROM public.distinct_on_distributed WHERE _timescaledb_functions.chunks_in(public.distinct_on_distributed.*, ARRAY[..]) LIMIT 1 (8 rows) set timescaledb.remote_data_fetcher = 'cursor'; @@ -55,7 +55,7 @@ QUERY PLAN Data node: data_node_1 Fetcher Type: Cursor Chunks: _dist_hyper_X_X_chunk - Remote SQL: SELECT id FROM public.distinct_on_distributed WHERE _timescaledb_internal.chunks_in(public.distinct_on_distributed.*, ARRAY[..]) + Remote SQL: SELECT id FROM public.distinct_on_distributed WHERE _timescaledb_functions.chunks_in(public.distinct_on_distributed.*, ARRAY[..]) -> Materialize (actual rows=1 loops=1) Output: t2.id -> Custom Scan (DataNodeScan) on public.distinct_on_distributed t2 (actual rows=1 loops=1) @@ -63,7 +63,7 @@ QUERY PLAN Data node: data_node_1 Fetcher Type: Cursor Chunks: _dist_hyper_X_X_chunk - Remote SQL: SELECT id FROM public.distinct_on_distributed WHERE _timescaledb_internal.chunks_in(public.distinct_on_distributed.*, ARRAY[..]) + Remote SQL: SELECT id FROM public.distinct_on_distributed WHERE _timescaledb_functions.chunks_in(public.distinct_on_distributed.*, ARRAY[..]) (19 rows) -- This query can't work with copy or prepared fetcher. @@ -132,7 +132,7 @@ QUERY PLAN Data node: data_node_2 Fetcher Type: Cursor Chunks: _dist_hyper_X_X_chunk - Remote SQL: SELECT "time", txn_id, val, info FROM public.disttable_with_ct WHERE _timescaledb_internal.chunks_in(public.disttable_with_ct.*, ARRAY[..]) + Remote SQL: SELECT "time", txn_id, val, info FROM public.disttable_with_ct WHERE _timescaledb_functions.chunks_in(public.disttable_with_ct.*, ARRAY[..]) (6 rows) -- COPY fetcher with bytea data @@ -145,7 +145,7 @@ QUERY PLAN Data node: data_node_3 Fetcher Type: COPY Chunks: _dist_hyper_X_X_chunk - Remote SQL: SELECT "time", bdata FROM public.disttable_with_bytea WHERE _timescaledb_internal.chunks_in(public.disttable_with_bytea.*, ARRAY[..]) + Remote SQL: SELECT "time", bdata FROM public.disttable_with_bytea WHERE _timescaledb_functions.chunks_in(public.disttable_with_bytea.*, ARRAY[..]) (6 rows) select * from disttable_with_bytea; @@ -165,7 +165,7 @@ QUERY PLAN Data node: data_node_3 Fetcher Type: Cursor Chunks: _dist_hyper_X_X_chunk - Remote SQL: SELECT "time", bdata FROM public.disttable_with_bytea WHERE _timescaledb_internal.chunks_in(public.disttable_with_bytea.*, ARRAY[..]) + Remote SQL: SELECT "time", bdata FROM public.disttable_with_bytea WHERE _timescaledb_functions.chunks_in(public.disttable_with_bytea.*, ARRAY[..]) (6 rows) select * from disttable_with_bytea; @@ -185,7 +185,7 @@ QUERY PLAN Data node: data_node_3 Fetcher Type: Prepared statement Chunks: _dist_hyper_X_X_chunk - Remote SQL: SELECT "time", bdata FROM public.disttable_with_bytea WHERE _timescaledb_internal.chunks_in(public.disttable_with_bytea.*, ARRAY[..]) + Remote SQL: SELECT "time", bdata FROM public.disttable_with_bytea WHERE _timescaledb_functions.chunks_in(public.disttable_with_bytea.*, ARRAY[..]) (6 rows) select * from disttable_with_bytea; diff --git a/tsl/test/shared/expected/dist_fetcher_type-14.out b/tsl/test/shared/expected/dist_fetcher_type-14.out index 593cafa7a4d..b7bcc8f1289 100644 --- a/tsl/test/shared/expected/dist_fetcher_type-14.out +++ b/tsl/test/shared/expected/dist_fetcher_type-14.out @@ -29,7 +29,7 @@ QUERY PLAN Data node: data_node_1 Fetcher Type: COPY Chunks: _dist_hyper_X_X_chunk - Remote SQL: SELECT NULL FROM public.distinct_on_distributed WHERE _timescaledb_internal.chunks_in(public.distinct_on_distributed.*, ARRAY[..]) LIMIT 1 + Remote SQL: SELECT NULL FROM public.distinct_on_distributed WHERE _timescaledb_functions.chunks_in(public.distinct_on_distributed.*, ARRAY[..]) LIMIT 1 (8 rows) set timescaledb.remote_data_fetcher = 'cursor'; @@ -55,7 +55,7 @@ QUERY PLAN Data node: data_node_1 Fetcher Type: Cursor Chunks: _dist_hyper_X_X_chunk - Remote SQL: SELECT id FROM public.distinct_on_distributed WHERE _timescaledb_internal.chunks_in(public.distinct_on_distributed.*, ARRAY[..]) + Remote SQL: SELECT id FROM public.distinct_on_distributed WHERE _timescaledb_functions.chunks_in(public.distinct_on_distributed.*, ARRAY[..]) -> Materialize (actual rows=1 loops=1) Output: t2.id -> Custom Scan (DataNodeScan) on public.distinct_on_distributed t2 (actual rows=1 loops=1) @@ -63,7 +63,7 @@ QUERY PLAN Data node: data_node_1 Fetcher Type: Cursor Chunks: _dist_hyper_X_X_chunk - Remote SQL: SELECT id FROM public.distinct_on_distributed WHERE _timescaledb_internal.chunks_in(public.distinct_on_distributed.*, ARRAY[..]) + Remote SQL: SELECT id FROM public.distinct_on_distributed WHERE _timescaledb_functions.chunks_in(public.distinct_on_distributed.*, ARRAY[..]) (19 rows) -- This query can't work with copy or prepared fetcher. @@ -132,7 +132,7 @@ QUERY PLAN Data node: data_node_2 Fetcher Type: Cursor Chunks: _dist_hyper_X_X_chunk - Remote SQL: SELECT "time", txn_id, val, info FROM public.disttable_with_ct WHERE _timescaledb_internal.chunks_in(public.disttable_with_ct.*, ARRAY[..]) + Remote SQL: SELECT "time", txn_id, val, info FROM public.disttable_with_ct WHERE _timescaledb_functions.chunks_in(public.disttable_with_ct.*, ARRAY[..]) (6 rows) -- COPY fetcher with bytea data @@ -145,7 +145,7 @@ QUERY PLAN Data node: data_node_3 Fetcher Type: COPY Chunks: _dist_hyper_X_X_chunk - Remote SQL: SELECT "time", bdata FROM public.disttable_with_bytea WHERE _timescaledb_internal.chunks_in(public.disttable_with_bytea.*, ARRAY[..]) + Remote SQL: SELECT "time", bdata FROM public.disttable_with_bytea WHERE _timescaledb_functions.chunks_in(public.disttable_with_bytea.*, ARRAY[..]) (6 rows) select * from disttable_with_bytea; @@ -165,7 +165,7 @@ QUERY PLAN Data node: data_node_3 Fetcher Type: Cursor Chunks: _dist_hyper_X_X_chunk - Remote SQL: SELECT "time", bdata FROM public.disttable_with_bytea WHERE _timescaledb_internal.chunks_in(public.disttable_with_bytea.*, ARRAY[..]) + Remote SQL: SELECT "time", bdata FROM public.disttable_with_bytea WHERE _timescaledb_functions.chunks_in(public.disttable_with_bytea.*, ARRAY[..]) (6 rows) select * from disttable_with_bytea; @@ -185,7 +185,7 @@ QUERY PLAN Data node: data_node_3 Fetcher Type: Prepared statement Chunks: _dist_hyper_X_X_chunk - Remote SQL: SELECT "time", bdata FROM public.disttable_with_bytea WHERE _timescaledb_internal.chunks_in(public.disttable_with_bytea.*, ARRAY[..]) + Remote SQL: SELECT "time", bdata FROM public.disttable_with_bytea WHERE _timescaledb_functions.chunks_in(public.disttable_with_bytea.*, ARRAY[..]) (6 rows) select * from disttable_with_bytea; diff --git a/tsl/test/shared/expected/dist_fetcher_type-15.out b/tsl/test/shared/expected/dist_fetcher_type-15.out index 7bce2201619..cd18175d29f 100644 --- a/tsl/test/shared/expected/dist_fetcher_type-15.out +++ b/tsl/test/shared/expected/dist_fetcher_type-15.out @@ -30,7 +30,7 @@ QUERY PLAN Data node: data_node_1 Fetcher Type: COPY Chunks: _dist_hyper_X_X_chunk - Remote SQL: SELECT NULL FROM public.distinct_on_distributed WHERE _timescaledb_internal.chunks_in(public.distinct_on_distributed.*, ARRAY[..]) LIMIT 1 + Remote SQL: SELECT NULL FROM public.distinct_on_distributed WHERE _timescaledb_functions.chunks_in(public.distinct_on_distributed.*, ARRAY[..]) LIMIT 1 (9 rows) set timescaledb.remote_data_fetcher = 'cursor'; @@ -56,7 +56,7 @@ QUERY PLAN Data node: data_node_1 Fetcher Type: Cursor Chunks: _dist_hyper_X_X_chunk - Remote SQL: SELECT id FROM public.distinct_on_distributed WHERE _timescaledb_internal.chunks_in(public.distinct_on_distributed.*, ARRAY[..]) + Remote SQL: SELECT id FROM public.distinct_on_distributed WHERE _timescaledb_functions.chunks_in(public.distinct_on_distributed.*, ARRAY[..]) -> Materialize (actual rows=1 loops=1) Output: t2.id -> Custom Scan (DataNodeScan) on public.distinct_on_distributed t2 (actual rows=1 loops=1) @@ -64,7 +64,7 @@ QUERY PLAN Data node: data_node_1 Fetcher Type: Cursor Chunks: _dist_hyper_X_X_chunk - Remote SQL: SELECT id FROM public.distinct_on_distributed WHERE _timescaledb_internal.chunks_in(public.distinct_on_distributed.*, ARRAY[..]) + Remote SQL: SELECT id FROM public.distinct_on_distributed WHERE _timescaledb_functions.chunks_in(public.distinct_on_distributed.*, ARRAY[..]) (19 rows) -- This query can't work with copy or prepared fetcher. @@ -133,7 +133,7 @@ QUERY PLAN Data node: data_node_2 Fetcher Type: Cursor Chunks: _dist_hyper_X_X_chunk - Remote SQL: SELECT "time", txn_id, val, info FROM public.disttable_with_ct WHERE _timescaledb_internal.chunks_in(public.disttable_with_ct.*, ARRAY[..]) + Remote SQL: SELECT "time", txn_id, val, info FROM public.disttable_with_ct WHERE _timescaledb_functions.chunks_in(public.disttable_with_ct.*, ARRAY[..]) (6 rows) -- COPY fetcher with bytea data @@ -146,7 +146,7 @@ QUERY PLAN Data node: data_node_3 Fetcher Type: COPY Chunks: _dist_hyper_X_X_chunk - Remote SQL: SELECT "time", bdata FROM public.disttable_with_bytea WHERE _timescaledb_internal.chunks_in(public.disttable_with_bytea.*, ARRAY[..]) + Remote SQL: SELECT "time", bdata FROM public.disttable_with_bytea WHERE _timescaledb_functions.chunks_in(public.disttable_with_bytea.*, ARRAY[..]) (6 rows) select * from disttable_with_bytea; @@ -166,7 +166,7 @@ QUERY PLAN Data node: data_node_3 Fetcher Type: Cursor Chunks: _dist_hyper_X_X_chunk - Remote SQL: SELECT "time", bdata FROM public.disttable_with_bytea WHERE _timescaledb_internal.chunks_in(public.disttable_with_bytea.*, ARRAY[..]) + Remote SQL: SELECT "time", bdata FROM public.disttable_with_bytea WHERE _timescaledb_functions.chunks_in(public.disttable_with_bytea.*, ARRAY[..]) (6 rows) select * from disttable_with_bytea; @@ -186,7 +186,7 @@ QUERY PLAN Data node: data_node_3 Fetcher Type: Prepared statement Chunks: _dist_hyper_X_X_chunk - Remote SQL: SELECT "time", bdata FROM public.disttable_with_bytea WHERE _timescaledb_internal.chunks_in(public.disttable_with_bytea.*, ARRAY[..]) + Remote SQL: SELECT "time", bdata FROM public.disttable_with_bytea WHERE _timescaledb_functions.chunks_in(public.disttable_with_bytea.*, ARRAY[..]) (6 rows) select * from disttable_with_bytea; diff --git a/tsl/test/shared/expected/dist_parallel_agg.out b/tsl/test/shared/expected/dist_parallel_agg.out index 6b44b1cd051..99ae493ee7c 100644 --- a/tsl/test/shared/expected/dist_parallel_agg.out +++ b/tsl/test/shared/expected/dist_parallel_agg.out @@ -41,7 +41,7 @@ QUERY PLAN Data node: data_node_1 Fetcher Type: COPY Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT count(*) FROM public.metrics_dist1 WHERE _timescaledb_internal.chunks_in(public.metrics_dist1.*, ARRAY[..]) + Remote SQL: SELECT count(*) FROM public.metrics_dist1 WHERE _timescaledb_functions.chunks_in(public.metrics_dist1.*, ARRAY[..]) Remote EXPLAIN: Finalize Aggregate (actual rows=1 loops=1) Output: count(*) @@ -68,7 +68,7 @@ QUERY PLAN Data node: data_node_1 Fetcher Type: COPY Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT public.ts_debug_shippable_safe_count(*) FROM public.metrics_dist1 WHERE _timescaledb_internal.chunks_in(public.metrics_dist1.*, ARRAY[..]) + Remote SQL: SELECT public.ts_debug_shippable_safe_count(*) FROM public.metrics_dist1 WHERE _timescaledb_functions.chunks_in(public.metrics_dist1.*, ARRAY[..]) Remote EXPLAIN: Finalize Aggregate (actual rows=1 loops=1) Output: public.ts_debug_shippable_safe_count(*) @@ -95,7 +95,7 @@ QUERY PLAN Data node: data_node_1 Fetcher Type: COPY Chunks: _dist_hyper_X_X_chunk, _dist_hyper_X_X_chunk - Remote SQL: SELECT public.ts_debug_shippable_unsafe_count(*) FROM public.metrics_dist1 WHERE _timescaledb_internal.chunks_in(public.metrics_dist1.*, ARRAY[..]) + Remote SQL: SELECT public.ts_debug_shippable_unsafe_count(*) FROM public.metrics_dist1 WHERE _timescaledb_functions.chunks_in(public.metrics_dist1.*, ARRAY[..]) Remote EXPLAIN: Aggregate (actual rows=1 loops=1) Output: public.ts_debug_shippable_unsafe_count(*) diff --git a/tsl/test/shared/expected/extension.out b/tsl/test/shared/expected/extension.out index 3b2292cf6d3..e41f7f20b6a 100644 --- a/tsl/test/shared/expected/extension.out +++ b/tsl/test/shared/expected/extension.out @@ -19,9 +19,14 @@ FROM pg_proc p e.oid = d.refobjid WHERE proname <> 'get_telemetry_report' ORDER BY pronamespace::regnamespace::text COLLATE "C", p.oid::regprocedure::text COLLATE "C"; + _timescaledb_functions.attach_osm_table_chunk(regclass,regclass) _timescaledb_functions.bookend_deserializefunc(bytea,internal) _timescaledb_functions.bookend_finalfunc(internal,anyelement,"any") _timescaledb_functions.bookend_serializefunc(internal) + _timescaledb_functions.calculate_chunk_interval(integer,bigint,bigint) + _timescaledb_functions.chunk_id_from_relid(oid) + _timescaledb_functions.chunk_status(regclass) + _timescaledb_functions.chunks_in(record,integer[]) _timescaledb_functions.chunks_local_size(name,name) _timescaledb_functions.chunks_remote_size(name,name) _timescaledb_functions.compressed_chunk_local_stats(name,name) @@ -31,15 +36,21 @@ ORDER BY pronamespace::regnamespace::text COLLATE "C", p.oid::regprocedure::text _timescaledb_functions.compressed_data_recv(internal) _timescaledb_functions.compressed_data_send(_timescaledb_internal.compressed_data) _timescaledb_functions.continuous_agg_invalidation_trigger() + _timescaledb_functions.create_chunk(regclass,jsonb,name,name,regclass) + _timescaledb_functions.create_chunk_table(regclass,jsonb,name,name) _timescaledb_functions.data_node_chunk_info(name,name,name) _timescaledb_functions.data_node_compressed_chunk_stats(name,name,name) _timescaledb_functions.data_node_hypertable_info(name,name,name) _timescaledb_functions.data_node_index_size(name,name,name) + _timescaledb_functions.drop_chunk(regclass) _timescaledb_functions.drop_dist_ht_invalidation_trigger(integer) _timescaledb_functions.first_combinefunc(internal,internal) _timescaledb_functions.first_sfunc(internal,anyelement,"any") + _timescaledb_functions.freeze_chunk(regclass) _timescaledb_functions.generate_uuid() _timescaledb_functions.get_approx_row_count(regclass) + _timescaledb_functions.get_chunk_colstats(regclass) + _timescaledb_functions.get_chunk_relstats(regclass) _timescaledb_functions.get_create_command(name) _timescaledb_functions.get_git_commit() _timescaledb_functions.get_os_info() @@ -62,8 +73,10 @@ ORDER BY pronamespace::regnamespace::text COLLATE "C", p.oid::regprocedure::text _timescaledb_functions.remote_txn_heal_data_node(oid) _timescaledb_functions.rxid_in(cstring) _timescaledb_functions.rxid_out(rxid) + _timescaledb_functions.set_chunk_default_data_node(regclass,name) _timescaledb_functions.set_dist_id(uuid) _timescaledb_functions.set_peer_dist_id(uuid) + _timescaledb_functions.show_chunk(regclass) _timescaledb_functions.show_connection_cache() _timescaledb_functions.subtract_integer_from_now(regclass,bigint) _timescaledb_functions.time_to_internal(anyelement) @@ -73,9 +86,9 @@ ORDER BY pronamespace::regnamespace::text COLLATE "C", p.oid::regprocedure::text _timescaledb_functions.to_timestamp_without_timezone(bigint) _timescaledb_functions.to_unix_microseconds(timestamp with time zone) _timescaledb_functions.tsl_loaded() + _timescaledb_functions.unfreeze_chunk(regclass) _timescaledb_functions.validate_as_data_node() _timescaledb_internal.alter_job_set_hypertable_id(integer,regclass) - _timescaledb_internal.attach_osm_table_chunk(regclass,regclass) _timescaledb_internal.cagg_migrate_create_plan(_timescaledb_catalog.continuous_agg,text,boolean,boolean) _timescaledb_internal.cagg_migrate_execute_copy_data(_timescaledb_catalog.continuous_agg,_timescaledb_catalog.continuous_agg_migrate_plan_step) _timescaledb_internal.cagg_migrate_execute_copy_policies(_timescaledb_catalog.continuous_agg,_timescaledb_catalog.continuous_agg_migrate_plan_step) @@ -90,26 +103,16 @@ ORDER BY pronamespace::regnamespace::text COLLATE "C", p.oid::regprocedure::text _timescaledb_internal.cagg_migrate_pre_validation(text,text,text) _timescaledb_internal.cagg_watermark(integer) _timescaledb_internal.cagg_watermark_materialized(integer) - _timescaledb_internal.calculate_chunk_interval(integer,bigint,bigint) _timescaledb_internal.chunk_constraint_add_table_constraint(_timescaledb_catalog.chunk_constraint) _timescaledb_internal.chunk_drop_replica(regclass,name) - _timescaledb_internal.chunk_id_from_relid(oid) _timescaledb_internal.chunk_index_clone(oid) _timescaledb_internal.chunk_index_replace(oid,oid) - _timescaledb_internal.chunk_status(regclass) - _timescaledb_internal.chunks_in(record,integer[]) - _timescaledb_internal.create_chunk(regclass,jsonb,name,name,regclass) _timescaledb_internal.create_chunk_replica_table(regclass,name) - _timescaledb_internal.create_chunk_table(regclass,jsonb,name,name) _timescaledb_internal.create_compressed_chunk(regclass,regclass,bigint,bigint,bigint,bigint,bigint,bigint,bigint,bigint) - _timescaledb_internal.drop_chunk(regclass) _timescaledb_internal.drop_stale_chunks(name,integer[]) _timescaledb_internal.finalize_agg(text,name,name,name[],bytea,anyelement) _timescaledb_internal.finalize_agg_ffunc(internal,text,name,name,name[],bytea,anyelement) _timescaledb_internal.finalize_agg_sfunc(internal,text,name,name,name[],bytea,anyelement) - _timescaledb_internal.freeze_chunk(regclass) - _timescaledb_internal.get_chunk_colstats(regclass) - _timescaledb_internal.get_chunk_relstats(regclass) _timescaledb_internal.get_compressed_chunk_index_for_recompression(regclass) _timescaledb_internal.get_partition_for_key(anyelement) _timescaledb_internal.get_partition_hash(anyelement) @@ -139,11 +142,8 @@ ORDER BY pronamespace::regnamespace::text COLLATE "C", p.oid::regprocedure::text _timescaledb_internal.process_ddl_event() _timescaledb_internal.recompress_chunk_segmentwise(regclass,boolean) _timescaledb_internal.restart_background_workers() - _timescaledb_internal.set_chunk_default_data_node(regclass,name) - _timescaledb_internal.show_chunk(regclass) _timescaledb_internal.start_background_workers() _timescaledb_internal.stop_background_workers() - _timescaledb_internal.unfreeze_chunk(regclass) _timescaledb_internal.wait_subscription_sync(name,name,integer,numeric) debug_waitpoint_enable(text) debug_waitpoint_id(text) diff --git a/tsl/test/sql/chunk_api.sql b/tsl/test/sql/chunk_api.sql index bf68644812f..be23adb53dc 100644 --- a/tsl/test/sql/chunk_api.sql +++ b/tsl/test/sql/chunk_api.sql @@ -18,58 +18,58 @@ SELECT * FROM create_hypertable('chunkapi', 'time', 'device', 2); INSERT INTO chunkapi VALUES ('2018-01-01 05:00:00-8', 1, 23.4, int8range(4, 10)); -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('chunkapi') ORDER BY chunk_id; -- Creating a chunk with the constraints of an existing chunk should -- return the existing chunk -SELECT * FROM _timescaledb_internal.create_chunk('chunkapi',' {"time": [1514419200000000, 1515024000000000], "device": [-9223372036854775808, 1073741823]}'); +SELECT * FROM _timescaledb_functions.create_chunk('chunkapi',' {"time": [1514419200000000, 1515024000000000], "device": [-9223372036854775808, 1073741823]}'); \set VERBOSITY default \set ON_ERROR_STOP 0 -- Modified time constraint should fail with collision -SELECT * FROM _timescaledb_internal.create_chunk('chunkapi',' {"time": [1514419600000000, 1515024000000000], "device": [-9223372036854775808, 1073741823]}'); +SELECT * FROM _timescaledb_functions.create_chunk('chunkapi',' {"time": [1514419600000000, 1515024000000000], "device": [-9223372036854775808, 1073741823]}'); -- Missing dimension -SELECT * FROM _timescaledb_internal.create_chunk('chunkapi',' {"time": [1514419600000000, 1515024000000000]}'); +SELECT * FROM _timescaledb_functions.create_chunk('chunkapi',' {"time": [1514419600000000, 1515024000000000]}'); -- Extra dimension -SELECT * FROM _timescaledb_internal.create_chunk('chunkapi',' {"time": [1514419600000000, 1515024000000000], "device": [-9223372036854775808, 1073741823], "time2": [1514419600000000, 1515024000000000]}'); +SELECT * FROM _timescaledb_functions.create_chunk('chunkapi',' {"time": [1514419600000000, 1515024000000000], "device": [-9223372036854775808, 1073741823], "time2": [1514419600000000, 1515024000000000]}'); -- Bad dimension name -SELECT * FROM _timescaledb_internal.create_chunk('chunkapi',' {"time": [1514419600000000, 1515024000000000], "dev": [-9223372036854775808, 1073741823]}'); +SELECT * FROM _timescaledb_functions.create_chunk('chunkapi',' {"time": [1514419600000000, 1515024000000000], "dev": [-9223372036854775808, 1073741823]}'); -- Same dimension twice -SELECT * FROM _timescaledb_internal.create_chunk('chunkapi',' {"time": [1514419600000000, 1515024000000000], "time": [1514419600000000, 1515024000000000]}'); +SELECT * FROM _timescaledb_functions.create_chunk('chunkapi',' {"time": [1514419600000000, 1515024000000000], "time": [1514419600000000, 1515024000000000]}'); -- Bad bounds format -SELECT * FROM _timescaledb_internal.create_chunk('chunkapi',' {"time": ["1514419200000000", 1515024000000000], "device": [-9223372036854775808, 1073741823]}'); +SELECT * FROM _timescaledb_functions.create_chunk('chunkapi',' {"time": ["1514419200000000", 1515024000000000], "device": [-9223372036854775808, 1073741823]}'); -- Bad slices format -SELECT * FROM _timescaledb_internal.create_chunk('chunkapi',' {"time": [1515024000000000], "device": [-9223372036854775808, 1073741823]}'); +SELECT * FROM _timescaledb_functions.create_chunk('chunkapi',' {"time": [1515024000000000], "device": [-9223372036854775808, 1073741823]}'); -- Bad slices json -SELECT * FROM _timescaledb_internal.create_chunk('chunkapi',' {"time: [1515024000000000] "device": [-9223372036854775808, 1073741823]}'); +SELECT * FROM _timescaledb_functions.create_chunk('chunkapi',' {"time: [1515024000000000] "device": [-9223372036854775808, 1073741823]}'); \set ON_ERROR_STOP 1 SET ROLE :ROLE_DEFAULT_PERM_USER; -- Test create_chunk_table for errors \set ON_ERROR_STOP 0 -- Test create_chunk_table for NULL input -SELECT * FROM _timescaledb_internal.create_chunk_table(NULL,' {"time": [1515024000000000, 1519024000000000], "device": [-9223372036854775808, 1073741823]}', '_timescaledb_internal','_hyper_1_1_chunk'); -SELECT * FROM _timescaledb_internal.create_chunk_table('chunkapi', NULL, '_timescaledb_internal','_hyper_1_1_chunk'); -SELECT * FROM _timescaledb_internal.create_chunk_table('chunkapi',' {"time": [1515024000000000, 1519024000000000], "device": [-9223372036854775808, 1073741823]}', NULL,'_hyper_1_1_chunk'); -SELECT * FROM _timescaledb_internal.create_chunk_table('chunkapi',' {"time": [1515024000000000, 1519024000000000], "device": [-9223372036854775808, 1073741823]}', '_timescaledb_internal',NULL); +SELECT * FROM _timescaledb_functions.create_chunk_table(NULL,' {"time": [1515024000000000, 1519024000000000], "device": [-9223372036854775808, 1073741823]}', '_timescaledb_internal','_hyper_1_1_chunk'); +SELECT * FROM _timescaledb_functions.create_chunk_table('chunkapi', NULL, '_timescaledb_internal','_hyper_1_1_chunk'); +SELECT * FROM _timescaledb_functions.create_chunk_table('chunkapi',' {"time": [1515024000000000, 1519024000000000], "device": [-9223372036854775808, 1073741823]}', NULL,'_hyper_1_1_chunk'); +SELECT * FROM _timescaledb_functions.create_chunk_table('chunkapi',' {"time": [1515024000000000, 1519024000000000], "device": [-9223372036854775808, 1073741823]}', '_timescaledb_internal',NULL); -- Modified time constraint should fail with collision -SELECT * FROM _timescaledb_internal.create_chunk_table('chunkapi',' {"time": [1514419600000000, 1515024000000000], "device": [-9223372036854775808, 1073741823]}', '_timescaledb_internal','_hyper_1_1_chunk'); +SELECT * FROM _timescaledb_functions.create_chunk_table('chunkapi',' {"time": [1514419600000000, 1515024000000000], "device": [-9223372036854775808, 1073741823]}', '_timescaledb_internal','_hyper_1_1_chunk'); -- Missing dimension -SELECT * FROM _timescaledb_internal.create_chunk_table('chunkapi',' {"time": [1514419600000000, 1515024000000000]}', '_timescaledb_internal','_hyper_1_1_chunk'); +SELECT * FROM _timescaledb_functions.create_chunk_table('chunkapi',' {"time": [1514419600000000, 1515024000000000]}', '_timescaledb_internal','_hyper_1_1_chunk'); -- Extra dimension -SELECT * FROM _timescaledb_internal.create_chunk_table('chunkapi',' {"time": [1514419600000000, 1515024000000000], "device": [-9223372036854775808, 1073741823], "time2": [1514419600000000, 1515024000000000]}', '_timescaledb_internal','_hyper_1_1_chunk'); +SELECT * FROM _timescaledb_functions.create_chunk_table('chunkapi',' {"time": [1514419600000000, 1515024000000000], "device": [-9223372036854775808, 1073741823], "time2": [1514419600000000, 1515024000000000]}', '_timescaledb_internal','_hyper_1_1_chunk'); -- Bad dimension name -SELECT * FROM _timescaledb_internal.create_chunk_table('chunkapi',' {"time": [1514419600000000, 1515024000000000], "dev": [-9223372036854775808, 1073741823]}', '_timescaledb_internal','_hyper_1_1_chunk'); +SELECT * FROM _timescaledb_functions.create_chunk_table('chunkapi',' {"time": [1514419600000000, 1515024000000000], "dev": [-9223372036854775808, 1073741823]}', '_timescaledb_internal','_hyper_1_1_chunk'); -- Same dimension twice -SELECT * FROM _timescaledb_internal.create_chunk_table('chunkapi',' {"time": [1514419600000000, 1515024000000000], "time": [1514419600000000, 1515024000000000]}', '_timescaledb_internal','_hyper_1_1_chunk'); +SELECT * FROM _timescaledb_functions.create_chunk_table('chunkapi',' {"time": [1514419600000000, 1515024000000000], "time": [1514419600000000, 1515024000000000]}', '_timescaledb_internal','_hyper_1_1_chunk'); -- Bad bounds format -SELECT * FROM _timescaledb_internal.create_chunk_table('chunkapi',' {"time": ["1514419200000000", 1515024000000000], "device": [-9223372036854775808, 1073741823]}', '_timescaledb_internal','_hyper_1_1_chunk'); +SELECT * FROM _timescaledb_functions.create_chunk_table('chunkapi',' {"time": ["1514419200000000", 1515024000000000], "device": [-9223372036854775808, 1073741823]}', '_timescaledb_internal','_hyper_1_1_chunk'); -- Bad slices format -SELECT * FROM _timescaledb_internal.create_chunk_table('chunkapi',' {"time": [1515024000000000], "device": [-9223372036854775808, 1073741823]}', '_timescaledb_internal','_hyper_1_1_chunk'); +SELECT * FROM _timescaledb_functions.create_chunk_table('chunkapi',' {"time": [1515024000000000], "device": [-9223372036854775808, 1073741823]}', '_timescaledb_internal','_hyper_1_1_chunk'); -- Bad slices json -SELECT * FROM _timescaledb_internal.create_chunk_table('chunkapi',' {"time: [1515024000000000] "device": [-9223372036854775808, 1073741823]}', '_timescaledb_internal','_hyper_1_1_chunk'); +SELECT * FROM _timescaledb_functions.create_chunk_table('chunkapi',' {"time: [1515024000000000] "device": [-9223372036854775808, 1073741823]}', '_timescaledb_internal','_hyper_1_1_chunk'); \set ON_ERROR_STOP 1 -- Test that granting insert on tables allow create_chunk to be @@ -78,13 +78,13 @@ SELECT * FROM _timescaledb_internal.create_chunk_table('chunkapi',' {"time: [151 SET ROLE :ROLE_SUPERUSER; GRANT INSERT ON chunkapi TO :ROLE_DEFAULT_PERM_USER_2; SET ROLE :ROLE_DEFAULT_PERM_USER_2; -SELECT * FROM _timescaledb_internal.create_chunk('chunkapi',' {"time": [1515024000000000, 1519024000000000], "device": [-9223372036854775808, 1073741823]}', 'ChunkSchema', 'My_chunk_Table_name'); +SELECT * FROM _timescaledb_functions.create_chunk('chunkapi',' {"time": [1515024000000000, 1519024000000000], "device": [-9223372036854775808, 1073741823]}', 'ChunkSchema', 'My_chunk_Table_name'); SET ROLE :ROLE_DEFAULT_PERM_USER; \set VERBOSITY terse -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('chunkapi') ORDER BY chunk_id; @@ -98,42 +98,42 @@ SELECT setseed(1); -- Test getting relation stats for chunks. First get stats -- chunk-by-chunk. Note that the table isn't ANALYZED, so no stats -- present yet. -SELECT (_timescaledb_internal.get_chunk_relstats(show_chunks)).* +SELECT (_timescaledb_functions.get_chunk_relstats(show_chunks)).* FROM show_chunks('chunkapi') ORDER BY chunk_id; -SELECT (_timescaledb_internal.get_chunk_colstats(show_chunks)).* +SELECT (_timescaledb_functions.get_chunk_colstats(show_chunks)).* FROM show_chunks('chunkapi') ORDER BY chunk_id; -- Get the same stats but by giving the hypertable as input -SELECT * FROM _timescaledb_internal.get_chunk_relstats('chunkapi'); -SELECT * FROM _timescaledb_internal.get_chunk_colstats('chunkapi'); +SELECT * FROM _timescaledb_functions.get_chunk_relstats('chunkapi'); +SELECT * FROM _timescaledb_functions.get_chunk_colstats('chunkapi'); -- reltuples is -1 on PG14 when no VACUUM/ANALYZE has run yet SELECT relname, CASE WHEN reltuples > 0 THEN reltuples ELSE 0 END AS reltuples, relpages, relallvisible FROM pg_class WHERE relname IN -(SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name +(SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('chunkapi')) ORDER BY relname; SELECT tablename, attname, inherited, null_frac, avg_width, n_distinct FROM pg_stats WHERE tablename IN -(SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name +(SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('chunkapi')) ORDER BY tablename, attname; -- Show stats after analyze ANALYZE chunkapi; -SELECT * FROM _timescaledb_internal.get_chunk_relstats('chunkapi'); -SELECT * FROM _timescaledb_internal.get_chunk_colstats('chunkapi'); +SELECT * FROM _timescaledb_functions.get_chunk_relstats('chunkapi'); +SELECT * FROM _timescaledb_functions.get_chunk_colstats('chunkapi'); SELECT relname, reltuples, relpages, relallvisible FROM pg_class WHERE relname IN -(SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name +(SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('chunkapi')) ORDER BY relname; SELECT tablename, attname, inherited, null_frac, avg_width, n_distinct FROM pg_stats WHERE tablename IN -(SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name +(SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('chunkapi')) ORDER BY tablename, attname; @@ -163,15 +163,15 @@ INSERT INTO disttable VALUES ('2018-01-01 05:00:00-8', 1, 23.4, 'green'), CALL distributed_exec($$ SELECT setseed(1); $$); -- No stats on the local table -SELECT * FROM _timescaledb_internal.get_chunk_relstats('disttable'); -SELECT * FROM _timescaledb_internal.get_chunk_colstats('disttable'); +SELECT * FROM _timescaledb_functions.get_chunk_relstats('disttable'); +SELECT * FROM _timescaledb_functions.get_chunk_colstats('disttable'); SELECT relname, reltuples, relpages, relallvisible FROM pg_class WHERE relname IN -(SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name +(SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable')) ORDER BY relname; SELECT * FROM pg_stats WHERE tablename IN -(SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name +(SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable')) ORDER BY 1,2,3; @@ -180,38 +180,38 @@ CALL distributed_exec('ANALYZE disttable', ARRAY[:'DATA_NODE_1']); -- Stats should now be refreshed after running get_chunk_{col,rel}stats SELECT relname, reltuples, relpages, relallvisible FROM pg_class WHERE relname IN -(SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name +(SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable')) ORDER BY relname; SELECT * FROM pg_stats WHERE tablename IN -(SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name +(SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable')) ORDER BY 1,2,3; -SELECT * FROM _timescaledb_internal.get_chunk_relstats('disttable'); -SELECT * FROM _timescaledb_internal.get_chunk_colstats('disttable'); +SELECT * FROM _timescaledb_functions.get_chunk_relstats('disttable'); +SELECT * FROM _timescaledb_functions.get_chunk_colstats('disttable'); SELECT relname, reltuples, relpages, relallvisible FROM pg_class WHERE relname IN -(SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name +(SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable')) ORDER BY relname; SELECT * FROM pg_stats WHERE tablename IN -(SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name +(SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable')) ORDER BY 1,2,3; -- Test that user without table permissions can't get column stats SET ROLE :ROLE_DEFAULT_PERM_USER; -SELECT * FROM _timescaledb_internal.get_chunk_colstats('disttable'); +SELECT * FROM _timescaledb_functions.get_chunk_colstats('disttable'); SET ROLE :ROLE_1; -- Run ANALYZE again, but on both nodes. ANALYZE disttable; -- Now expect stats from all data node chunks -SELECT * FROM _timescaledb_internal.get_chunk_relstats('disttable'); -SELECT * FROM _timescaledb_internal.get_chunk_colstats('disttable'); +SELECT * FROM _timescaledb_functions.get_chunk_relstats('disttable'); +SELECT * FROM _timescaledb_functions.get_chunk_colstats('disttable'); -- Test ANALYZE with a replica chunk. We'd like to ensure the -- stats-fetching functions handle duplicate stats from different (but @@ -223,11 +223,11 @@ ANALYZE disttable; ANALYZE disttable; SELECT relname, reltuples, relpages, relallvisible FROM pg_class WHERE relname IN -(SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name +(SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable')) ORDER BY relname; SELECT * FROM pg_stats WHERE tablename IN -(SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name +(SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable')) ORDER BY 1,2,3; @@ -268,7 +268,7 @@ ORDER BY chunk_name DESC LIMIT 1 \gset SELECT slices AS "SLICES" -FROM _timescaledb_internal.show_chunk(:'CHUNK_SCHEMA'||'.'||:'CHUNK_NAME') \gset +FROM _timescaledb_functions.show_chunk(:'CHUNK_SCHEMA'||'.'||:'CHUNK_NAME') \gset SELECT relname FROM pg_catalog.pg_inherits, pg_class @@ -281,7 +281,7 @@ DROP TABLE :CHUNK_SCHEMA.:CHUNK_NAME; SELECT * FROM _timescaledb_catalog.dimension_slice ORDER BY id; SELECT count(*) FROM - _timescaledb_internal.create_chunk_table('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME'); + _timescaledb_functions.create_chunk_table('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME'); SELECT * FROM _timescaledb_catalog.dimension_slice ORDER BY id; @@ -292,7 +292,7 @@ WHERE inhrelid = (:'CHUNK_SCHEMA'||'.'||:'CHUNK_NAME')::regclass AND inhparent = -- Test that creat_chunk fails since chunk table already exists \set ON_ERROR_STOP 0 -SELECT * FROM _timescaledb_internal.create_chunk('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME'); +SELECT * FROM _timescaledb_functions.create_chunk('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME'); \set ON_ERROR_STOP 1 -- Test create_chunk_table on a hypertable where the chunk didn't exist before @@ -303,7 +303,7 @@ CREATE TABLE chunkapi (time timestamptz, device int, temp float); SELECT * FROM create_hypertable('chunkapi', 'time', 'device', 2); SELECT count(*) FROM - _timescaledb_internal.create_chunk_table('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME'); + _timescaledb_functions.create_chunk_table('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME'); -- Demonstrate that current settings for dimensions don't affect create_chunk_table @@ -313,7 +313,7 @@ CREATE TABLE chunkapi (time timestamptz not null, device int, temp float); SELECT * FROM create_hypertable('chunkapi', 'time', 'device', 2, '3d'); SELECT count(*) FROM - _timescaledb_internal.create_chunk_table('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME'); + _timescaledb_functions.create_chunk_table('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME'); DROP TABLE chunkapi; DROP TABLE :CHUNK_SCHEMA.:CHUNK_NAME; @@ -321,7 +321,7 @@ CREATE TABLE chunkapi (time timestamptz not null, device int, temp float); SELECT * FROM create_hypertable('chunkapi', 'time', 'device', 3); SELECT count(*) FROM - _timescaledb_internal.create_chunk_table('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME'); + _timescaledb_functions.create_chunk_table('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME'); -- Test create_chunk_table if a colliding chunk exists @@ -333,7 +333,7 @@ SELECT * FROM create_hypertable('chunkapi', 'time', 'device', 3); INSERT INTO chunkapi VALUES ('2018-01-01 05:00:00-8', 1, 23.4); \set ON_ERROR_STOP 0 -SELECT _timescaledb_internal.create_chunk_table('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME'); +SELECT _timescaledb_functions.create_chunk_table('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME'); \set ON_ERROR_STOP 1 -- Test create_chunk_table when a chunk exists in different space partition and thus doesn't collide @@ -344,7 +344,7 @@ SELECT * FROM create_hypertable('chunkapi', 'time', 'device', 2); INSERT INTO chunkapi VALUES ('2018-01-01 05:00:00-8', 2, 23.4); -SELECT _timescaledb_internal.create_chunk_table('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME'); +SELECT _timescaledb_functions.create_chunk_table('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME'); -- Test create_chunk_table when a chunk exists in different time partition and thus doesn't collide @@ -355,7 +355,7 @@ SELECT * FROM create_hypertable('chunkapi', 'time', 'device', 2); INSERT INTO chunkapi VALUES ('2018-02-01 05:00:00-8', 1, 23.4); -SELECT _timescaledb_internal.create_chunk_table('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME'); +SELECT _timescaledb_functions.create_chunk_table('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME'); -- Test create_chunk_table with tablespaces @@ -379,7 +379,7 @@ SELECT attach_tablespace('tablespace1', 'chunkapi'); SELECT attach_tablespace('tablespace2', 'chunkapi'); SELECT count(*) FROM - _timescaledb_internal.create_chunk_table('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME'); + _timescaledb_functions.create_chunk_table('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME'); SELECT tablespace FROM pg_tables WHERE tablename = :'CHUNK_NAME'; @@ -399,7 +399,7 @@ ORDER BY chunk_name DESC LIMIT 1 \gset SELECT slices AS "SLICES" -FROM _timescaledb_internal.show_chunk(:'CHUNK_SCHEMA'||'.'||:'CHUNK_NAME') \gset +FROM _timescaledb_functions.show_chunk(:'CHUNK_SCHEMA'||'.'||:'CHUNK_NAME') \gset -- Save the constraints info in a table for later comparison CREATE TABLE original_chunk_constraints AS @@ -424,12 +424,12 @@ SELECT attach_tablespace('tablespace1', 'chunkapi'); SELECT attach_tablespace('tablespace2', 'chunkapi'); SELECT count(*) FROM - _timescaledb_internal.create_chunk_table('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME'); + _timescaledb_functions.create_chunk_table('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME'); SELECT tablespace FROM pg_tables WHERE tablename = :'CHUNK_NAME'; -- Now create the complete chunk from the chunk table -SELECT _timescaledb_internal.create_chunk('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME', +SELECT _timescaledb_functions.create_chunk('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME', format('%I.%I', :'CHUNK_SCHEMA', :'CHUNK_NAME')::regclass); -- Compare original and new constraints @@ -459,7 +459,7 @@ WHERE inhrelid = (:'CHUNK_SCHEMA'||'.'||:'CHUNK_NAME')::regclass AND inhparent = SELECT :'CHUNK_SCHEMA' AS expected_schema, :'CHUNK_NAME' AS expected_table_name, - (_timescaledb_internal.show_chunk(ch)).* + (_timescaledb_functions.show_chunk(ch)).* FROM show_chunks('chunkapi') ch; DROP TABLE chunkapi; @@ -482,24 +482,24 @@ INSERT INTO newchunk VALUES ('2018-01-01 05:00:00-8', 1, 23.4); -- constraints, but not foreign key, unique, or primary key -- constraints. We should probably add checks to enforce the latter -- too or auto-create all constraints. -SELECT * FROM _timescaledb_internal.create_chunk('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME', 'newchunk'); +SELECT * FROM _timescaledb_functions.create_chunk('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME', 'newchunk'); \set ON_ERROR_STOP 1 -- Add the missing CHECK constraint. Note that the name must be the -- same as on the parent table. ALTER TABLE newchunk ADD CONSTRAINT chunkapi_temp_check CHECK (temp > 0); CREATE TABLE newchunk2 as select * from newchunk; ALTER TABLE newchunk2 ADD CONSTRAINT chunkapi_temp_check CHECK (temp > 0); -SELECT * FROM _timescaledb_internal.create_chunk('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME', 'newchunk'); +SELECT * FROM _timescaledb_functions.create_chunk('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME', 'newchunk'); -- adding an existing table to an exiting range must fail \set ON_ERROR_STOP 0 -SELECT * FROM _timescaledb_internal.create_chunk('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME', 'newchunk2'); +SELECT * FROM _timescaledb_functions.create_chunk('chunkapi', :'SLICES', :'CHUNK_SCHEMA', :'CHUNK_NAME', 'newchunk2'); \set ON_ERROR_STOP 1 -- Show the chunk and that names are what we'd expect SELECT :'CHUNK_SCHEMA' AS expected_schema, :'CHUNK_NAME' AS expected_table_name, - (_timescaledb_internal.show_chunk(ch)).* + (_timescaledb_functions.show_chunk(ch)).* FROM show_chunks('chunkapi') ch; -- The chunk should inherit the hypertable diff --git a/tsl/test/sql/chunk_utils_internal.sql b/tsl/test/sql/chunk_utils_internal.sql index f61df8ff833..ef17722a950 100644 --- a/tsl/test/sql/chunk_utils_internal.sql +++ b/tsl/test/sql/chunk_utils_internal.sql @@ -65,7 +65,7 @@ ORDER BY chunk_name LIMIT 1 \gset -- Freeze -SELECT _timescaledb_internal.freeze_chunk( :'CHNAME'); +SELECT _timescaledb_functions.freeze_chunk( :'CHNAME'); SELECT * from test1.hyper1 ORDER BY 1; @@ -136,7 +136,7 @@ SELECT * from test1.hyper1 ORDER BY 1; SELECT table_name, status FROM _timescaledb_catalog.chunk WHERE table_name = :'CHUNK_NAME'; -SELECT _timescaledb_internal.unfreeze_chunk( :'CHNAME'); +SELECT _timescaledb_functions.unfreeze_chunk( :'CHNAME'); SELECT tgname, tgtype FROM pg_trigger WHERE tgrelid = :'CHNAME'::regclass ORDER BY tgname, tgtype; @@ -151,8 +151,8 @@ UPDATE test1.hyper1 SET temp = 40; DELETE FROM test1.hyper1; --unfreezing again works -SELECT _timescaledb_internal.unfreeze_chunk( :'CHNAME'); -SELECT _timescaledb_internal.drop_chunk( :'CHNAME'); +SELECT _timescaledb_functions.unfreeze_chunk( :'CHNAME'); +SELECT _timescaledb_functions.drop_chunk( :'CHNAME'); -- TEST freeze_chunk api on a chunk that is compressed CREATE TABLE public.table_to_compress (time date NOT NULL, acq_id bigint, value bigint); @@ -173,7 +173,7 @@ ORDER BY chunk_name LIMIT 1 \gset SELECT compress_chunk( :'CHNAME'); -SELECT _timescaledb_internal.freeze_chunk( :'CHNAME'); +SELECT _timescaledb_functions.freeze_chunk( :'CHNAME'); SELECT table_name, status FROM _timescaledb_catalog.chunk WHERE table_name = :'CHUNK_NAME'; @@ -189,7 +189,7 @@ UPDATE public.table_to_compress SET value = 3; DELETE FROM public.table_to_compress WHERE time < '2020-01-02'; \set ON_ERROR_STOP 1 --try to refreeze -SELECT _timescaledb_internal.freeze_chunk( :'CHNAME'); +SELECT _timescaledb_functions.freeze_chunk( :'CHNAME'); --touches non-frozen chunk SELECT * from public.table_to_compress ORDER BY 1, 3; @@ -202,8 +202,8 @@ SELECT * from public.table_to_compress ORDER BY 1, 3; SELECT drop_chunks('table_to_compress', older_than=> '1 day'::interval); --unfreeze and drop it -SELECT _timescaledb_internal.unfreeze_chunk( :'CHNAME'); -SELECT _timescaledb_internal.drop_chunk( :'CHNAME'); +SELECT _timescaledb_functions.unfreeze_chunk( :'CHNAME'); +SELECT _timescaledb_functions.drop_chunk( :'CHNAME'); --add a new chunk INSERT INTO public.table_to_compress VALUES ('2019-01-01', 1234567, 777888); @@ -215,7 +215,7 @@ WHERE hypertable_name = 'table_to_compress' and hypertable_schema = 'public' ORDER BY chunk_name DESC LIMIT 1 \gset -SELECT _timescaledb_internal.freeze_chunk( :'CHNAME'); +SELECT _timescaledb_functions.freeze_chunk( :'CHNAME'); \set ON_ERROR_STOP 0 SELECT compress_chunk( :'CHNAME'); \set ON_ERROR_STOP 1 @@ -225,7 +225,7 @@ SELECT compress_chunk( :'CHNAME'); -- frozen chunks cannot be dropped. \set ON_ERROR_STOP 0 -SELECT _timescaledb_internal.drop_chunk(:'CHNAME'); +SELECT _timescaledb_functions.drop_chunk(:'CHNAME'); \set ON_ERROR_STOP 1 -- Prepare table for CAGG tests @@ -249,20 +249,20 @@ WHERE hypertable_name = 'hyper1' and hypertable_schema = 'test1' ORDER BY chunk_name LIMIT 1 \gset -SELECT _timescaledb_internal.freeze_chunk( :'CHNAME1'); +SELECT _timescaledb_functions.freeze_chunk( :'CHNAME1'); --cannot drop frozen chunk \set ON_ERROR_STOP 0 -SELECT _timescaledb_internal.drop_chunk( :'CHNAME1'); +SELECT _timescaledb_functions.drop_chunk( :'CHNAME1'); \set ON_ERROR_STOP 1 -- unfreeze the chunk, then drop the single chunk -SELECT _timescaledb_internal.unfreeze_chunk( :'CHNAME1'); +SELECT _timescaledb_functions.unfreeze_chunk( :'CHNAME1'); --drop the single chunk and verify that cagg is unaffected. SELECT * FROM test1.hyper1 ORDER BY 1; -SELECT _timescaledb_internal.drop_chunk( :'CHNAME1'); +SELECT _timescaledb_functions.drop_chunk( :'CHNAME1'); SELECT * from test1.hyper1 ORDER BY 1; SELECT * FROM hyper1_cagg ORDER BY 1; @@ -281,8 +281,8 @@ SELECT ts_undo_osm_hook(); --TEST error case (un)freeze a non-chunk CREATE TABLE nochunk_tab( a timestamp, b integer); \set ON_ERROR_STOP 0 -SELECT _timescaledb_internal.freeze_chunk('nochunk_tab'); -SELECT _timescaledb_internal.unfreeze_chunk('nochunk_tab'); +SELECT _timescaledb_functions.freeze_chunk('nochunk_tab'); +SELECT _timescaledb_functions.unfreeze_chunk('nochunk_tab'); \set ON_ERROR_STOP 1 ----- TESTS for attach_osm_table_chunk ------------ @@ -325,7 +325,7 @@ INSERT INTO ht_try VALUES ('2022-05-05 01:00', 222, 222); SELECT * FROM child_fdw_table; -SELECT _timescaledb_internal.attach_osm_table_chunk('ht_try', 'child_fdw_table'); +SELECT _timescaledb_functions.attach_osm_table_chunk('ht_try', 'child_fdw_table'); -- OSM chunk is not visible in chunks view SELECT chunk_name, range_start, range_end @@ -378,11 +378,11 @@ SELECT ts_undo_osm_hook(); -- TEST error have to be hypertable owner to attach a chunk to it \c :TEST_DBNAME :ROLE_DEFAULT_PERM_USER \set ON_ERROR_STOP 0 -SELECT _timescaledb_internal.attach_osm_table_chunk('ht_try', 'child_fdw_table'); +SELECT _timescaledb_functions.attach_osm_table_chunk('ht_try', 'child_fdw_table'); -- TEST error try to attach to non hypertable CREATE TABLE non_ht (time bigint, temp float); -SELECT _timescaledb_internal.attach_osm_table_chunk('non_ht', 'child_fdw_table'); +SELECT _timescaledb_functions.attach_osm_table_chunk('non_ht', 'child_fdw_table'); \set ON_ERROR_STOP 1 @@ -422,8 +422,8 @@ ORDER BY chunk_name LIMIT 1 \gset \set ON_ERROR_STOP 0 -SELECT _timescaledb_internal.freeze_chunk( :'CHNAME3'); -SELECT _timescaledb_internal.unfreeze_chunk( :'CHNAME3'); +SELECT _timescaledb_functions.freeze_chunk( :'CHNAME3'); +SELECT _timescaledb_functions.unfreeze_chunk( :'CHNAME3'); \set ON_ERROR_STOP 1 -- TEST can create OSM chunk if there are constraints on the hypertable @@ -451,7 +451,7 @@ CREATE FOREIGN TABLE child_hyper_constr SERVER s3_server OPTIONS ( schema_name 'public', table_name 'fdw_hyper_constr'); --check constraints are automatically added for the foreign table -SELECT _timescaledb_internal.attach_osm_table_chunk('hyper_constr', 'child_hyper_constr'); +SELECT _timescaledb_functions.attach_osm_table_chunk('hyper_constr', 'child_hyper_constr'); SELECT table_name, status, osm_chunk FROM _timescaledb_catalog.chunk @@ -499,7 +499,7 @@ WHERE hypertable_name = 'copy_test' and hypertable_schema = 'test1' ORDER BY chunk_name LIMIT 1 \gset -SELECT _timescaledb_internal.freeze_chunk( :'COPY_CHNAME'); +SELECT _timescaledb_functions.freeze_chunk( :'COPY_CHNAME'); -- Check state SELECT table_name, status @@ -532,7 +532,7 @@ COPY test1.copy_test FROM STDIN DELIMITER ','; SELECT COUNT(*) FROM test1.copy_test; -- Check unfreeze restored chunk -SELECT _timescaledb_internal.unfreeze_chunk( :'COPY_CHNAME'); +SELECT _timescaledb_functions.unfreeze_chunk( :'COPY_CHNAME'); -- Check state SELECT table_name, status diff --git a/tsl/test/sql/compression.sql b/tsl/test/sql/compression.sql index 5ec00278c2a..cb049443e61 100644 --- a/tsl/test/sql/compression.sql +++ b/tsl/test/sql/compression.sql @@ -788,7 +788,7 @@ SELECT FROM create_hypertable('f_sensor_data','time'); SELECT set_chunk_time_interval('f_sensor_data', INTERVAL '1 year'); -- Create one chunk manually to ensure, all data is inserted into one chunk -SELECT * FROM _timescaledb_internal.create_chunk('f_sensor_data',' {"time": [181900977000000, 515024000000000]}'); +SELECT * FROM _timescaledb_functions.create_chunk('f_sensor_data',' {"time": [181900977000000, 515024000000000]}'); INSERT INTO f_sensor_data SELECT diff --git a/tsl/test/sql/data_node.sql b/tsl/test/sql/data_node.sql index 8e847b000ac..e523dc16eef 100644 --- a/tsl/test/sql/data_node.sql +++ b/tsl/test/sql/data_node.sql @@ -270,30 +270,30 @@ _timescaledb_catalog.chunk_data_node cdn WHERE c.id = cdn.chunk_id; -- Setting the same data node should do nothing and return false -SELECT * FROM _timescaledb_internal.set_chunk_default_data_node('_timescaledb_internal._dist_hyper_3_3_chunk', 'data_node_3'); +SELECT * FROM _timescaledb_functions.set_chunk_default_data_node('_timescaledb_internal._dist_hyper_3_3_chunk', 'data_node_3'); -- Should update the default data node and return true -SELECT * FROM _timescaledb_internal.set_chunk_default_data_node('_timescaledb_internal._dist_hyper_3_3_chunk', 'data_node_2'); +SELECT * FROM _timescaledb_functions.set_chunk_default_data_node('_timescaledb_internal._dist_hyper_3_3_chunk', 'data_node_2'); SELECT foreign_table_name, foreign_server_name FROM information_schema.foreign_tables ORDER BY foreign_table_name; -- Reset the default data node -SELECT * FROM _timescaledb_internal.set_chunk_default_data_node('_timescaledb_internal._dist_hyper_3_3_chunk', 'data_node_3'); +SELECT * FROM _timescaledb_functions.set_chunk_default_data_node('_timescaledb_internal._dist_hyper_3_3_chunk', 'data_node_3'); \set ON_ERROR_STOP 0 -- Will fail because data_node_2 contains chunks SET ROLE :ROLE_CLUSTER_SUPERUSER; SELECT * FROM delete_data_node('data_node_2'); -- non-existing chunk -SELECT * FROM _timescaledb_internal.set_chunk_default_data_node('x_chunk', 'data_node_3'); +SELECT * FROM _timescaledb_functions.set_chunk_default_data_node('x_chunk', 'data_node_3'); -- non-existing data node -SELECT * FROM _timescaledb_internal.set_chunk_default_data_node('_timescaledb_internal._dist_hyper_3_3_chunk', 'data_node_0000'); +SELECT * FROM _timescaledb_functions.set_chunk_default_data_node('_timescaledb_internal._dist_hyper_3_3_chunk', 'data_node_0000'); -- data node exists but does not store the chunk -SELECT * FROM _timescaledb_internal.set_chunk_default_data_node('_timescaledb_internal._dist_hyper_3_3_chunk', 'data_node_1'); +SELECT * FROM _timescaledb_functions.set_chunk_default_data_node('_timescaledb_internal._dist_hyper_3_3_chunk', 'data_node_1'); -- NULL try -SELECT * FROM _timescaledb_internal.set_chunk_default_data_node(NULL, 'data_node_3'); +SELECT * FROM _timescaledb_functions.set_chunk_default_data_node(NULL, 'data_node_3'); \set ON_ERROR_STOP 1 -- Deleting a data node removes the "foreign" chunk table(s) that diff --git a/tsl/test/sql/dist_hypertable.sql.in b/tsl/test/sql/dist_hypertable.sql.in index 9dec202ec55..a3bda50d110 100644 --- a/tsl/test/sql/dist_hypertable.sql.in +++ b/tsl/test/sql/dist_hypertable.sql.in @@ -269,7 +269,7 @@ INSERT INTO disttable VALUES ($1, $2, $3); EXECUTE dist_insert ('2017-01-01 06:05', 1, 1.4); -- Show chunks created -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable'); -- Show that there are assigned node_chunk_id:s in chunk data node mappings @@ -279,7 +279,7 @@ SELECT * FROM hypertable_partitions; -- Show that chunks are created on data nodes and that each data node -- has their own unique slice in the space (device) dimension. SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable'); $$); SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ @@ -358,7 +358,7 @@ ORDER BY device, temp; -- Make sure that chunks_in function only expects one-dimensional integer arrays \set ON_ERROR_STOP 0 -SELECT "time" FROM public.disttable WHERE _timescaledb_internal.chunks_in(public.disttable.*, ARRAY[[2], [1]]) +SELECT "time" FROM public.disttable WHERE _timescaledb_functions.chunks_in(public.disttable.*, ARRAY[[2], [1]]) ORDER BY "time" DESC NULLS FIRST LIMIT 1; \set ON_ERROR_STOP 1 @@ -432,7 +432,7 @@ SELECT st."Child" as chunk_relid, test.show_constraints((st)."Child") FROM test.show_subtables('disttable') st; SELECT cc.* -FROM (SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +FROM (SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable')) c, _timescaledb_catalog.chunk_constraint cc WHERE c.chunk_id = cc.chunk_id; @@ -459,7 +459,7 @@ VALUES ('2017-09-02 06:09', 6, 2, 10.5) ON CONFLICT DO NOTHING; SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable'); $$); @@ -566,7 +566,7 @@ INSERT INTO underreplicated VALUES ('2017-01-01 06:01', 1, 1.1), ('2017-01-02 07:01', 2, 3.5); SELECT * FROM _timescaledb_catalog.chunk_data_node ORDER BY 1,2,3; -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('underreplicated'); -- Show chunk data node mappings @@ -575,7 +575,7 @@ SELECT * FROM _timescaledb_catalog.chunk_data_node ORDER BY 1,2,3; -- Show that chunks are created on remote data nodes and that all -- data nodes/chunks have the same data due to replication SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('underreplicated'); $$); @@ -950,12 +950,12 @@ INSERT INTO disttable_drop_chunks VALUES ('2018-07-01 08:01', 29, 1.5); -- Show chunks on access node -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable_drop_chunks'); -- Show chunks on data nodes SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable_drop_chunks'); $$); @@ -963,11 +963,11 @@ SELECT * FROM drop_chunks('disttable_drop_chunks', older_than => '2018-01-01'::t SELECT * FROM disttable_drop_chunks; -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable_drop_chunks'); SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ -SELECT (_timescaledb_internal.show_chunk(show_chunks)).* +SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('disttable_drop_chunks'); $$); @@ -1235,7 +1235,7 @@ INSERT INTO hyper VALUES ('2017-01-01 06:01', 6, 1.1); -- Test alter replication factor with data SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper'); $$); @@ -1248,14 +1248,14 @@ SELECT * FROM hypertable_partitions WHERE table_name = 'hyper'; INSERT INTO hyper VALUES ('2017-01-02 07:11', 1, 1.7); SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper'); $$); INSERT INTO hyper VALUES ('2017-02-01 06:01', 1, 5.1); SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper'); $$); @@ -1265,7 +1265,7 @@ SELECT * FROM hypertable_partitions WHERE table_name = 'hyper'; INSERT INTO hyper VALUES ('2017-03-01 06:01', 1, 15.1); SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper'); $$); @@ -1274,7 +1274,7 @@ SELECT * FROM set_replication_factor('hyper', replication_factor => 2); INSERT INTO hyper VALUES ('2017-04-01 06:01', 2, 45.1); SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ - SELECT (_timescaledb_internal.show_chunk(show_chunks)).* + SELECT (_timescaledb_functions.show_chunk(show_chunks)).* FROM show_chunks('hyper'); $$); @@ -1323,11 +1323,11 @@ SELECT relname, reloptions FROM pg_class WHERE relname = 'disttable_with_relopts -- Ensure reloptions are not set for distributed hypertable chunks on the AN SELECT relname, reloptions FROM pg_class WHERE relname IN -(SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) +(SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname; SELECT relname, reloptions FROM pg_class WHERE relname IN -(SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_2')) +(SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_2')) ORDER BY relname; -- Ensure parent tables has proper storage options @@ -1347,13 +1347,13 @@ $$); -- Make sure chunks derive parent reloptions SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname; $$); SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_2')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_2')) ORDER BY relname; $$); @@ -1366,13 +1366,13 @@ SELECT relname, reloptions FROM pg_class WHERE relname = 'disttable_with_relopts -- Ensure chunks are not affected on the AN SELECT relname, reloptions FROM pg_class WHERE relname IN -(SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) +(SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname; -- Ensure data node chunks has proper options set SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname; $$); @@ -1383,13 +1383,13 @@ SELECT relname, reloptions FROM pg_class WHERE relname = 'disttable_with_relopts -- Ensure chunks are not affected on the AN SELECT relname, reloptions FROM pg_class WHERE relname IN -(SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) +(SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname; -- Ensure data node chunks has proper options set SELECT * FROM test.remote_exec(ARRAY[:'DATA_NODE_1', :'DATA_NODE_2', :'DATA_NODE_3'], $$ SELECT relname, reloptions FROM pg_class WHERE relname IN - (SELECT (_timescaledb_internal.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) + (SELECT (_timescaledb_functions.show_chunk(show_chunks)).table_name FROM show_chunks('disttable_with_relopts_1')) ORDER BY relname; $$); @@ -2083,7 +2083,7 @@ ORDER BY chunk_name LIMIT 1 \gset \set ON_ERROR_STOP 0 -SELECT _timescaledb_internal.freeze_chunk( :'CHNAME'); +SELECT _timescaledb_functions.freeze_chunk( :'CHNAME'); \set ON_ERROR_STOP 1 --TEST freeze_chunk api for regular hypertables. Works only for >= PG14 @@ -2091,7 +2091,7 @@ CREATE TABLE freeze_1(time TIMESTAMPTZ NOT NULL, sensor_id INTEGER, value FLOAT) SELECT table_name FROM create_hypertable('freeze_1', 'time'); INSERT INTO freeze_1 VALUES ('2020-12-09',1,32.2); \set ON_ERROR_STOP 0 -SELECT _timescaledb_internal.freeze_chunk( ch) FROM ( select show_chunks('freeze_1') ch ) q; +SELECT _timescaledb_functions.freeze_chunk( ch) FROM ( select show_chunks('freeze_1') ch ) q; \set ON_ERROR_STOP 1 DROP TABLE pruned_chunks_1;