mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-20 20:54:29 +08:00
Fix filtering of the redundant decompress chunk clauses
We just had a bad cast inside is_redundant_derived_clause before, because it doesn't work with IndexClauses. Filtering didn't work as a result.
This commit is contained in:
parent
3a27669c84
commit
22a2f49a2f
@ -403,18 +403,47 @@ decompress_chunk_plan_create(PlannerInfo *root, RelOptInfo *rel, CustomPath *pat
|
||||
|
||||
if (IsA(compressed_path, IndexPath))
|
||||
{
|
||||
/* from create_indexscan_plan() */
|
||||
/*
|
||||
* Check if any of the decompressed scan clauses are redundant with
|
||||
* the compressed index scan clauses. Note that we can't use
|
||||
* is_redundant_derived_clause() here, because it can't work with
|
||||
* IndexClause's, so we use some custom code based on it.
|
||||
*/
|
||||
IndexPath *ipath = castNode(IndexPath, compressed_path);
|
||||
List *indexqual = NIL;
|
||||
Plan *indexplan;
|
||||
foreach (lc, clauses)
|
||||
{
|
||||
RestrictInfo *rinfo = lfirst_node(RestrictInfo, lc);
|
||||
if (is_redundant_derived_clause(rinfo, ipath->indexclauses))
|
||||
continue; /* dup or derived from same EquivalenceClass */
|
||||
|
||||
ListCell *indexclause_cell = NULL;
|
||||
if (rinfo->parent_ec != NULL)
|
||||
{
|
||||
foreach (indexclause_cell, ipath->indexclauses)
|
||||
{
|
||||
IndexClause *indexclause = lfirst(indexclause_cell);
|
||||
RestrictInfo *index_rinfo = indexclause->rinfo;
|
||||
if (index_rinfo->parent_ec == rinfo->parent_ec)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (indexclause_cell != NULL)
|
||||
{
|
||||
/* We already have an index clause derived from same EquivalenceClass. */
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* We don't have this clause in the underlying index scan, add it
|
||||
* to the decompressed scan.
|
||||
*/
|
||||
decompress_plan->scan.plan.qual =
|
||||
lappend(decompress_plan->scan.plan.qual, rinfo->clause);
|
||||
}
|
||||
|
||||
/* joininfo clauses on the compressed chunk rel have to
|
||||
* contain clauses on both compressed and
|
||||
* decompressed attnos. joininfo clauses get translated into
|
||||
|
@ -2185,7 +2185,6 @@ WHERE device_id_peer IN (
|
||||
-> Append (actual rows=0 loops=2)
|
||||
-> Custom Scan (DecompressChunk) on _timescaledb_internal._hyper_1_1_chunk (actual rows=0 loops=2)
|
||||
Output: _hyper_1_1_chunk.device_id_peer
|
||||
Filter: ("*VALUES*".column1 = _hyper_1_1_chunk.device_id_peer)
|
||||
Bulk Decompression: false
|
||||
-> Index Scan using compress_hyper_5_15_chunk__compressed_hypertable_5_device_id_pe on _timescaledb_internal.compress_hyper_5_15_chunk (actual rows=0 loops=2)
|
||||
Output: compress_hyper_5_15_chunk."time", compress_hyper_5_15_chunk.device_id, compress_hyper_5_15_chunk.device_id_peer, compress_hyper_5_15_chunk.v0, compress_hyper_5_15_chunk.v1, compress_hyper_5_15_chunk.v2, compress_hyper_5_15_chunk.v3, compress_hyper_5_15_chunk._ts_meta_count, compress_hyper_5_15_chunk._ts_meta_sequence_num, compress_hyper_5_15_chunk._ts_meta_min_3, compress_hyper_5_15_chunk._ts_meta_max_3, compress_hyper_5_15_chunk._ts_meta_min_1, compress_hyper_5_15_chunk._ts_meta_max_1, compress_hyper_5_15_chunk._ts_meta_min_2, compress_hyper_5_15_chunk._ts_meta_max_2
|
||||
@ -2196,12 +2195,11 @@ WHERE device_id_peer IN (
|
||||
Rows Removed by Filter: 2520
|
||||
-> Custom Scan (DecompressChunk) on _timescaledb_internal._hyper_1_3_chunk (actual rows=0 loops=2)
|
||||
Output: _hyper_1_3_chunk.device_id_peer
|
||||
Filter: ("*VALUES*".column1 = _hyper_1_3_chunk.device_id_peer)
|
||||
Bulk Decompression: false
|
||||
-> Index Scan using compress_hyper_5_16_chunk__compressed_hypertable_5_device_id_pe on _timescaledb_internal.compress_hyper_5_16_chunk (actual rows=0 loops=2)
|
||||
Output: compress_hyper_5_16_chunk."time", compress_hyper_5_16_chunk.device_id, compress_hyper_5_16_chunk.device_id_peer, compress_hyper_5_16_chunk.v0, compress_hyper_5_16_chunk.v1, compress_hyper_5_16_chunk.v2, compress_hyper_5_16_chunk.v3, compress_hyper_5_16_chunk._ts_meta_count, compress_hyper_5_16_chunk._ts_meta_sequence_num, compress_hyper_5_16_chunk._ts_meta_min_3, compress_hyper_5_16_chunk._ts_meta_max_3, compress_hyper_5_16_chunk._ts_meta_min_1, compress_hyper_5_16_chunk._ts_meta_max_1, compress_hyper_5_16_chunk._ts_meta_min_2, compress_hyper_5_16_chunk._ts_meta_max_2
|
||||
Index Cond: (compress_hyper_5_16_chunk.device_id_peer = "*VALUES*".column1)
|
||||
(29 rows)
|
||||
(27 rows)
|
||||
|
||||
RESET enable_hashjoin;
|
||||
:PREFIX_VERBOSE
|
||||
@ -2254,7 +2252,6 @@ WHERE device_id IN (
|
||||
-> Append (actual rows=1368 loops=2)
|
||||
-> Custom Scan (DecompressChunk) on _timescaledb_internal._hyper_1_1_chunk (actual rows=360 loops=2)
|
||||
Output: _hyper_1_1_chunk.device_id_peer, _hyper_1_1_chunk.device_id
|
||||
Filter: ("*VALUES*".column1 = _hyper_1_1_chunk.device_id)
|
||||
Bulk Decompression: false
|
||||
-> Index Scan using compress_hyper_5_15_chunk_c_index_2 on _timescaledb_internal.compress_hyper_5_15_chunk (actual rows=1 loops=2)
|
||||
Output: compress_hyper_5_15_chunk."time", compress_hyper_5_15_chunk.device_id, compress_hyper_5_15_chunk.device_id_peer, compress_hyper_5_15_chunk.v0, compress_hyper_5_15_chunk.v1, compress_hyper_5_15_chunk.v2, compress_hyper_5_15_chunk.v3, compress_hyper_5_15_chunk._ts_meta_count, compress_hyper_5_15_chunk._ts_meta_sequence_num, compress_hyper_5_15_chunk._ts_meta_min_3, compress_hyper_5_15_chunk._ts_meta_max_3, compress_hyper_5_15_chunk._ts_meta_min_1, compress_hyper_5_15_chunk._ts_meta_max_1, compress_hyper_5_15_chunk._ts_meta_min_2, compress_hyper_5_15_chunk._ts_meta_max_2
|
||||
@ -2265,12 +2262,11 @@ WHERE device_id IN (
|
||||
Rows Removed by Filter: 2016
|
||||
-> Custom Scan (DecompressChunk) on _timescaledb_internal._hyper_1_3_chunk (actual rows=504 loops=2)
|
||||
Output: _hyper_1_3_chunk.device_id_peer, _hyper_1_3_chunk.device_id
|
||||
Filter: ("*VALUES*".column1 = _hyper_1_3_chunk.device_id)
|
||||
Bulk Decompression: false
|
||||
-> Index Scan using compress_hyper_5_16_chunk_c_index_2 on _timescaledb_internal.compress_hyper_5_16_chunk (actual rows=1 loops=2)
|
||||
Output: compress_hyper_5_16_chunk."time", compress_hyper_5_16_chunk.device_id, compress_hyper_5_16_chunk.device_id_peer, compress_hyper_5_16_chunk.v0, compress_hyper_5_16_chunk.v1, compress_hyper_5_16_chunk.v2, compress_hyper_5_16_chunk.v3, compress_hyper_5_16_chunk._ts_meta_count, compress_hyper_5_16_chunk._ts_meta_sequence_num, compress_hyper_5_16_chunk._ts_meta_min_3, compress_hyper_5_16_chunk._ts_meta_max_3, compress_hyper_5_16_chunk._ts_meta_min_1, compress_hyper_5_16_chunk._ts_meta_max_1, compress_hyper_5_16_chunk._ts_meta_min_2, compress_hyper_5_16_chunk._ts_meta_max_2
|
||||
Index Cond: (compress_hyper_5_16_chunk.device_id = "*VALUES*".column1)
|
||||
(29 rows)
|
||||
(27 rows)
|
||||
|
||||
SET seq_page_cost = 100;
|
||||
-- loop/row counts of this query is different on windows so we run it without analyze
|
||||
@ -2352,7 +2348,6 @@ WHERE device_id IN (
|
||||
-> Append (actual rows=1368 loops=2)
|
||||
-> Custom Scan (DecompressChunk) on _timescaledb_internal._hyper_1_1_chunk (actual rows=360 loops=2)
|
||||
Output: _hyper_1_1_chunk.device_id_peer, _hyper_1_1_chunk.device_id
|
||||
Filter: ("*VALUES*".column1 = _hyper_1_1_chunk.device_id)
|
||||
Bulk Decompression: false
|
||||
-> Index Scan using compress_hyper_5_15_chunk_c_index_2 on _timescaledb_internal.compress_hyper_5_15_chunk (actual rows=1 loops=2)
|
||||
Output: compress_hyper_5_15_chunk."time", compress_hyper_5_15_chunk.device_id, compress_hyper_5_15_chunk.device_id_peer, compress_hyper_5_15_chunk.v0, compress_hyper_5_15_chunk.v1, compress_hyper_5_15_chunk.v2, compress_hyper_5_15_chunk.v3, compress_hyper_5_15_chunk._ts_meta_count, compress_hyper_5_15_chunk._ts_meta_sequence_num, compress_hyper_5_15_chunk._ts_meta_min_3, compress_hyper_5_15_chunk._ts_meta_max_3, compress_hyper_5_15_chunk._ts_meta_min_1, compress_hyper_5_15_chunk._ts_meta_max_1, compress_hyper_5_15_chunk._ts_meta_min_2, compress_hyper_5_15_chunk._ts_meta_max_2
|
||||
@ -2363,12 +2358,11 @@ WHERE device_id IN (
|
||||
Rows Removed by Filter: 2016
|
||||
-> Custom Scan (DecompressChunk) on _timescaledb_internal._hyper_1_3_chunk (actual rows=504 loops=2)
|
||||
Output: _hyper_1_3_chunk.device_id_peer, _hyper_1_3_chunk.device_id
|
||||
Filter: ("*VALUES*".column1 = _hyper_1_3_chunk.device_id)
|
||||
Bulk Decompression: false
|
||||
-> Index Scan using compress_hyper_5_16_chunk_c_index_2 on _timescaledb_internal.compress_hyper_5_16_chunk (actual rows=1 loops=2)
|
||||
Output: compress_hyper_5_16_chunk."time", compress_hyper_5_16_chunk.device_id, compress_hyper_5_16_chunk.device_id_peer, compress_hyper_5_16_chunk.v0, compress_hyper_5_16_chunk.v1, compress_hyper_5_16_chunk.v2, compress_hyper_5_16_chunk.v3, compress_hyper_5_16_chunk._ts_meta_count, compress_hyper_5_16_chunk._ts_meta_sequence_num, compress_hyper_5_16_chunk._ts_meta_min_3, compress_hyper_5_16_chunk._ts_meta_max_3, compress_hyper_5_16_chunk._ts_meta_min_1, compress_hyper_5_16_chunk._ts_meta_max_1, compress_hyper_5_16_chunk._ts_meta_min_2, compress_hyper_5_16_chunk._ts_meta_max_2
|
||||
Index Cond: (compress_hyper_5_16_chunk.device_id = "*VALUES*".column1)
|
||||
(29 rows)
|
||||
(27 rows)
|
||||
|
||||
-- test view
|
||||
CREATE OR REPLACE VIEW compressed_view AS
|
||||
@ -3182,7 +3176,7 @@ WHERE metrics.time > metrics_space.time
|
||||
-> Index Scan Backward using _hyper_2_12_chunk_metrics_space_device_id_device_id_peer_v0_v_2 on _hyper_2_12_chunk (actual rows=504 loops=1)
|
||||
-> Append (actual rows=0 loops=6840)
|
||||
-> Custom Scan (DecompressChunk) on _hyper_1_1_chunk (actual rows=0 loops=6840)
|
||||
Filter: (("time" > _hyper_2_4_chunk."time") AND ("time" < _hyper_2_4_chunk."time") AND (_hyper_2_4_chunk.device_id = device_id))
|
||||
Filter: (("time" > _hyper_2_4_chunk."time") AND ("time" < _hyper_2_4_chunk."time"))
|
||||
Rows Removed by Filter: 360
|
||||
-> Index Scan using compress_hyper_5_15_chunk_c_index_2 on compress_hyper_5_15_chunk (actual rows=1 loops=6840)
|
||||
Index Cond: (device_id = _hyper_2_4_chunk.device_id)
|
||||
@ -3190,7 +3184,7 @@ WHERE metrics.time > metrics_space.time
|
||||
Index Cond: (("time" > _hyper_2_4_chunk."time") AND ("time" < _hyper_2_4_chunk."time"))
|
||||
Filter: (_hyper_2_4_chunk.device_id = device_id)
|
||||
-> Custom Scan (DecompressChunk) on _hyper_1_3_chunk (actual rows=0 loops=6840)
|
||||
Filter: (("time" > _hyper_2_4_chunk."time") AND ("time" < _hyper_2_4_chunk."time") AND (_hyper_2_4_chunk.device_id = device_id))
|
||||
Filter: (("time" > _hyper_2_4_chunk."time") AND ("time" < _hyper_2_4_chunk."time"))
|
||||
Rows Removed by Filter: 504
|
||||
-> Index Scan using compress_hyper_5_16_chunk_c_index_2 on compress_hyper_5_16_chunk (actual rows=1 loops=6840)
|
||||
Index Cond: (device_id = _hyper_2_4_chunk.device_id)
|
||||
@ -6495,19 +6489,16 @@ WHERE device_id IN (
|
||||
-> Append
|
||||
-> Custom Scan (DecompressChunk) on _timescaledb_internal._hyper_2_4_chunk
|
||||
Output: _hyper_2_4_chunk.device_id_peer, _hyper_2_4_chunk.device_id
|
||||
Filter: ("*VALUES*".column1 = _hyper_2_4_chunk.device_id)
|
||||
-> Index Scan using compress_hyper_6_17_chunk_c_space_index_2 on _timescaledb_internal.compress_hyper_6_17_chunk
|
||||
Output: compress_hyper_6_17_chunk."time", compress_hyper_6_17_chunk.device_id, compress_hyper_6_17_chunk.device_id_peer, compress_hyper_6_17_chunk.v0, compress_hyper_6_17_chunk.v1, compress_hyper_6_17_chunk.v2, compress_hyper_6_17_chunk.v3, compress_hyper_6_17_chunk._ts_meta_count, compress_hyper_6_17_chunk._ts_meta_sequence_num, compress_hyper_6_17_chunk._ts_meta_min_3, compress_hyper_6_17_chunk._ts_meta_max_3, compress_hyper_6_17_chunk._ts_meta_min_1, compress_hyper_6_17_chunk._ts_meta_max_1, compress_hyper_6_17_chunk._ts_meta_min_2, compress_hyper_6_17_chunk._ts_meta_max_2
|
||||
Index Cond: (compress_hyper_6_17_chunk.device_id = "*VALUES*".column1)
|
||||
-> Custom Scan (DecompressChunk) on _timescaledb_internal._hyper_2_5_chunk
|
||||
Output: _hyper_2_5_chunk.device_id_peer, _hyper_2_5_chunk.device_id
|
||||
Filter: ("*VALUES*".column1 = _hyper_2_5_chunk.device_id)
|
||||
-> Index Scan using compress_hyper_6_18_chunk_c_space_index_2 on _timescaledb_internal.compress_hyper_6_18_chunk
|
||||
Output: compress_hyper_6_18_chunk."time", compress_hyper_6_18_chunk.device_id, compress_hyper_6_18_chunk.device_id_peer, compress_hyper_6_18_chunk.v0, compress_hyper_6_18_chunk.v1, compress_hyper_6_18_chunk.v2, compress_hyper_6_18_chunk.v3, compress_hyper_6_18_chunk._ts_meta_count, compress_hyper_6_18_chunk._ts_meta_sequence_num, compress_hyper_6_18_chunk._ts_meta_min_3, compress_hyper_6_18_chunk._ts_meta_max_3, compress_hyper_6_18_chunk._ts_meta_min_1, compress_hyper_6_18_chunk._ts_meta_max_1, compress_hyper_6_18_chunk._ts_meta_min_2, compress_hyper_6_18_chunk._ts_meta_max_2
|
||||
Index Cond: (compress_hyper_6_18_chunk.device_id = "*VALUES*".column1)
|
||||
-> Custom Scan (DecompressChunk) on _timescaledb_internal._hyper_2_6_chunk
|
||||
Output: _hyper_2_6_chunk.device_id_peer, _hyper_2_6_chunk.device_id
|
||||
Filter: ("*VALUES*".column1 = _hyper_2_6_chunk.device_id)
|
||||
-> Index Scan using compress_hyper_6_19_chunk_c_space_index_2 on _timescaledb_internal.compress_hyper_6_19_chunk
|
||||
Output: compress_hyper_6_19_chunk."time", compress_hyper_6_19_chunk.device_id, compress_hyper_6_19_chunk.device_id_peer, compress_hyper_6_19_chunk.v0, compress_hyper_6_19_chunk.v1, compress_hyper_6_19_chunk.v2, compress_hyper_6_19_chunk.v3, compress_hyper_6_19_chunk._ts_meta_count, compress_hyper_6_19_chunk._ts_meta_sequence_num, compress_hyper_6_19_chunk._ts_meta_min_3, compress_hyper_6_19_chunk._ts_meta_max_3, compress_hyper_6_19_chunk._ts_meta_min_1, compress_hyper_6_19_chunk._ts_meta_max_1, compress_hyper_6_19_chunk._ts_meta_min_2, compress_hyper_6_19_chunk._ts_meta_max_2
|
||||
Index Cond: (compress_hyper_6_19_chunk.device_id = "*VALUES*".column1)
|
||||
@ -6522,20 +6513,18 @@ WHERE device_id IN (
|
||||
Index Cond: (_hyper_2_9_chunk.device_id = "*VALUES*".column1)
|
||||
-> Custom Scan (DecompressChunk) on _timescaledb_internal._hyper_2_10_chunk
|
||||
Output: _hyper_2_10_chunk.device_id_peer, _hyper_2_10_chunk.device_id
|
||||
Filter: ("*VALUES*".column1 = _hyper_2_10_chunk.device_id)
|
||||
-> Index Scan using compress_hyper_6_20_chunk_c_space_index_2 on _timescaledb_internal.compress_hyper_6_20_chunk
|
||||
Output: compress_hyper_6_20_chunk."time", compress_hyper_6_20_chunk.device_id, compress_hyper_6_20_chunk.device_id_peer, compress_hyper_6_20_chunk.v0, compress_hyper_6_20_chunk.v1, compress_hyper_6_20_chunk.v2, compress_hyper_6_20_chunk.v3, compress_hyper_6_20_chunk._ts_meta_count, compress_hyper_6_20_chunk._ts_meta_sequence_num, compress_hyper_6_20_chunk._ts_meta_min_3, compress_hyper_6_20_chunk._ts_meta_max_3, compress_hyper_6_20_chunk._ts_meta_min_1, compress_hyper_6_20_chunk._ts_meta_max_1, compress_hyper_6_20_chunk._ts_meta_min_2, compress_hyper_6_20_chunk._ts_meta_max_2
|
||||
Index Cond: (compress_hyper_6_20_chunk.device_id = "*VALUES*".column1)
|
||||
-> Custom Scan (DecompressChunk) on _timescaledb_internal._hyper_2_11_chunk
|
||||
Output: _hyper_2_11_chunk.device_id_peer, _hyper_2_11_chunk.device_id
|
||||
Filter: ("*VALUES*".column1 = _hyper_2_11_chunk.device_id)
|
||||
-> Index Scan using compress_hyper_6_21_chunk_c_space_index_2 on _timescaledb_internal.compress_hyper_6_21_chunk
|
||||
Output: compress_hyper_6_21_chunk."time", compress_hyper_6_21_chunk.device_id, compress_hyper_6_21_chunk.device_id_peer, compress_hyper_6_21_chunk.v0, compress_hyper_6_21_chunk.v1, compress_hyper_6_21_chunk.v2, compress_hyper_6_21_chunk.v3, compress_hyper_6_21_chunk._ts_meta_count, compress_hyper_6_21_chunk._ts_meta_sequence_num, compress_hyper_6_21_chunk._ts_meta_min_3, compress_hyper_6_21_chunk._ts_meta_max_3, compress_hyper_6_21_chunk._ts_meta_min_1, compress_hyper_6_21_chunk._ts_meta_max_1, compress_hyper_6_21_chunk._ts_meta_min_2, compress_hyper_6_21_chunk._ts_meta_max_2
|
||||
Index Cond: (compress_hyper_6_21_chunk.device_id = "*VALUES*".column1)
|
||||
-> Index Only Scan using _hyper_2_12_chunk_metrics_space_device_id_device_id_peer_v0_v_2 on _timescaledb_internal._hyper_2_12_chunk
|
||||
Output: _hyper_2_12_chunk.device_id_peer, _hyper_2_12_chunk.device_id
|
||||
Index Cond: (_hyper_2_12_chunk.device_id = "*VALUES*".column1)
|
||||
(52 rows)
|
||||
(47 rows)
|
||||
|
||||
RESET seq_page_cost;
|
||||
:PREFIX_VERBOSE
|
||||
@ -7876,7 +7865,7 @@ WHERE metrics.time > metrics_space.time
|
||||
-> Index Scan Backward using _hyper_2_12_chunk_metrics_space_device_id_device_id_peer_v0_v_2 on _hyper_2_12_chunk (actual rows=504 loops=1)
|
||||
-> Append (actual rows=0 loops=6840)
|
||||
-> Custom Scan (DecompressChunk) on _hyper_1_1_chunk (actual rows=0 loops=6840)
|
||||
Filter: (("time" > _hyper_2_4_chunk."time") AND ("time" < _hyper_2_4_chunk."time") AND (_hyper_2_4_chunk.device_id = device_id))
|
||||
Filter: (("time" > _hyper_2_4_chunk."time") AND ("time" < _hyper_2_4_chunk."time"))
|
||||
Rows Removed by Filter: 360
|
||||
-> Index Scan using compress_hyper_5_15_chunk_c_index_2 on compress_hyper_5_15_chunk (actual rows=1 loops=6840)
|
||||
Index Cond: (device_id = _hyper_2_4_chunk.device_id)
|
||||
@ -7884,7 +7873,7 @@ WHERE metrics.time > metrics_space.time
|
||||
Index Cond: (("time" > _hyper_2_4_chunk."time") AND ("time" < _hyper_2_4_chunk."time"))
|
||||
Filter: (_hyper_2_4_chunk.device_id = device_id)
|
||||
-> Custom Scan (DecompressChunk) on _hyper_1_3_chunk (actual rows=0 loops=6840)
|
||||
Filter: (("time" > _hyper_2_4_chunk."time") AND ("time" < _hyper_2_4_chunk."time") AND (_hyper_2_4_chunk.device_id = device_id))
|
||||
Filter: (("time" > _hyper_2_4_chunk."time") AND ("time" < _hyper_2_4_chunk."time"))
|
||||
Rows Removed by Filter: 504
|
||||
-> Index Scan using compress_hyper_5_16_chunk_c_index_2 on compress_hyper_5_16_chunk (actual rows=1 loops=6840)
|
||||
Index Cond: (device_id = _hyper_2_4_chunk.device_id)
|
||||
|
@ -2185,7 +2185,6 @@ WHERE device_id_peer IN (
|
||||
-> Append (actual rows=0 loops=2)
|
||||
-> Custom Scan (DecompressChunk) on _timescaledb_internal._hyper_1_1_chunk (actual rows=0 loops=2)
|
||||
Output: _hyper_1_1_chunk.device_id_peer
|
||||
Filter: ("*VALUES*".column1 = _hyper_1_1_chunk.device_id_peer)
|
||||
Bulk Decompression: false
|
||||
-> Index Scan using compress_hyper_5_15_chunk__compressed_hypertable_5_device_id_pe on _timescaledb_internal.compress_hyper_5_15_chunk (actual rows=0 loops=2)
|
||||
Output: compress_hyper_5_15_chunk."time", compress_hyper_5_15_chunk.device_id, compress_hyper_5_15_chunk.device_id_peer, compress_hyper_5_15_chunk.v0, compress_hyper_5_15_chunk.v1, compress_hyper_5_15_chunk.v2, compress_hyper_5_15_chunk.v3, compress_hyper_5_15_chunk._ts_meta_count, compress_hyper_5_15_chunk._ts_meta_sequence_num, compress_hyper_5_15_chunk._ts_meta_min_3, compress_hyper_5_15_chunk._ts_meta_max_3, compress_hyper_5_15_chunk._ts_meta_min_1, compress_hyper_5_15_chunk._ts_meta_max_1, compress_hyper_5_15_chunk._ts_meta_min_2, compress_hyper_5_15_chunk._ts_meta_max_2
|
||||
@ -2196,12 +2195,11 @@ WHERE device_id_peer IN (
|
||||
Rows Removed by Filter: 2520
|
||||
-> Custom Scan (DecompressChunk) on _timescaledb_internal._hyper_1_3_chunk (actual rows=0 loops=2)
|
||||
Output: _hyper_1_3_chunk.device_id_peer
|
||||
Filter: ("*VALUES*".column1 = _hyper_1_3_chunk.device_id_peer)
|
||||
Bulk Decompression: false
|
||||
-> Index Scan using compress_hyper_5_16_chunk__compressed_hypertable_5_device_id_pe on _timescaledb_internal.compress_hyper_5_16_chunk (actual rows=0 loops=2)
|
||||
Output: compress_hyper_5_16_chunk."time", compress_hyper_5_16_chunk.device_id, compress_hyper_5_16_chunk.device_id_peer, compress_hyper_5_16_chunk.v0, compress_hyper_5_16_chunk.v1, compress_hyper_5_16_chunk.v2, compress_hyper_5_16_chunk.v3, compress_hyper_5_16_chunk._ts_meta_count, compress_hyper_5_16_chunk._ts_meta_sequence_num, compress_hyper_5_16_chunk._ts_meta_min_3, compress_hyper_5_16_chunk._ts_meta_max_3, compress_hyper_5_16_chunk._ts_meta_min_1, compress_hyper_5_16_chunk._ts_meta_max_1, compress_hyper_5_16_chunk._ts_meta_min_2, compress_hyper_5_16_chunk._ts_meta_max_2
|
||||
Index Cond: (compress_hyper_5_16_chunk.device_id_peer = "*VALUES*".column1)
|
||||
(29 rows)
|
||||
(27 rows)
|
||||
|
||||
RESET enable_hashjoin;
|
||||
:PREFIX_VERBOSE
|
||||
@ -2254,7 +2252,6 @@ WHERE device_id IN (
|
||||
-> Append (actual rows=1368 loops=2)
|
||||
-> Custom Scan (DecompressChunk) on _timescaledb_internal._hyper_1_1_chunk (actual rows=360 loops=2)
|
||||
Output: _hyper_1_1_chunk.device_id_peer, _hyper_1_1_chunk.device_id
|
||||
Filter: ("*VALUES*".column1 = _hyper_1_1_chunk.device_id)
|
||||
Bulk Decompression: false
|
||||
-> Index Scan using compress_hyper_5_15_chunk_c_index_2 on _timescaledb_internal.compress_hyper_5_15_chunk (actual rows=1 loops=2)
|
||||
Output: compress_hyper_5_15_chunk."time", compress_hyper_5_15_chunk.device_id, compress_hyper_5_15_chunk.device_id_peer, compress_hyper_5_15_chunk.v0, compress_hyper_5_15_chunk.v1, compress_hyper_5_15_chunk.v2, compress_hyper_5_15_chunk.v3, compress_hyper_5_15_chunk._ts_meta_count, compress_hyper_5_15_chunk._ts_meta_sequence_num, compress_hyper_5_15_chunk._ts_meta_min_3, compress_hyper_5_15_chunk._ts_meta_max_3, compress_hyper_5_15_chunk._ts_meta_min_1, compress_hyper_5_15_chunk._ts_meta_max_1, compress_hyper_5_15_chunk._ts_meta_min_2, compress_hyper_5_15_chunk._ts_meta_max_2
|
||||
@ -2265,12 +2262,11 @@ WHERE device_id IN (
|
||||
Rows Removed by Filter: 2016
|
||||
-> Custom Scan (DecompressChunk) on _timescaledb_internal._hyper_1_3_chunk (actual rows=504 loops=2)
|
||||
Output: _hyper_1_3_chunk.device_id_peer, _hyper_1_3_chunk.device_id
|
||||
Filter: ("*VALUES*".column1 = _hyper_1_3_chunk.device_id)
|
||||
Bulk Decompression: false
|
||||
-> Index Scan using compress_hyper_5_16_chunk_c_index_2 on _timescaledb_internal.compress_hyper_5_16_chunk (actual rows=1 loops=2)
|
||||
Output: compress_hyper_5_16_chunk."time", compress_hyper_5_16_chunk.device_id, compress_hyper_5_16_chunk.device_id_peer, compress_hyper_5_16_chunk.v0, compress_hyper_5_16_chunk.v1, compress_hyper_5_16_chunk.v2, compress_hyper_5_16_chunk.v3, compress_hyper_5_16_chunk._ts_meta_count, compress_hyper_5_16_chunk._ts_meta_sequence_num, compress_hyper_5_16_chunk._ts_meta_min_3, compress_hyper_5_16_chunk._ts_meta_max_3, compress_hyper_5_16_chunk._ts_meta_min_1, compress_hyper_5_16_chunk._ts_meta_max_1, compress_hyper_5_16_chunk._ts_meta_min_2, compress_hyper_5_16_chunk._ts_meta_max_2
|
||||
Index Cond: (compress_hyper_5_16_chunk.device_id = "*VALUES*".column1)
|
||||
(29 rows)
|
||||
(27 rows)
|
||||
|
||||
SET seq_page_cost = 100;
|
||||
-- loop/row counts of this query is different on windows so we run it without analyze
|
||||
@ -2352,7 +2348,6 @@ WHERE device_id IN (
|
||||
-> Append (actual rows=1368 loops=2)
|
||||
-> Custom Scan (DecompressChunk) on _timescaledb_internal._hyper_1_1_chunk (actual rows=360 loops=2)
|
||||
Output: _hyper_1_1_chunk.device_id_peer, _hyper_1_1_chunk.device_id
|
||||
Filter: ("*VALUES*".column1 = _hyper_1_1_chunk.device_id)
|
||||
Bulk Decompression: false
|
||||
-> Index Scan using compress_hyper_5_15_chunk_c_index_2 on _timescaledb_internal.compress_hyper_5_15_chunk (actual rows=1 loops=2)
|
||||
Output: compress_hyper_5_15_chunk."time", compress_hyper_5_15_chunk.device_id, compress_hyper_5_15_chunk.device_id_peer, compress_hyper_5_15_chunk.v0, compress_hyper_5_15_chunk.v1, compress_hyper_5_15_chunk.v2, compress_hyper_5_15_chunk.v3, compress_hyper_5_15_chunk._ts_meta_count, compress_hyper_5_15_chunk._ts_meta_sequence_num, compress_hyper_5_15_chunk._ts_meta_min_3, compress_hyper_5_15_chunk._ts_meta_max_3, compress_hyper_5_15_chunk._ts_meta_min_1, compress_hyper_5_15_chunk._ts_meta_max_1, compress_hyper_5_15_chunk._ts_meta_min_2, compress_hyper_5_15_chunk._ts_meta_max_2
|
||||
@ -2363,12 +2358,11 @@ WHERE device_id IN (
|
||||
Rows Removed by Filter: 2016
|
||||
-> Custom Scan (DecompressChunk) on _timescaledb_internal._hyper_1_3_chunk (actual rows=504 loops=2)
|
||||
Output: _hyper_1_3_chunk.device_id_peer, _hyper_1_3_chunk.device_id
|
||||
Filter: ("*VALUES*".column1 = _hyper_1_3_chunk.device_id)
|
||||
Bulk Decompression: false
|
||||
-> Index Scan using compress_hyper_5_16_chunk_c_index_2 on _timescaledb_internal.compress_hyper_5_16_chunk (actual rows=1 loops=2)
|
||||
Output: compress_hyper_5_16_chunk."time", compress_hyper_5_16_chunk.device_id, compress_hyper_5_16_chunk.device_id_peer, compress_hyper_5_16_chunk.v0, compress_hyper_5_16_chunk.v1, compress_hyper_5_16_chunk.v2, compress_hyper_5_16_chunk.v3, compress_hyper_5_16_chunk._ts_meta_count, compress_hyper_5_16_chunk._ts_meta_sequence_num, compress_hyper_5_16_chunk._ts_meta_min_3, compress_hyper_5_16_chunk._ts_meta_max_3, compress_hyper_5_16_chunk._ts_meta_min_1, compress_hyper_5_16_chunk._ts_meta_max_1, compress_hyper_5_16_chunk._ts_meta_min_2, compress_hyper_5_16_chunk._ts_meta_max_2
|
||||
Index Cond: (compress_hyper_5_16_chunk.device_id = "*VALUES*".column1)
|
||||
(29 rows)
|
||||
(27 rows)
|
||||
|
||||
-- test view
|
||||
CREATE OR REPLACE VIEW compressed_view AS
|
||||
@ -3182,7 +3176,7 @@ WHERE metrics.time > metrics_space.time
|
||||
-> Index Scan Backward using _hyper_2_12_chunk_metrics_space_device_id_device_id_peer_v0_v_2 on _hyper_2_12_chunk (actual rows=504 loops=1)
|
||||
-> Append (actual rows=0 loops=6840)
|
||||
-> Custom Scan (DecompressChunk) on _hyper_1_1_chunk (actual rows=0 loops=6840)
|
||||
Filter: (("time" > _hyper_2_4_chunk."time") AND ("time" < _hyper_2_4_chunk."time") AND (_hyper_2_4_chunk.device_id = device_id))
|
||||
Filter: (("time" > _hyper_2_4_chunk."time") AND ("time" < _hyper_2_4_chunk."time"))
|
||||
Rows Removed by Filter: 360
|
||||
-> Index Scan using compress_hyper_5_15_chunk_c_index_2 on compress_hyper_5_15_chunk (actual rows=1 loops=6840)
|
||||
Index Cond: (device_id = _hyper_2_4_chunk.device_id)
|
||||
@ -3190,7 +3184,7 @@ WHERE metrics.time > metrics_space.time
|
||||
Index Cond: (("time" > _hyper_2_4_chunk."time") AND ("time" < _hyper_2_4_chunk."time"))
|
||||
Filter: (_hyper_2_4_chunk.device_id = device_id)
|
||||
-> Custom Scan (DecompressChunk) on _hyper_1_3_chunk (actual rows=0 loops=6840)
|
||||
Filter: (("time" > _hyper_2_4_chunk."time") AND ("time" < _hyper_2_4_chunk."time") AND (_hyper_2_4_chunk.device_id = device_id))
|
||||
Filter: (("time" > _hyper_2_4_chunk."time") AND ("time" < _hyper_2_4_chunk."time"))
|
||||
Rows Removed by Filter: 504
|
||||
-> Index Scan using compress_hyper_5_16_chunk_c_index_2 on compress_hyper_5_16_chunk (actual rows=1 loops=6840)
|
||||
Index Cond: (device_id = _hyper_2_4_chunk.device_id)
|
||||
@ -6709,19 +6703,16 @@ WHERE device_id IN (
|
||||
-> Append
|
||||
-> Custom Scan (DecompressChunk) on _timescaledb_internal._hyper_2_4_chunk
|
||||
Output: _hyper_2_4_chunk.device_id_peer, _hyper_2_4_chunk.device_id
|
||||
Filter: ("*VALUES*".column1 = _hyper_2_4_chunk.device_id)
|
||||
-> Index Scan using compress_hyper_6_17_chunk_c_space_index_2 on _timescaledb_internal.compress_hyper_6_17_chunk
|
||||
Output: compress_hyper_6_17_chunk."time", compress_hyper_6_17_chunk.device_id, compress_hyper_6_17_chunk.device_id_peer, compress_hyper_6_17_chunk.v0, compress_hyper_6_17_chunk.v1, compress_hyper_6_17_chunk.v2, compress_hyper_6_17_chunk.v3, compress_hyper_6_17_chunk._ts_meta_count, compress_hyper_6_17_chunk._ts_meta_sequence_num, compress_hyper_6_17_chunk._ts_meta_min_3, compress_hyper_6_17_chunk._ts_meta_max_3, compress_hyper_6_17_chunk._ts_meta_min_1, compress_hyper_6_17_chunk._ts_meta_max_1, compress_hyper_6_17_chunk._ts_meta_min_2, compress_hyper_6_17_chunk._ts_meta_max_2
|
||||
Index Cond: (compress_hyper_6_17_chunk.device_id = "*VALUES*".column1)
|
||||
-> Custom Scan (DecompressChunk) on _timescaledb_internal._hyper_2_5_chunk
|
||||
Output: _hyper_2_5_chunk.device_id_peer, _hyper_2_5_chunk.device_id
|
||||
Filter: ("*VALUES*".column1 = _hyper_2_5_chunk.device_id)
|
||||
-> Index Scan using compress_hyper_6_18_chunk_c_space_index_2 on _timescaledb_internal.compress_hyper_6_18_chunk
|
||||
Output: compress_hyper_6_18_chunk."time", compress_hyper_6_18_chunk.device_id, compress_hyper_6_18_chunk.device_id_peer, compress_hyper_6_18_chunk.v0, compress_hyper_6_18_chunk.v1, compress_hyper_6_18_chunk.v2, compress_hyper_6_18_chunk.v3, compress_hyper_6_18_chunk._ts_meta_count, compress_hyper_6_18_chunk._ts_meta_sequence_num, compress_hyper_6_18_chunk._ts_meta_min_3, compress_hyper_6_18_chunk._ts_meta_max_3, compress_hyper_6_18_chunk._ts_meta_min_1, compress_hyper_6_18_chunk._ts_meta_max_1, compress_hyper_6_18_chunk._ts_meta_min_2, compress_hyper_6_18_chunk._ts_meta_max_2
|
||||
Index Cond: (compress_hyper_6_18_chunk.device_id = "*VALUES*".column1)
|
||||
-> Custom Scan (DecompressChunk) on _timescaledb_internal._hyper_2_6_chunk
|
||||
Output: _hyper_2_6_chunk.device_id_peer, _hyper_2_6_chunk.device_id
|
||||
Filter: ("*VALUES*".column1 = _hyper_2_6_chunk.device_id)
|
||||
-> Index Scan using compress_hyper_6_19_chunk_c_space_index_2 on _timescaledb_internal.compress_hyper_6_19_chunk
|
||||
Output: compress_hyper_6_19_chunk."time", compress_hyper_6_19_chunk.device_id, compress_hyper_6_19_chunk.device_id_peer, compress_hyper_6_19_chunk.v0, compress_hyper_6_19_chunk.v1, compress_hyper_6_19_chunk.v2, compress_hyper_6_19_chunk.v3, compress_hyper_6_19_chunk._ts_meta_count, compress_hyper_6_19_chunk._ts_meta_sequence_num, compress_hyper_6_19_chunk._ts_meta_min_3, compress_hyper_6_19_chunk._ts_meta_max_3, compress_hyper_6_19_chunk._ts_meta_min_1, compress_hyper_6_19_chunk._ts_meta_max_1, compress_hyper_6_19_chunk._ts_meta_min_2, compress_hyper_6_19_chunk._ts_meta_max_2
|
||||
Index Cond: (compress_hyper_6_19_chunk.device_id = "*VALUES*".column1)
|
||||
@ -6736,20 +6727,18 @@ WHERE device_id IN (
|
||||
Index Cond: (_hyper_2_9_chunk.device_id = "*VALUES*".column1)
|
||||
-> Custom Scan (DecompressChunk) on _timescaledb_internal._hyper_2_10_chunk
|
||||
Output: _hyper_2_10_chunk.device_id_peer, _hyper_2_10_chunk.device_id
|
||||
Filter: ("*VALUES*".column1 = _hyper_2_10_chunk.device_id)
|
||||
-> Index Scan using compress_hyper_6_20_chunk_c_space_index_2 on _timescaledb_internal.compress_hyper_6_20_chunk
|
||||
Output: compress_hyper_6_20_chunk."time", compress_hyper_6_20_chunk.device_id, compress_hyper_6_20_chunk.device_id_peer, compress_hyper_6_20_chunk.v0, compress_hyper_6_20_chunk.v1, compress_hyper_6_20_chunk.v2, compress_hyper_6_20_chunk.v3, compress_hyper_6_20_chunk._ts_meta_count, compress_hyper_6_20_chunk._ts_meta_sequence_num, compress_hyper_6_20_chunk._ts_meta_min_3, compress_hyper_6_20_chunk._ts_meta_max_3, compress_hyper_6_20_chunk._ts_meta_min_1, compress_hyper_6_20_chunk._ts_meta_max_1, compress_hyper_6_20_chunk._ts_meta_min_2, compress_hyper_6_20_chunk._ts_meta_max_2
|
||||
Index Cond: (compress_hyper_6_20_chunk.device_id = "*VALUES*".column1)
|
||||
-> Custom Scan (DecompressChunk) on _timescaledb_internal._hyper_2_11_chunk
|
||||
Output: _hyper_2_11_chunk.device_id_peer, _hyper_2_11_chunk.device_id
|
||||
Filter: ("*VALUES*".column1 = _hyper_2_11_chunk.device_id)
|
||||
-> Index Scan using compress_hyper_6_21_chunk_c_space_index_2 on _timescaledb_internal.compress_hyper_6_21_chunk
|
||||
Output: compress_hyper_6_21_chunk."time", compress_hyper_6_21_chunk.device_id, compress_hyper_6_21_chunk.device_id_peer, compress_hyper_6_21_chunk.v0, compress_hyper_6_21_chunk.v1, compress_hyper_6_21_chunk.v2, compress_hyper_6_21_chunk.v3, compress_hyper_6_21_chunk._ts_meta_count, compress_hyper_6_21_chunk._ts_meta_sequence_num, compress_hyper_6_21_chunk._ts_meta_min_3, compress_hyper_6_21_chunk._ts_meta_max_3, compress_hyper_6_21_chunk._ts_meta_min_1, compress_hyper_6_21_chunk._ts_meta_max_1, compress_hyper_6_21_chunk._ts_meta_min_2, compress_hyper_6_21_chunk._ts_meta_max_2
|
||||
Index Cond: (compress_hyper_6_21_chunk.device_id = "*VALUES*".column1)
|
||||
-> Index Only Scan using _hyper_2_12_chunk_metrics_space_device_id_device_id_peer_v0_v_2 on _timescaledb_internal._hyper_2_12_chunk
|
||||
Output: _hyper_2_12_chunk.device_id_peer, _hyper_2_12_chunk.device_id
|
||||
Index Cond: (_hyper_2_12_chunk.device_id = "*VALUES*".column1)
|
||||
(52 rows)
|
||||
(47 rows)
|
||||
|
||||
RESET seq_page_cost;
|
||||
:PREFIX_VERBOSE
|
||||
@ -8090,7 +8079,7 @@ WHERE metrics.time > metrics_space.time
|
||||
-> Index Scan Backward using _hyper_2_12_chunk_metrics_space_device_id_device_id_peer_v0_v_2 on _hyper_2_12_chunk (actual rows=504 loops=1)
|
||||
-> Append (actual rows=0 loops=6840)
|
||||
-> Custom Scan (DecompressChunk) on _hyper_1_1_chunk (actual rows=0 loops=6840)
|
||||
Filter: (("time" > _hyper_2_4_chunk."time") AND ("time" < _hyper_2_4_chunk."time") AND (_hyper_2_4_chunk.device_id = device_id))
|
||||
Filter: (("time" > _hyper_2_4_chunk."time") AND ("time" < _hyper_2_4_chunk."time"))
|
||||
Rows Removed by Filter: 360
|
||||
-> Index Scan using compress_hyper_5_15_chunk_c_index_2 on compress_hyper_5_15_chunk (actual rows=1 loops=6840)
|
||||
Index Cond: (device_id = _hyper_2_4_chunk.device_id)
|
||||
@ -8098,7 +8087,7 @@ WHERE metrics.time > metrics_space.time
|
||||
Index Cond: (("time" > _hyper_2_4_chunk."time") AND ("time" < _hyper_2_4_chunk."time"))
|
||||
Filter: (_hyper_2_4_chunk.device_id = device_id)
|
||||
-> Custom Scan (DecompressChunk) on _hyper_1_3_chunk (actual rows=0 loops=6840)
|
||||
Filter: (("time" > _hyper_2_4_chunk."time") AND ("time" < _hyper_2_4_chunk."time") AND (_hyper_2_4_chunk.device_id = device_id))
|
||||
Filter: (("time" > _hyper_2_4_chunk."time") AND ("time" < _hyper_2_4_chunk."time"))
|
||||
Rows Removed by Filter: 504
|
||||
-> Index Scan using compress_hyper_5_16_chunk_c_index_2 on compress_hyper_5_16_chunk (actual rows=1 loops=6840)
|
||||
Index Cond: (device_id = _hyper_2_4_chunk.device_id)
|
||||
|
@ -2186,7 +2186,6 @@ WHERE device_id_peer IN (
|
||||
-> Append (actual rows=0 loops=2)
|
||||
-> Custom Scan (DecompressChunk) on _timescaledb_internal._hyper_1_1_chunk (actual rows=0 loops=2)
|
||||
Output: _hyper_1_1_chunk.device_id_peer
|
||||
Filter: ("*VALUES*".column1 = _hyper_1_1_chunk.device_id_peer)
|
||||
Bulk Decompression: false
|
||||
-> Index Scan using compress_hyper_5_15_chunk__compressed_hypertable_5_device_id_pe on _timescaledb_internal.compress_hyper_5_15_chunk (actual rows=0 loops=2)
|
||||
Output: compress_hyper_5_15_chunk."time", compress_hyper_5_15_chunk.device_id, compress_hyper_5_15_chunk.device_id_peer, compress_hyper_5_15_chunk.v0, compress_hyper_5_15_chunk.v1, compress_hyper_5_15_chunk.v2, compress_hyper_5_15_chunk.v3, compress_hyper_5_15_chunk._ts_meta_count, compress_hyper_5_15_chunk._ts_meta_sequence_num, compress_hyper_5_15_chunk._ts_meta_min_3, compress_hyper_5_15_chunk._ts_meta_max_3, compress_hyper_5_15_chunk._ts_meta_min_1, compress_hyper_5_15_chunk._ts_meta_max_1, compress_hyper_5_15_chunk._ts_meta_min_2, compress_hyper_5_15_chunk._ts_meta_max_2
|
||||
@ -2197,12 +2196,11 @@ WHERE device_id_peer IN (
|
||||
Rows Removed by Filter: 2520
|
||||
-> Custom Scan (DecompressChunk) on _timescaledb_internal._hyper_1_3_chunk (actual rows=0 loops=2)
|
||||
Output: _hyper_1_3_chunk.device_id_peer
|
||||
Filter: ("*VALUES*".column1 = _hyper_1_3_chunk.device_id_peer)
|
||||
Bulk Decompression: false
|
||||
-> Index Scan using compress_hyper_5_16_chunk__compressed_hypertable_5_device_id_pe on _timescaledb_internal.compress_hyper_5_16_chunk (actual rows=0 loops=2)
|
||||
Output: compress_hyper_5_16_chunk."time", compress_hyper_5_16_chunk.device_id, compress_hyper_5_16_chunk.device_id_peer, compress_hyper_5_16_chunk.v0, compress_hyper_5_16_chunk.v1, compress_hyper_5_16_chunk.v2, compress_hyper_5_16_chunk.v3, compress_hyper_5_16_chunk._ts_meta_count, compress_hyper_5_16_chunk._ts_meta_sequence_num, compress_hyper_5_16_chunk._ts_meta_min_3, compress_hyper_5_16_chunk._ts_meta_max_3, compress_hyper_5_16_chunk._ts_meta_min_1, compress_hyper_5_16_chunk._ts_meta_max_1, compress_hyper_5_16_chunk._ts_meta_min_2, compress_hyper_5_16_chunk._ts_meta_max_2
|
||||
Index Cond: (compress_hyper_5_16_chunk.device_id_peer = "*VALUES*".column1)
|
||||
(29 rows)
|
||||
(27 rows)
|
||||
|
||||
RESET enable_hashjoin;
|
||||
:PREFIX_VERBOSE
|
||||
@ -2255,7 +2253,6 @@ WHERE device_id IN (
|
||||
-> Append (actual rows=1368 loops=2)
|
||||
-> Custom Scan (DecompressChunk) on _timescaledb_internal._hyper_1_1_chunk (actual rows=360 loops=2)
|
||||
Output: _hyper_1_1_chunk.device_id_peer, _hyper_1_1_chunk.device_id
|
||||
Filter: ("*VALUES*".column1 = _hyper_1_1_chunk.device_id)
|
||||
Bulk Decompression: false
|
||||
-> Index Scan using compress_hyper_5_15_chunk_c_index_2 on _timescaledb_internal.compress_hyper_5_15_chunk (actual rows=1 loops=2)
|
||||
Output: compress_hyper_5_15_chunk."time", compress_hyper_5_15_chunk.device_id, compress_hyper_5_15_chunk.device_id_peer, compress_hyper_5_15_chunk.v0, compress_hyper_5_15_chunk.v1, compress_hyper_5_15_chunk.v2, compress_hyper_5_15_chunk.v3, compress_hyper_5_15_chunk._ts_meta_count, compress_hyper_5_15_chunk._ts_meta_sequence_num, compress_hyper_5_15_chunk._ts_meta_min_3, compress_hyper_5_15_chunk._ts_meta_max_3, compress_hyper_5_15_chunk._ts_meta_min_1, compress_hyper_5_15_chunk._ts_meta_max_1, compress_hyper_5_15_chunk._ts_meta_min_2, compress_hyper_5_15_chunk._ts_meta_max_2
|
||||
@ -2266,12 +2263,11 @@ WHERE device_id IN (
|
||||
Rows Removed by Filter: 2016
|
||||
-> Custom Scan (DecompressChunk) on _timescaledb_internal._hyper_1_3_chunk (actual rows=504 loops=2)
|
||||
Output: _hyper_1_3_chunk.device_id_peer, _hyper_1_3_chunk.device_id
|
||||
Filter: ("*VALUES*".column1 = _hyper_1_3_chunk.device_id)
|
||||
Bulk Decompression: false
|
||||
-> Index Scan using compress_hyper_5_16_chunk_c_index_2 on _timescaledb_internal.compress_hyper_5_16_chunk (actual rows=1 loops=2)
|
||||
Output: compress_hyper_5_16_chunk."time", compress_hyper_5_16_chunk.device_id, compress_hyper_5_16_chunk.device_id_peer, compress_hyper_5_16_chunk.v0, compress_hyper_5_16_chunk.v1, compress_hyper_5_16_chunk.v2, compress_hyper_5_16_chunk.v3, compress_hyper_5_16_chunk._ts_meta_count, compress_hyper_5_16_chunk._ts_meta_sequence_num, compress_hyper_5_16_chunk._ts_meta_min_3, compress_hyper_5_16_chunk._ts_meta_max_3, compress_hyper_5_16_chunk._ts_meta_min_1, compress_hyper_5_16_chunk._ts_meta_max_1, compress_hyper_5_16_chunk._ts_meta_min_2, compress_hyper_5_16_chunk._ts_meta_max_2
|
||||
Index Cond: (compress_hyper_5_16_chunk.device_id = "*VALUES*".column1)
|
||||
(29 rows)
|
||||
(27 rows)
|
||||
|
||||
SET seq_page_cost = 100;
|
||||
-- loop/row counts of this query is different on windows so we run it without analyze
|
||||
@ -2353,7 +2349,6 @@ WHERE device_id IN (
|
||||
-> Append (actual rows=1368 loops=2)
|
||||
-> Custom Scan (DecompressChunk) on _timescaledb_internal._hyper_1_1_chunk (actual rows=360 loops=2)
|
||||
Output: _hyper_1_1_chunk.device_id_peer, _hyper_1_1_chunk.device_id
|
||||
Filter: ("*VALUES*".column1 = _hyper_1_1_chunk.device_id)
|
||||
Bulk Decompression: false
|
||||
-> Index Scan using compress_hyper_5_15_chunk_c_index_2 on _timescaledb_internal.compress_hyper_5_15_chunk (actual rows=1 loops=2)
|
||||
Output: compress_hyper_5_15_chunk."time", compress_hyper_5_15_chunk.device_id, compress_hyper_5_15_chunk.device_id_peer, compress_hyper_5_15_chunk.v0, compress_hyper_5_15_chunk.v1, compress_hyper_5_15_chunk.v2, compress_hyper_5_15_chunk.v3, compress_hyper_5_15_chunk._ts_meta_count, compress_hyper_5_15_chunk._ts_meta_sequence_num, compress_hyper_5_15_chunk._ts_meta_min_3, compress_hyper_5_15_chunk._ts_meta_max_3, compress_hyper_5_15_chunk._ts_meta_min_1, compress_hyper_5_15_chunk._ts_meta_max_1, compress_hyper_5_15_chunk._ts_meta_min_2, compress_hyper_5_15_chunk._ts_meta_max_2
|
||||
@ -2364,12 +2359,11 @@ WHERE device_id IN (
|
||||
Rows Removed by Filter: 2016
|
||||
-> Custom Scan (DecompressChunk) on _timescaledb_internal._hyper_1_3_chunk (actual rows=504 loops=2)
|
||||
Output: _hyper_1_3_chunk.device_id_peer, _hyper_1_3_chunk.device_id
|
||||
Filter: ("*VALUES*".column1 = _hyper_1_3_chunk.device_id)
|
||||
Bulk Decompression: false
|
||||
-> Index Scan using compress_hyper_5_16_chunk_c_index_2 on _timescaledb_internal.compress_hyper_5_16_chunk (actual rows=1 loops=2)
|
||||
Output: compress_hyper_5_16_chunk."time", compress_hyper_5_16_chunk.device_id, compress_hyper_5_16_chunk.device_id_peer, compress_hyper_5_16_chunk.v0, compress_hyper_5_16_chunk.v1, compress_hyper_5_16_chunk.v2, compress_hyper_5_16_chunk.v3, compress_hyper_5_16_chunk._ts_meta_count, compress_hyper_5_16_chunk._ts_meta_sequence_num, compress_hyper_5_16_chunk._ts_meta_min_3, compress_hyper_5_16_chunk._ts_meta_max_3, compress_hyper_5_16_chunk._ts_meta_min_1, compress_hyper_5_16_chunk._ts_meta_max_1, compress_hyper_5_16_chunk._ts_meta_min_2, compress_hyper_5_16_chunk._ts_meta_max_2
|
||||
Index Cond: (compress_hyper_5_16_chunk.device_id = "*VALUES*".column1)
|
||||
(29 rows)
|
||||
(27 rows)
|
||||
|
||||
-- test view
|
||||
CREATE OR REPLACE VIEW compressed_view AS
|
||||
@ -3183,7 +3177,7 @@ WHERE metrics.time > metrics_space.time
|
||||
-> Index Scan Backward using _hyper_2_12_chunk_metrics_space_device_id_device_id_peer_v0_v_2 on _hyper_2_12_chunk (actual rows=504 loops=1)
|
||||
-> Append (actual rows=0 loops=6840)
|
||||
-> Custom Scan (DecompressChunk) on _hyper_1_1_chunk (actual rows=0 loops=6840)
|
||||
Filter: (("time" > _hyper_2_4_chunk."time") AND ("time" < _hyper_2_4_chunk."time") AND (_hyper_2_4_chunk.device_id = device_id))
|
||||
Filter: (("time" > _hyper_2_4_chunk."time") AND ("time" < _hyper_2_4_chunk."time"))
|
||||
Rows Removed by Filter: 360
|
||||
-> Index Scan using compress_hyper_5_15_chunk_c_index_2 on compress_hyper_5_15_chunk (actual rows=1 loops=6840)
|
||||
Index Cond: (device_id = _hyper_2_4_chunk.device_id)
|
||||
@ -3191,7 +3185,7 @@ WHERE metrics.time > metrics_space.time
|
||||
Index Cond: (("time" > _hyper_2_4_chunk."time") AND ("time" < _hyper_2_4_chunk."time"))
|
||||
Filter: (_hyper_2_4_chunk.device_id = device_id)
|
||||
-> Custom Scan (DecompressChunk) on _hyper_1_3_chunk (actual rows=0 loops=6840)
|
||||
Filter: (("time" > _hyper_2_4_chunk."time") AND ("time" < _hyper_2_4_chunk."time") AND (_hyper_2_4_chunk.device_id = device_id))
|
||||
Filter: (("time" > _hyper_2_4_chunk."time") AND ("time" < _hyper_2_4_chunk."time"))
|
||||
Rows Removed by Filter: 504
|
||||
-> Index Scan using compress_hyper_5_16_chunk_c_index_2 on compress_hyper_5_16_chunk (actual rows=1 loops=6840)
|
||||
Index Cond: (device_id = _hyper_2_4_chunk.device_id)
|
||||
@ -6711,19 +6705,16 @@ WHERE device_id IN (
|
||||
-> Append
|
||||
-> Custom Scan (DecompressChunk) on _timescaledb_internal._hyper_2_4_chunk
|
||||
Output: _hyper_2_4_chunk.device_id_peer, _hyper_2_4_chunk.device_id
|
||||
Filter: ("*VALUES*".column1 = _hyper_2_4_chunk.device_id)
|
||||
-> Index Scan using compress_hyper_6_17_chunk_c_space_index_2 on _timescaledb_internal.compress_hyper_6_17_chunk
|
||||
Output: compress_hyper_6_17_chunk."time", compress_hyper_6_17_chunk.device_id, compress_hyper_6_17_chunk.device_id_peer, compress_hyper_6_17_chunk.v0, compress_hyper_6_17_chunk.v1, compress_hyper_6_17_chunk.v2, compress_hyper_6_17_chunk.v3, compress_hyper_6_17_chunk._ts_meta_count, compress_hyper_6_17_chunk._ts_meta_sequence_num, compress_hyper_6_17_chunk._ts_meta_min_3, compress_hyper_6_17_chunk._ts_meta_max_3, compress_hyper_6_17_chunk._ts_meta_min_1, compress_hyper_6_17_chunk._ts_meta_max_1, compress_hyper_6_17_chunk._ts_meta_min_2, compress_hyper_6_17_chunk._ts_meta_max_2
|
||||
Index Cond: (compress_hyper_6_17_chunk.device_id = "*VALUES*".column1)
|
||||
-> Custom Scan (DecompressChunk) on _timescaledb_internal._hyper_2_5_chunk
|
||||
Output: _hyper_2_5_chunk.device_id_peer, _hyper_2_5_chunk.device_id
|
||||
Filter: ("*VALUES*".column1 = _hyper_2_5_chunk.device_id)
|
||||
-> Index Scan using compress_hyper_6_18_chunk_c_space_index_2 on _timescaledb_internal.compress_hyper_6_18_chunk
|
||||
Output: compress_hyper_6_18_chunk."time", compress_hyper_6_18_chunk.device_id, compress_hyper_6_18_chunk.device_id_peer, compress_hyper_6_18_chunk.v0, compress_hyper_6_18_chunk.v1, compress_hyper_6_18_chunk.v2, compress_hyper_6_18_chunk.v3, compress_hyper_6_18_chunk._ts_meta_count, compress_hyper_6_18_chunk._ts_meta_sequence_num, compress_hyper_6_18_chunk._ts_meta_min_3, compress_hyper_6_18_chunk._ts_meta_max_3, compress_hyper_6_18_chunk._ts_meta_min_1, compress_hyper_6_18_chunk._ts_meta_max_1, compress_hyper_6_18_chunk._ts_meta_min_2, compress_hyper_6_18_chunk._ts_meta_max_2
|
||||
Index Cond: (compress_hyper_6_18_chunk.device_id = "*VALUES*".column1)
|
||||
-> Custom Scan (DecompressChunk) on _timescaledb_internal._hyper_2_6_chunk
|
||||
Output: _hyper_2_6_chunk.device_id_peer, _hyper_2_6_chunk.device_id
|
||||
Filter: ("*VALUES*".column1 = _hyper_2_6_chunk.device_id)
|
||||
-> Index Scan using compress_hyper_6_19_chunk_c_space_index_2 on _timescaledb_internal.compress_hyper_6_19_chunk
|
||||
Output: compress_hyper_6_19_chunk."time", compress_hyper_6_19_chunk.device_id, compress_hyper_6_19_chunk.device_id_peer, compress_hyper_6_19_chunk.v0, compress_hyper_6_19_chunk.v1, compress_hyper_6_19_chunk.v2, compress_hyper_6_19_chunk.v3, compress_hyper_6_19_chunk._ts_meta_count, compress_hyper_6_19_chunk._ts_meta_sequence_num, compress_hyper_6_19_chunk._ts_meta_min_3, compress_hyper_6_19_chunk._ts_meta_max_3, compress_hyper_6_19_chunk._ts_meta_min_1, compress_hyper_6_19_chunk._ts_meta_max_1, compress_hyper_6_19_chunk._ts_meta_min_2, compress_hyper_6_19_chunk._ts_meta_max_2
|
||||
Index Cond: (compress_hyper_6_19_chunk.device_id = "*VALUES*".column1)
|
||||
@ -6738,20 +6729,18 @@ WHERE device_id IN (
|
||||
Index Cond: (_hyper_2_9_chunk.device_id = "*VALUES*".column1)
|
||||
-> Custom Scan (DecompressChunk) on _timescaledb_internal._hyper_2_10_chunk
|
||||
Output: _hyper_2_10_chunk.device_id_peer, _hyper_2_10_chunk.device_id
|
||||
Filter: ("*VALUES*".column1 = _hyper_2_10_chunk.device_id)
|
||||
-> Index Scan using compress_hyper_6_20_chunk_c_space_index_2 on _timescaledb_internal.compress_hyper_6_20_chunk
|
||||
Output: compress_hyper_6_20_chunk."time", compress_hyper_6_20_chunk.device_id, compress_hyper_6_20_chunk.device_id_peer, compress_hyper_6_20_chunk.v0, compress_hyper_6_20_chunk.v1, compress_hyper_6_20_chunk.v2, compress_hyper_6_20_chunk.v3, compress_hyper_6_20_chunk._ts_meta_count, compress_hyper_6_20_chunk._ts_meta_sequence_num, compress_hyper_6_20_chunk._ts_meta_min_3, compress_hyper_6_20_chunk._ts_meta_max_3, compress_hyper_6_20_chunk._ts_meta_min_1, compress_hyper_6_20_chunk._ts_meta_max_1, compress_hyper_6_20_chunk._ts_meta_min_2, compress_hyper_6_20_chunk._ts_meta_max_2
|
||||
Index Cond: (compress_hyper_6_20_chunk.device_id = "*VALUES*".column1)
|
||||
-> Custom Scan (DecompressChunk) on _timescaledb_internal._hyper_2_11_chunk
|
||||
Output: _hyper_2_11_chunk.device_id_peer, _hyper_2_11_chunk.device_id
|
||||
Filter: ("*VALUES*".column1 = _hyper_2_11_chunk.device_id)
|
||||
-> Index Scan using compress_hyper_6_21_chunk_c_space_index_2 on _timescaledb_internal.compress_hyper_6_21_chunk
|
||||
Output: compress_hyper_6_21_chunk."time", compress_hyper_6_21_chunk.device_id, compress_hyper_6_21_chunk.device_id_peer, compress_hyper_6_21_chunk.v0, compress_hyper_6_21_chunk.v1, compress_hyper_6_21_chunk.v2, compress_hyper_6_21_chunk.v3, compress_hyper_6_21_chunk._ts_meta_count, compress_hyper_6_21_chunk._ts_meta_sequence_num, compress_hyper_6_21_chunk._ts_meta_min_3, compress_hyper_6_21_chunk._ts_meta_max_3, compress_hyper_6_21_chunk._ts_meta_min_1, compress_hyper_6_21_chunk._ts_meta_max_1, compress_hyper_6_21_chunk._ts_meta_min_2, compress_hyper_6_21_chunk._ts_meta_max_2
|
||||
Index Cond: (compress_hyper_6_21_chunk.device_id = "*VALUES*".column1)
|
||||
-> Index Only Scan using _hyper_2_12_chunk_metrics_space_device_id_device_id_peer_v0_v_2 on _timescaledb_internal._hyper_2_12_chunk
|
||||
Output: _hyper_2_12_chunk.device_id_peer, _hyper_2_12_chunk.device_id
|
||||
Index Cond: (_hyper_2_12_chunk.device_id = "*VALUES*".column1)
|
||||
(52 rows)
|
||||
(47 rows)
|
||||
|
||||
RESET seq_page_cost;
|
||||
:PREFIX_VERBOSE
|
||||
@ -8092,7 +8081,7 @@ WHERE metrics.time > metrics_space.time
|
||||
-> Index Scan Backward using _hyper_2_12_chunk_metrics_space_device_id_device_id_peer_v0_v_2 on _hyper_2_12_chunk (actual rows=504 loops=1)
|
||||
-> Append (actual rows=0 loops=6840)
|
||||
-> Custom Scan (DecompressChunk) on _hyper_1_1_chunk (actual rows=0 loops=6840)
|
||||
Filter: (("time" > _hyper_2_4_chunk."time") AND ("time" < _hyper_2_4_chunk."time") AND (_hyper_2_4_chunk.device_id = device_id))
|
||||
Filter: (("time" > _hyper_2_4_chunk."time") AND ("time" < _hyper_2_4_chunk."time"))
|
||||
Rows Removed by Filter: 360
|
||||
-> Index Scan using compress_hyper_5_15_chunk_c_index_2 on compress_hyper_5_15_chunk (actual rows=1 loops=6840)
|
||||
Index Cond: (device_id = _hyper_2_4_chunk.device_id)
|
||||
@ -8100,7 +8089,7 @@ WHERE metrics.time > metrics_space.time
|
||||
Index Cond: (("time" > _hyper_2_4_chunk."time") AND ("time" < _hyper_2_4_chunk."time"))
|
||||
Filter: (_hyper_2_4_chunk.device_id = device_id)
|
||||
-> Custom Scan (DecompressChunk) on _hyper_1_3_chunk (actual rows=0 loops=6840)
|
||||
Filter: (("time" > _hyper_2_4_chunk."time") AND ("time" < _hyper_2_4_chunk."time") AND (_hyper_2_4_chunk.device_id = device_id))
|
||||
Filter: (("time" > _hyper_2_4_chunk."time") AND ("time" < _hyper_2_4_chunk."time"))
|
||||
Rows Removed by Filter: 504
|
||||
-> Index Scan using compress_hyper_5_16_chunk_c_index_2 on compress_hyper_5_16_chunk (actual rows=1 loops=6840)
|
||||
Index Cond: (device_id = _hyper_2_4_chunk.device_id)
|
||||
|
@ -53,8 +53,8 @@ test inner join query_params q
|
||||
on q.a = test.a and q.b = test.b
|
||||
where test.time between '2020-01-01 00:00' and '2020-01-01 00:02'
|
||||
order by test.time;
|
||||
QUERY PLAN
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
QUERY PLAN
|
||||
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
Sort
|
||||
Sort Key: _hyper_1_1_chunk."time"
|
||||
-> Nested Loop
|
||||
@ -64,7 +64,7 @@ order by test.time;
|
||||
-> Seq Scan on test_copy
|
||||
Filter: (((a)::text = ANY ('{lat,lon}'::text[])) AND (b = 1))
|
||||
-> Custom Scan (DecompressChunk) on _hyper_1_1_chunk
|
||||
Filter: (("time" >= 'Wed Jan 01 00:00:00 2020 PST'::timestamp with time zone) AND ("time" <= 'Wed Jan 01 00:02:00 2020 PST'::timestamp with time zone) AND ((test_copy.a)::text = (a)::text) AND (test_copy.b = b))
|
||||
Filter: (("time" >= 'Wed Jan 01 00:00:00 2020 PST'::timestamp with time zone) AND ("time" <= 'Wed Jan 01 00:02:00 2020 PST'::timestamp with time zone))
|
||||
-> Index Scan using compress_hyper_2_2_chunk__compressed_hypertable_2_a_b__ts_meta_ on compress_hyper_2_2_chunk
|
||||
Index Cond: ((a = (test_copy.a)::text) AND (b = test_copy.b))
|
||||
Filter: ((_ts_meta_max_1 >= 'Wed Jan 01 00:00:00 2020 PST'::timestamp with time zone) AND (_ts_meta_min_1 <= 'Wed Jan 01 00:02:00 2020 PST'::timestamp with time zone))
|
||||
|
@ -637,12 +637,12 @@ FROM metrics_ordered_idx met join lookup
|
||||
ON met.device_id = lookup.did and met.v0 = lookup.version
|
||||
WHERE met.time > '2000-01-19 19:00:00-05'
|
||||
and met.time < '2000-01-20 20:00:00-05';
|
||||
QUERY PLAN
|
||||
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
QUERY PLAN
|
||||
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
Nested Loop (actual rows=2 loops=1)
|
||||
-> Values Scan on "*VALUES*" (actual rows=2 loops=1)
|
||||
-> Custom Scan (DecompressChunk) on _hyper_1_3_chunk met (actual rows=1 loops=2)
|
||||
Filter: (("time" > 'Wed Jan 19 16:00:00 2000 PST'::timestamp with time zone) AND ("time" < 'Thu Jan 20 17:00:00 2000 PST'::timestamp with time zone) AND ("*VALUES*".column1 = device_id) AND ("*VALUES*".column2 = v0))
|
||||
Filter: (("time" > 'Wed Jan 19 16:00:00 2000 PST'::timestamp with time zone) AND ("time" < 'Thu Jan 20 17:00:00 2000 PST'::timestamp with time zone) AND ("*VALUES*".column2 = v0))
|
||||
Rows Removed by Filter: 47
|
||||
-> Index Scan using compress_hyper_2_8_chunk__compressed_hypertable_2_device_id_dev on compress_hyper_2_8_chunk (actual rows=1 loops=2)
|
||||
Index Cond: (device_id = "*VALUES*".column1)
|
||||
@ -703,8 +703,8 @@ JOIN LATERAL
|
||||
WHERE node = f1.device_id) q
|
||||
ON met.device_id = q.node and met.device_id_peer = q.device_id_peer
|
||||
and met.v0 = q.v0 and met.v0 > 2 and time = '2018-01-19 20:00:00-05';
|
||||
QUERY PLAN
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
QUERY PLAN
|
||||
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
Nested Loop (actual rows=1 loops=1)
|
||||
Join Filter: (nodetime.node = met.device_id)
|
||||
-> Nested Loop (actual rows=1 loops=1)
|
||||
@ -713,7 +713,7 @@ ON met.device_id = q.node and met.device_id_peer = q.device_id_peer
|
||||
-> Seq Scan on nodetime (actual rows=1 loops=1)
|
||||
-> Values Scan on "*VALUES*" (actual rows=2 loops=1)
|
||||
-> Custom Scan (DecompressChunk) on _hyper_1_4_chunk met (actual rows=1 loops=1)
|
||||
Filter: ((v0 > 2) AND ("time" = 'Fri Jan 19 17:00:00 2018 PST'::timestamp with time zone) AND ("*VALUES*".column1 = device_id) AND ("*VALUES*".column2 = device_id_peer) AND ("*VALUES*".column3 = v0))
|
||||
Filter: ((v0 > 2) AND ("time" = 'Fri Jan 19 17:00:00 2018 PST'::timestamp with time zone) AND ("*VALUES*".column3 = v0))
|
||||
Rows Removed by Filter: 47
|
||||
-> Index Scan using compress_hyper_2_9_chunk__compressed_hypertable_2_device_id_dev on compress_hyper_2_9_chunk (actual rows=1 loops=1)
|
||||
Index Cond: ((device_id = "*VALUES*".column1) AND (device_id_peer = "*VALUES*".column2))
|
||||
|
@ -637,12 +637,12 @@ FROM metrics_ordered_idx met join lookup
|
||||
ON met.device_id = lookup.did and met.v0 = lookup.version
|
||||
WHERE met.time > '2000-01-19 19:00:00-05'
|
||||
and met.time < '2000-01-20 20:00:00-05';
|
||||
QUERY PLAN
|
||||
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
QUERY PLAN
|
||||
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
Nested Loop (actual rows=2 loops=1)
|
||||
-> Values Scan on "*VALUES*" (actual rows=2 loops=1)
|
||||
-> Custom Scan (DecompressChunk) on _hyper_1_3_chunk met (actual rows=1 loops=2)
|
||||
Filter: (("time" > 'Wed Jan 19 16:00:00 2000 PST'::timestamp with time zone) AND ("time" < 'Thu Jan 20 17:00:00 2000 PST'::timestamp with time zone) AND ("*VALUES*".column1 = device_id) AND ("*VALUES*".column2 = v0))
|
||||
Filter: (("time" > 'Wed Jan 19 16:00:00 2000 PST'::timestamp with time zone) AND ("time" < 'Thu Jan 20 17:00:00 2000 PST'::timestamp with time zone) AND ("*VALUES*".column2 = v0))
|
||||
Rows Removed by Filter: 47
|
||||
-> Index Scan using compress_hyper_2_8_chunk__compressed_hypertable_2_device_id_dev on compress_hyper_2_8_chunk (actual rows=1 loops=2)
|
||||
Index Cond: (device_id = "*VALUES*".column1)
|
||||
@ -703,8 +703,8 @@ JOIN LATERAL
|
||||
WHERE node = f1.device_id) q
|
||||
ON met.device_id = q.node and met.device_id_peer = q.device_id_peer
|
||||
and met.v0 = q.v0 and met.v0 > 2 and time = '2018-01-19 20:00:00-05';
|
||||
QUERY PLAN
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
QUERY PLAN
|
||||
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
Nested Loop (actual rows=1 loops=1)
|
||||
Join Filter: (nodetime.node = met.device_id)
|
||||
-> Nested Loop (actual rows=1 loops=1)
|
||||
@ -713,7 +713,7 @@ ON met.device_id = q.node and met.device_id_peer = q.device_id_peer
|
||||
-> Seq Scan on nodetime (actual rows=1 loops=1)
|
||||
-> Values Scan on "*VALUES*" (actual rows=2 loops=1)
|
||||
-> Custom Scan (DecompressChunk) on _hyper_1_4_chunk met (actual rows=1 loops=1)
|
||||
Filter: ((v0 > 2) AND ("time" = 'Fri Jan 19 17:00:00 2018 PST'::timestamp with time zone) AND ("*VALUES*".column1 = device_id) AND ("*VALUES*".column2 = device_id_peer) AND ("*VALUES*".column3 = v0))
|
||||
Filter: ((v0 > 2) AND ("time" = 'Fri Jan 19 17:00:00 2018 PST'::timestamp with time zone) AND ("*VALUES*".column3 = v0))
|
||||
Rows Removed by Filter: 47
|
||||
-> Index Scan using compress_hyper_2_9_chunk__compressed_hypertable_2_device_id_dev on compress_hyper_2_9_chunk (actual rows=1 loops=1)
|
||||
Index Cond: ((device_id = "*VALUES*".column1) AND (device_id_peer = "*VALUES*".column2))
|
||||
|
@ -639,12 +639,12 @@ FROM metrics_ordered_idx met join lookup
|
||||
ON met.device_id = lookup.did and met.v0 = lookup.version
|
||||
WHERE met.time > '2000-01-19 19:00:00-05'
|
||||
and met.time < '2000-01-20 20:00:00-05';
|
||||
QUERY PLAN
|
||||
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
QUERY PLAN
|
||||
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
Nested Loop (actual rows=2 loops=1)
|
||||
-> Values Scan on "*VALUES*" (actual rows=2 loops=1)
|
||||
-> Custom Scan (DecompressChunk) on _hyper_1_3_chunk met (actual rows=1 loops=2)
|
||||
Filter: (("time" > 'Wed Jan 19 16:00:00 2000 PST'::timestamp with time zone) AND ("time" < 'Thu Jan 20 17:00:00 2000 PST'::timestamp with time zone) AND ("*VALUES*".column1 = device_id) AND ("*VALUES*".column2 = v0))
|
||||
Filter: (("time" > 'Wed Jan 19 16:00:00 2000 PST'::timestamp with time zone) AND ("time" < 'Thu Jan 20 17:00:00 2000 PST'::timestamp with time zone) AND ("*VALUES*".column2 = v0))
|
||||
Rows Removed by Filter: 47
|
||||
-> Index Scan using compress_hyper_2_8_chunk__compressed_hypertable_2_device_id_dev on compress_hyper_2_8_chunk (actual rows=1 loops=2)
|
||||
Index Cond: (device_id = "*VALUES*".column1)
|
||||
@ -705,8 +705,8 @@ JOIN LATERAL
|
||||
WHERE node = f1.device_id) q
|
||||
ON met.device_id = q.node and met.device_id_peer = q.device_id_peer
|
||||
and met.v0 = q.v0 and met.v0 > 2 and time = '2018-01-19 20:00:00-05';
|
||||
QUERY PLAN
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
QUERY PLAN
|
||||
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
Nested Loop (actual rows=1 loops=1)
|
||||
Join Filter: (nodetime.node = met.device_id)
|
||||
-> Nested Loop (actual rows=1 loops=1)
|
||||
@ -715,7 +715,7 @@ ON met.device_id = q.node and met.device_id_peer = q.device_id_peer
|
||||
-> Seq Scan on nodetime (actual rows=1 loops=1)
|
||||
-> Values Scan on "*VALUES*" (actual rows=2 loops=1)
|
||||
-> Custom Scan (DecompressChunk) on _hyper_1_4_chunk met (actual rows=1 loops=1)
|
||||
Filter: ((v0 > 2) AND ("time" = 'Fri Jan 19 17:00:00 2018 PST'::timestamp with time zone) AND ("*VALUES*".column1 = device_id) AND ("*VALUES*".column2 = device_id_peer) AND ("*VALUES*".column3 = v0))
|
||||
Filter: ((v0 > 2) AND ("time" = 'Fri Jan 19 17:00:00 2018 PST'::timestamp with time zone) AND ("*VALUES*".column3 = v0))
|
||||
Rows Removed by Filter: 47
|
||||
-> Index Scan using compress_hyper_2_9_chunk__compressed_hypertable_2_device_id_dev on compress_hyper_2_9_chunk (actual rows=1 loops=1)
|
||||
Index Cond: ((device_id = "*VALUES*".column1) AND (device_id_peer = "*VALUES*".column2))
|
||||
|
@ -597,12 +597,11 @@ QUERY PLAN
|
||||
Output: "*VALUES*".column1
|
||||
-> Custom Scan (DecompressChunk) on _timescaledb_internal._hyper_X_X_chunk (actual rows=3598 loops=2)
|
||||
Output: _hyper_X_X_chunk.device_id
|
||||
Filter: ("*VALUES*".column1 = _hyper_X_X_chunk.device_id)
|
||||
Bulk Decompression: false
|
||||
-> Index Scan using compress_hyper_X_X_chunk__compressed_hypertable_4_device_id__t on _timescaledb_internal.compress_hyper_X_X_chunk (actual rows=4 loops=2)
|
||||
Output: compress_hyper_X_X_chunk."time", compress_hyper_X_X_chunk.device_id, compress_hyper_X_X_chunk.v0, compress_hyper_X_X_chunk.v1, compress_hyper_X_X_chunk.v2, compress_hyper_X_X_chunk.v3, compress_hyper_X_X_chunk._ts_meta_count, compress_hyper_X_X_chunk._ts_meta_sequence_num, compress_hyper_X_X_chunk._ts_meta_min_1, compress_hyper_X_X_chunk._ts_meta_max_1
|
||||
Index Cond: (compress_hyper_X_X_chunk.device_id = "*VALUES*".column1)
|
||||
(17 rows)
|
||||
(16 rows)
|
||||
|
||||
RESET enable_hashjoin;
|
||||
:PREFIX_VERBOSE SELECT device_id FROM :TEST_TABLE WHERE device_id IN (VALUES (1));
|
||||
@ -630,12 +629,11 @@ QUERY PLAN
|
||||
Output: "*VALUES*".column1
|
||||
-> Custom Scan (DecompressChunk) on _timescaledb_internal._hyper_X_X_chunk (actual rows=3598 loops=2)
|
||||
Output: _hyper_X_X_chunk.device_id
|
||||
Filter: ("*VALUES*".column1 = _hyper_X_X_chunk.device_id)
|
||||
Bulk Decompression: false
|
||||
-> Index Scan using compress_hyper_X_X_chunk__compressed_hypertable_4_device_id__t on _timescaledb_internal.compress_hyper_X_X_chunk (actual rows=4 loops=2)
|
||||
Output: compress_hyper_X_X_chunk."time", compress_hyper_X_X_chunk.device_id, compress_hyper_X_X_chunk.v0, compress_hyper_X_X_chunk.v1, compress_hyper_X_X_chunk.v2, compress_hyper_X_X_chunk.v3, compress_hyper_X_X_chunk._ts_meta_count, compress_hyper_X_X_chunk._ts_meta_sequence_num, compress_hyper_X_X_chunk._ts_meta_min_1, compress_hyper_X_X_chunk._ts_meta_max_1
|
||||
Index Cond: (compress_hyper_X_X_chunk.device_id = "*VALUES*".column1)
|
||||
(17 rows)
|
||||
(16 rows)
|
||||
|
||||
SET seq_page_cost = 100;
|
||||
-- loop/row counts of this query is different on windows so we run it without analyze
|
||||
@ -652,11 +650,10 @@ QUERY PLAN
|
||||
Output: "*VALUES*".column1
|
||||
-> Custom Scan (DecompressChunk) on _timescaledb_internal._hyper_X_X_chunk
|
||||
Output: _hyper_X_X_chunk.device_id
|
||||
Filter: ("*VALUES*".column1 = _hyper_X_X_chunk.device_id)
|
||||
-> Index Scan using compress_hyper_X_X_chunk__compressed_hypertable_4_device_id__t on _timescaledb_internal.compress_hyper_X_X_chunk
|
||||
Output: compress_hyper_X_X_chunk."time", compress_hyper_X_X_chunk.device_id, compress_hyper_X_X_chunk.v0, compress_hyper_X_X_chunk.v1, compress_hyper_X_X_chunk.v2, compress_hyper_X_X_chunk.v3, compress_hyper_X_X_chunk._ts_meta_count, compress_hyper_X_X_chunk._ts_meta_sequence_num, compress_hyper_X_X_chunk._ts_meta_min_1, compress_hyper_X_X_chunk._ts_meta_max_1
|
||||
Index Cond: (compress_hyper_X_X_chunk.device_id = "*VALUES*".column1)
|
||||
(15 rows)
|
||||
(14 rows)
|
||||
|
||||
RESET seq_page_cost;
|
||||
-- test view
|
||||
@ -691,7 +688,7 @@ QUERY PLAN
|
||||
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m1
|
||||
-> Parallel Seq Scan on compress_hyper_X_X_chunk
|
||||
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m2
|
||||
Filter: ((m1."time" = "time") AND (m1.device_id = device_id))
|
||||
Filter: (m1."time" = "time")
|
||||
-> Index Scan using compress_hyper_X_X_chunk__compressed_hypertable_4_device_id__t on compress_hyper_X_X_chunk compress_hyper_X_X_chunk_1
|
||||
Index Cond: (device_id = m1.device_id)
|
||||
(12 rows)
|
||||
@ -721,7 +718,7 @@ QUERY PLAN
|
||||
-> Index Scan using compress_hyper_X_X_chunk__compressed_hypertable_4_device_id__t on compress_hyper_X_X_chunk compress_hyper_X_X_chunk_2
|
||||
Index Cond: (device_id = 3)
|
||||
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m2
|
||||
Filter: ((m1."time" = "time") AND (m1.device_id = device_id))
|
||||
Filter: (m1."time" = "time")
|
||||
-> Index Scan using compress_hyper_X_X_chunk__compressed_hypertable_4_device_id__t on compress_hyper_X_X_chunk compress_hyper_X_X_chunk_1
|
||||
Index Cond: (device_id = m1.device_id)
|
||||
(17 rows)
|
||||
|
@ -597,12 +597,11 @@ QUERY PLAN
|
||||
Output: "*VALUES*".column1
|
||||
-> Custom Scan (DecompressChunk) on _timescaledb_internal._hyper_X_X_chunk (actual rows=3598 loops=2)
|
||||
Output: _hyper_X_X_chunk.device_id
|
||||
Filter: ("*VALUES*".column1 = _hyper_X_X_chunk.device_id)
|
||||
Bulk Decompression: false
|
||||
-> Index Scan using compress_hyper_X_X_chunk__compressed_hypertable_4_device_id__t on _timescaledb_internal.compress_hyper_X_X_chunk (actual rows=4 loops=2)
|
||||
Output: compress_hyper_X_X_chunk."time", compress_hyper_X_X_chunk.device_id, compress_hyper_X_X_chunk.v0, compress_hyper_X_X_chunk.v1, compress_hyper_X_X_chunk.v2, compress_hyper_X_X_chunk.v3, compress_hyper_X_X_chunk._ts_meta_count, compress_hyper_X_X_chunk._ts_meta_sequence_num, compress_hyper_X_X_chunk._ts_meta_min_1, compress_hyper_X_X_chunk._ts_meta_max_1
|
||||
Index Cond: (compress_hyper_X_X_chunk.device_id = "*VALUES*".column1)
|
||||
(17 rows)
|
||||
(16 rows)
|
||||
|
||||
RESET enable_hashjoin;
|
||||
:PREFIX_VERBOSE SELECT device_id FROM :TEST_TABLE WHERE device_id IN (VALUES (1));
|
||||
@ -630,12 +629,11 @@ QUERY PLAN
|
||||
Output: "*VALUES*".column1
|
||||
-> Custom Scan (DecompressChunk) on _timescaledb_internal._hyper_X_X_chunk (actual rows=3598 loops=2)
|
||||
Output: _hyper_X_X_chunk.device_id
|
||||
Filter: ("*VALUES*".column1 = _hyper_X_X_chunk.device_id)
|
||||
Bulk Decompression: false
|
||||
-> Index Scan using compress_hyper_X_X_chunk__compressed_hypertable_4_device_id__t on _timescaledb_internal.compress_hyper_X_X_chunk (actual rows=4 loops=2)
|
||||
Output: compress_hyper_X_X_chunk."time", compress_hyper_X_X_chunk.device_id, compress_hyper_X_X_chunk.v0, compress_hyper_X_X_chunk.v1, compress_hyper_X_X_chunk.v2, compress_hyper_X_X_chunk.v3, compress_hyper_X_X_chunk._ts_meta_count, compress_hyper_X_X_chunk._ts_meta_sequence_num, compress_hyper_X_X_chunk._ts_meta_min_1, compress_hyper_X_X_chunk._ts_meta_max_1
|
||||
Index Cond: (compress_hyper_X_X_chunk.device_id = "*VALUES*".column1)
|
||||
(17 rows)
|
||||
(16 rows)
|
||||
|
||||
SET seq_page_cost = 100;
|
||||
-- loop/row counts of this query is different on windows so we run it without analyze
|
||||
@ -652,11 +650,10 @@ QUERY PLAN
|
||||
Output: "*VALUES*".column1
|
||||
-> Custom Scan (DecompressChunk) on _timescaledb_internal._hyper_X_X_chunk
|
||||
Output: _hyper_X_X_chunk.device_id
|
||||
Filter: ("*VALUES*".column1 = _hyper_X_X_chunk.device_id)
|
||||
-> Index Scan using compress_hyper_X_X_chunk__compressed_hypertable_4_device_id__t on _timescaledb_internal.compress_hyper_X_X_chunk
|
||||
Output: compress_hyper_X_X_chunk."time", compress_hyper_X_X_chunk.device_id, compress_hyper_X_X_chunk.v0, compress_hyper_X_X_chunk.v1, compress_hyper_X_X_chunk.v2, compress_hyper_X_X_chunk.v3, compress_hyper_X_X_chunk._ts_meta_count, compress_hyper_X_X_chunk._ts_meta_sequence_num, compress_hyper_X_X_chunk._ts_meta_min_1, compress_hyper_X_X_chunk._ts_meta_max_1
|
||||
Index Cond: (compress_hyper_X_X_chunk.device_id = "*VALUES*".column1)
|
||||
(15 rows)
|
||||
(14 rows)
|
||||
|
||||
RESET seq_page_cost;
|
||||
-- test view
|
||||
@ -691,7 +688,7 @@ QUERY PLAN
|
||||
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m1
|
||||
-> Parallel Seq Scan on compress_hyper_X_X_chunk
|
||||
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m2
|
||||
Filter: ((m1."time" = "time") AND (m1.device_id = device_id))
|
||||
Filter: (m1."time" = "time")
|
||||
-> Index Scan using compress_hyper_X_X_chunk__compressed_hypertable_4_device_id__t on compress_hyper_X_X_chunk compress_hyper_X_X_chunk_1
|
||||
Index Cond: (device_id = m1.device_id)
|
||||
(12 rows)
|
||||
@ -721,7 +718,7 @@ QUERY PLAN
|
||||
-> Index Scan using compress_hyper_X_X_chunk__compressed_hypertable_4_device_id__t on compress_hyper_X_X_chunk compress_hyper_X_X_chunk_2
|
||||
Index Cond: (device_id = 3)
|
||||
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m2
|
||||
Filter: ((m1."time" = "time") AND (m1.device_id = device_id))
|
||||
Filter: (m1."time" = "time")
|
||||
-> Index Scan using compress_hyper_X_X_chunk__compressed_hypertable_4_device_id__t on compress_hyper_X_X_chunk compress_hyper_X_X_chunk_1
|
||||
Index Cond: (device_id = m1.device_id)
|
||||
(17 rows)
|
||||
|
@ -599,12 +599,11 @@ QUERY PLAN
|
||||
Output: "*VALUES*".column1
|
||||
-> Custom Scan (DecompressChunk) on _timescaledb_internal._hyper_X_X_chunk (actual rows=3598 loops=2)
|
||||
Output: _hyper_X_X_chunk.device_id
|
||||
Filter: ("*VALUES*".column1 = _hyper_X_X_chunk.device_id)
|
||||
Bulk Decompression: false
|
||||
-> Index Scan using compress_hyper_X_X_chunk__compressed_hypertable_4_device_id__t on _timescaledb_internal.compress_hyper_X_X_chunk (actual rows=4 loops=2)
|
||||
Output: compress_hyper_X_X_chunk."time", compress_hyper_X_X_chunk.device_id, compress_hyper_X_X_chunk.v0, compress_hyper_X_X_chunk.v1, compress_hyper_X_X_chunk.v2, compress_hyper_X_X_chunk.v3, compress_hyper_X_X_chunk._ts_meta_count, compress_hyper_X_X_chunk._ts_meta_sequence_num, compress_hyper_X_X_chunk._ts_meta_min_1, compress_hyper_X_X_chunk._ts_meta_max_1
|
||||
Index Cond: (compress_hyper_X_X_chunk.device_id = "*VALUES*".column1)
|
||||
(17 rows)
|
||||
(16 rows)
|
||||
|
||||
RESET enable_hashjoin;
|
||||
:PREFIX_VERBOSE SELECT device_id FROM :TEST_TABLE WHERE device_id IN (VALUES (1));
|
||||
@ -632,12 +631,11 @@ QUERY PLAN
|
||||
Output: "*VALUES*".column1
|
||||
-> Custom Scan (DecompressChunk) on _timescaledb_internal._hyper_X_X_chunk (actual rows=3598 loops=2)
|
||||
Output: _hyper_X_X_chunk.device_id
|
||||
Filter: ("*VALUES*".column1 = _hyper_X_X_chunk.device_id)
|
||||
Bulk Decompression: false
|
||||
-> Index Scan using compress_hyper_X_X_chunk__compressed_hypertable_4_device_id__t on _timescaledb_internal.compress_hyper_X_X_chunk (actual rows=4 loops=2)
|
||||
Output: compress_hyper_X_X_chunk."time", compress_hyper_X_X_chunk.device_id, compress_hyper_X_X_chunk.v0, compress_hyper_X_X_chunk.v1, compress_hyper_X_X_chunk.v2, compress_hyper_X_X_chunk.v3, compress_hyper_X_X_chunk._ts_meta_count, compress_hyper_X_X_chunk._ts_meta_sequence_num, compress_hyper_X_X_chunk._ts_meta_min_1, compress_hyper_X_X_chunk._ts_meta_max_1
|
||||
Index Cond: (compress_hyper_X_X_chunk.device_id = "*VALUES*".column1)
|
||||
(17 rows)
|
||||
(16 rows)
|
||||
|
||||
SET seq_page_cost = 100;
|
||||
-- loop/row counts of this query is different on windows so we run it without analyze
|
||||
@ -654,11 +652,10 @@ QUERY PLAN
|
||||
Output: "*VALUES*".column1
|
||||
-> Custom Scan (DecompressChunk) on _timescaledb_internal._hyper_X_X_chunk
|
||||
Output: _hyper_X_X_chunk.device_id
|
||||
Filter: ("*VALUES*".column1 = _hyper_X_X_chunk.device_id)
|
||||
-> Index Scan using compress_hyper_X_X_chunk__compressed_hypertable_4_device_id__t on _timescaledb_internal.compress_hyper_X_X_chunk
|
||||
Output: compress_hyper_X_X_chunk."time", compress_hyper_X_X_chunk.device_id, compress_hyper_X_X_chunk.v0, compress_hyper_X_X_chunk.v1, compress_hyper_X_X_chunk.v2, compress_hyper_X_X_chunk.v3, compress_hyper_X_X_chunk._ts_meta_count, compress_hyper_X_X_chunk._ts_meta_sequence_num, compress_hyper_X_X_chunk._ts_meta_min_1, compress_hyper_X_X_chunk._ts_meta_max_1
|
||||
Index Cond: (compress_hyper_X_X_chunk.device_id = "*VALUES*".column1)
|
||||
(15 rows)
|
||||
(14 rows)
|
||||
|
||||
RESET seq_page_cost;
|
||||
-- test view
|
||||
@ -693,7 +690,7 @@ QUERY PLAN
|
||||
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m1
|
||||
-> Parallel Seq Scan on compress_hyper_X_X_chunk
|
||||
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m2
|
||||
Filter: ((m1."time" = "time") AND (m1.device_id = device_id))
|
||||
Filter: (m1."time" = "time")
|
||||
-> Index Scan using compress_hyper_X_X_chunk__compressed_hypertable_4_device_id__t on compress_hyper_X_X_chunk compress_hyper_X_X_chunk_1
|
||||
Index Cond: (device_id = m1.device_id)
|
||||
(12 rows)
|
||||
@ -723,7 +720,7 @@ QUERY PLAN
|
||||
-> Index Scan using compress_hyper_X_X_chunk__compressed_hypertable_4_device_id__t on compress_hyper_X_X_chunk compress_hyper_X_X_chunk_2
|
||||
Index Cond: (device_id = 3)
|
||||
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m2
|
||||
Filter: ((m1."time" = "time") AND (m1.device_id = device_id))
|
||||
Filter: (m1."time" = "time")
|
||||
-> Index Scan using compress_hyper_X_X_chunk__compressed_hypertable_4_device_id__t on compress_hyper_X_X_chunk compress_hyper_X_X_chunk_1
|
||||
Index Cond: (device_id = m1.device_id)
|
||||
(17 rows)
|
||||
|
Loading…
x
Reference in New Issue
Block a user