timescaledb/src/plan_partialize.h
gayyappan ca9363af8b Fix bad plan for materialization
REFRESH MATERIALIZED VIEW statements sometimes crash
because the generated plan has a HashAgg node
instead of a Partial Aggregate node when executing
INSERT INTO <materialization_table>
       SELECT * FROM <view>

Where the view stmt itself is along these lines
SELECT time_bucket('1 day'::interval, cpu."time") ,
 ......
 _timescaledb_internal.partialize_agg(avg(...))
FROM <table>
2020-02-24 15:27:11 -05:00

15 lines
475 B
C

/*
* 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.
*/
#ifndef TIMESCALEDB_PLAN_PARTIALIZE_H
#define TIMESCALEDB_PLAN_PARTIALIZE_H
#include <postgres.h>
#include <optimizer/planner.h>
bool ts_plan_process_partialize_agg(PlannerInfo *root, RelOptInfo *input_rel,
RelOptInfo *output_rel);
#endif /* TIMESCALEDB_PLAN_PARTIALIZE_H */