Skip to content

Commit

Permalink
Handling review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mkindahl committed Nov 22, 2024
1 parent 12c4c0a commit 2744c4f
Show file tree
Hide file tree
Showing 16 changed files with 73 additions and 126 deletions.
22 changes: 11 additions & 11 deletions tsl/src/hypercore/arrow_cache_explain.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ standard_ExplainOneQuery(Query *query, int cursorOptions, IntoClause *into, Expl
}
#endif

#define APPEND_IF_POSITIVE(INFO, FMT, VAL) \
do \
{ \
if ((VAL) > 0) \
appendStringInfo((INFO), " " FMT, (long long) (VAL)); \
} while (0)
static inline void
append_if_positive(StringInfo info, const char *key, long long val)
{
if (val > 0)
appendStringInfo(info, " %s=%lld", key, val);
}

static void
explain_decompression(Query *query, int cursorOptions, IntoClause *into, ExplainState *es,
Expand All @@ -87,13 +87,13 @@ explain_decompression(Query *query, int cursorOptions, IntoClause *into, Explain
appendStringInfoString(es->str, "Array:");
if (has_cache_data)
appendStringInfoString(es->str, " cache");
APPEND_IF_POSITIVE(es->str, "hits=%lld", decompress_cache_stats.hits);
APPEND_IF_POSITIVE(es->str, "misses=%lld", decompress_cache_stats.misses);
APPEND_IF_POSITIVE(es->str, "evictions=%lld", decompress_cache_stats.evictions);
append_if_positive(es->str, "hits", decompress_cache_stats.hits);
append_if_positive(es->str, "misses", decompress_cache_stats.misses);
append_if_positive(es->str, "evictions", decompress_cache_stats.evictions);
if (has_decompress_data)
appendStringInfoString(es->str, ", decompress");
APPEND_IF_POSITIVE(es->str, "count=%lld", decompress_cache_stats.decompressions);
APPEND_IF_POSITIVE(es->str, "calls=%lld", decompress_cache_stats.decompress_calls);
append_if_positive(es->str, "count", decompress_cache_stats.decompressions);
append_if_positive(es->str, "calls", decompress_cache_stats.decompress_calls);
appendStringInfoChar(es->str, '\n');
}
else
Expand Down
7 changes: 0 additions & 7 deletions tsl/test/expected/hypercore_columnar.out
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ begin
for ln in
execute format('explain (analyze, costs off, summary off, timing off, decompress_cache_stats) %s', $1)
loop
if trim(both from ln) like 'Group Key:%' then
continue;
end if;

return next anonymize(ln);
end loop;
end;
Expand All @@ -52,9 +48,6 @@ begin
for ln in
execute format('explain (costs off, summary off, timing off) %s', $1)
loop
if trim(both from ln) like 'Group Key:%' then
continue;
end if;
return next anonymize(ln);
end loop;
end;
Expand Down
7 changes: 0 additions & 7 deletions tsl/test/expected/hypercore_copy.out
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ begin
for ln in
execute format('explain (analyze, costs off, summary off, timing off, decompress_cache_stats) %s', $1)
loop
if trim(both from ln) like 'Group Key:%' then
continue;
end if;

return next anonymize(ln);
end loop;
end;
Expand All @@ -57,9 +53,6 @@ begin
for ln in
execute format('explain (costs off, summary off, timing off) %s', $1)
loop
if trim(both from ln) like 'Group Key:%' then
continue;
end if;
return next anonymize(ln);
end loop;
end;
Expand Down
7 changes: 0 additions & 7 deletions tsl/test/expected/hypercore_create.out
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ begin
for ln in
execute format('explain (analyze, costs off, summary off, timing off, decompress_cache_stats) %s', $1)
loop
if trim(both from ln) like 'Group Key:%' then
continue;
end if;

return next anonymize(ln);
end loop;
end;
Expand All @@ -52,9 +48,6 @@ begin
for ln in
execute format('explain (costs off, summary off, timing off) %s', $1)
loop
if trim(both from ln) like 'Group Key:%' then
continue;
end if;
return next anonymize(ln);
end loop;
end;
Expand Down
7 changes: 0 additions & 7 deletions tsl/test/expected/hypercore_cursor.out
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ begin
for ln in
execute format('explain (analyze, costs off, summary off, timing off, decompress_cache_stats) %s', $1)
loop
if trim(both from ln) like 'Group Key:%' then
continue;
end if;

return next anonymize(ln);
end loop;
end;
Expand All @@ -57,9 +53,6 @@ begin
for ln in
execute format('explain (costs off, summary off, timing off) %s', $1)
loop
if trim(both from ln) like 'Group Key:%' then
continue;
end if;
return next anonymize(ln);
end loop;
end;
Expand Down
70 changes: 54 additions & 16 deletions tsl/test/expected/hypercore_index_btree.out

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions tsl/test/expected/hypercore_index_hash.out
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ begin
for ln in
execute format('explain (analyze, costs off, summary off, timing off, decompress_cache_stats) %s', $1)
loop
if trim(both from ln) like 'Group Key:%' then
continue;
end if;

return next anonymize(ln);
end loop;
end;
Expand All @@ -57,9 +53,6 @@ begin
for ln in
execute format('explain (costs off, summary off, timing off) %s', $1)
loop
if trim(both from ln) like 'Group Key:%' then
continue;
end if;
return next anonymize(ln);
end loop;
end;
Expand Down Expand Up @@ -137,38 +130,45 @@ $$, :'hypertable'));
explain_anonymize
------------------------------------------------------------------------------------------
Finalize HashAggregate
Group Key: _hyper_I_N_chunk.location_id
-> Append
-> Partial HashAggregate
Group Key: _hyper_I_N_chunk.location_id
-> Bitmap Heap Scan on _hyper_I_N_chunk
Recheck Cond: (location_id = ANY ('{3,4,5}'::integer[]))
-> Bitmap Index Scan on _hyper_I_N_chunk_hypertable_location_id_idx
Index Cond: (location_id = ANY ('{3,4,5}'::integer[]))
-> Partial HashAggregate
Group Key: _hyper_I_N_chunk.location_id
-> Bitmap Heap Scan on _hyper_I_N_chunk
Recheck Cond: (location_id = ANY ('{3,4,5}'::integer[]))
-> Bitmap Index Scan on _hyper_I_N_chunk_hypertable_location_id_idx
Index Cond: (location_id = ANY ('{3,4,5}'::integer[]))
-> Partial HashAggregate
Group Key: _hyper_I_N_chunk.location_id
-> Bitmap Heap Scan on _hyper_I_N_chunk
Recheck Cond: (location_id = ANY ('{3,4,5}'::integer[]))
-> Bitmap Index Scan on _hyper_I_N_chunk_hypertable_location_id_idx
Index Cond: (location_id = ANY ('{3,4,5}'::integer[]))
-> Partial HashAggregate
Group Key: _hyper_I_N_chunk.location_id
-> Bitmap Heap Scan on _hyper_I_N_chunk
Recheck Cond: (location_id = ANY ('{3,4,5}'::integer[]))
-> Bitmap Index Scan on _hyper_I_N_chunk_hypertable_location_id_idx
Index Cond: (location_id = ANY ('{3,4,5}'::integer[]))
-> Partial HashAggregate
Group Key: _hyper_I_N_chunk.location_id
-> Bitmap Heap Scan on _hyper_I_N_chunk
Recheck Cond: (location_id = ANY ('{3,4,5}'::integer[]))
-> Bitmap Index Scan on _hyper_I_N_chunk_hypertable_location_id_idx
Index Cond: (location_id = ANY ('{3,4,5}'::integer[]))
-> Partial HashAggregate
Group Key: _hyper_I_N_chunk.location_id
-> Bitmap Heap Scan on _hyper_I_N_chunk
Recheck Cond: (location_id = ANY ('{3,4,5}'::integer[]))
-> Bitmap Index Scan on _hyper_I_N_chunk_hypertable_location_id_idx
Index Cond: (location_id = ANY ('{3,4,5}'::integer[]))
(32 rows)
(39 rows)

select location_id, count(*) into orig from :hypertable
where location_id in (3,4,5) group by location_id;
Expand Down
7 changes: 0 additions & 7 deletions tsl/test/expected/hypercore_insert.out
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ begin
for ln in
execute format('explain (analyze, costs off, summary off, timing off, decompress_cache_stats) %s', $1)
loop
if trim(both from ln) like 'Group Key:%' then
continue;
end if;

return next anonymize(ln);
end loop;
end;
Expand All @@ -57,9 +53,6 @@ begin
for ln in
execute format('explain (costs off, summary off, timing off) %s', $1)
loop
if trim(both from ln) like 'Group Key:%' then
continue;
end if;
return next anonymize(ln);
end loop;
end;
Expand Down
7 changes: 0 additions & 7 deletions tsl/test/expected/hypercore_join.out
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ begin
for ln in
execute format('explain (analyze, costs off, summary off, timing off, decompress_cache_stats) %s', $1)
loop
if trim(both from ln) like 'Group Key:%' then
continue;
end if;

return next anonymize(ln);
end loop;
end;
Expand All @@ -57,9 +53,6 @@ begin
for ln in
execute format('explain (costs off, summary off, timing off) %s', $1)
loop
if trim(both from ln) like 'Group Key:%' then
continue;
end if;
return next anonymize(ln);
end loop;
end;
Expand Down
7 changes: 0 additions & 7 deletions tsl/test/expected/hypercore_merge.out
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ begin
for ln in
execute format('explain (analyze, costs off, summary off, timing off, decompress_cache_stats) %s', $1)
loop
if trim(both from ln) like 'Group Key:%' then
continue;
end if;

return next anonymize(ln);
end loop;
end;
Expand All @@ -58,9 +54,6 @@ begin
for ln in
execute format('explain (costs off, summary off, timing off) %s', $1)
loop
if trim(both from ln) like 'Group Key:%' then
continue;
end if;
return next anonymize(ln);
end loop;
end;
Expand Down
7 changes: 0 additions & 7 deletions tsl/test/expected/hypercore_parallel.out
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ begin
for ln in
execute format('explain (analyze, costs off, summary off, timing off, decompress_cache_stats) %s', $1)
loop
if trim(both from ln) like 'Group Key:%' then
continue;
end if;

return next anonymize(ln);
end loop;
end;
Expand All @@ -57,9 +53,6 @@ begin
for ln in
execute format('explain (costs off, summary off, timing off) %s', $1)
loop
if trim(both from ln) like 'Group Key:%' then
continue;
end if;
return next anonymize(ln);
end loop;
end;
Expand Down
7 changes: 0 additions & 7 deletions tsl/test/expected/hypercore_stats.out
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ begin
for ln in
execute format('explain (analyze, costs off, summary off, timing off, decompress_cache_stats) %s', $1)
loop
if trim(both from ln) like 'Group Key:%' then
continue;
end if;

return next anonymize(ln);
end loop;
end;
Expand All @@ -57,9 +53,6 @@ begin
for ln in
execute format('explain (costs off, summary off, timing off) %s', $1)
loop
if trim(both from ln) like 'Group Key:%' then
continue;
end if;
return next anonymize(ln);
end loop;
end;
Expand Down
7 changes: 0 additions & 7 deletions tsl/test/expected/hypercore_types.out
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ begin
for ln in
execute format('explain (analyze, costs off, summary off, timing off, decompress_cache_stats) %s', $1)
loop
if trim(both from ln) like 'Group Key:%' then
continue;
end if;

return next anonymize(ln);
end loop;
end;
Expand All @@ -52,9 +48,6 @@ begin
for ln in
execute format('explain (costs off, summary off, timing off) %s', $1)
loop
if trim(both from ln) like 'Group Key:%' then
continue;
end if;
return next anonymize(ln);
end loop;
end;
Expand Down
7 changes: 0 additions & 7 deletions tsl/test/expected/hypercore_update.out
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ begin
for ln in
execute format('explain (analyze, costs off, summary off, timing off, decompress_cache_stats) %s', $1)
loop
if trim(both from ln) like 'Group Key:%' then
continue;
end if;

return next anonymize(ln);
end loop;
end;
Expand All @@ -58,9 +54,6 @@ begin
for ln in
execute format('explain (costs off, summary off, timing off) %s', $1)
loop
if trim(both from ln) like 'Group Key:%' then
continue;
end if;
return next anonymize(ln);
end loop;
end;
Expand Down
7 changes: 0 additions & 7 deletions tsl/test/expected/hypercore_vacuum_full.out
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ begin
for ln in
execute format('explain (analyze, costs off, summary off, timing off, decompress_cache_stats) %s', $1)
loop
if trim(both from ln) like 'Group Key:%' then
continue;
end if;

return next anonymize(ln);
end loop;
end;
Expand All @@ -57,9 +53,6 @@ begin
for ln in
execute format('explain (costs off, summary off, timing off) %s', $1)
loop
if trim(both from ln) like 'Group Key:%' then
continue;
end if;
return next anonymize(ln);
end loop;
end;
Expand Down
7 changes: 0 additions & 7 deletions tsl/test/sql/include/hypercore_helpers.sql
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ begin
for ln in
execute format('explain (analyze, costs off, summary off, timing off, decompress_cache_stats) %s', $1)
loop
if trim(both from ln) like 'Group Key:%' then
continue;
end if;

return next anonymize(ln);
end loop;
end;
Expand All @@ -51,9 +47,6 @@ begin
for ln in
execute format('explain (costs off, summary off, timing off) %s', $1)
loop
if trim(both from ln) like 'Group Key:%' then
continue;
end if;
return next anonymize(ln);
end loop;
end;
Expand Down

0 comments on commit 2744c4f

Please sign in to comment.