Address reviews

velioglu/create_timeseries_table
Burak Velioglu 2021-08-24 13:31:32 +03:00
parent 06dd189c8f
commit c6705ebbd1
No known key found for this signature in database
GPG Key ID: F6827E620F6549C6
2 changed files with 10 additions and 0 deletions

View File

@ -198,6 +198,12 @@ InitiateTimeseriesTablePartitions(Oid relationId, bool useStartFrom)
{ {
bool readOnly = false; bool readOnly = false;
StringInfo initiateTimeseriesPartitionsCommand = makeStringInfo(); StringInfo initiateTimeseriesPartitionsCommand = makeStringInfo();
/*
* Since making the right calculation via C is much more complex and
* we will call that function once to create timeseries table, we
* are using SPI call.
*/
if (useStartFrom) if (useStartFrom)
{ {
appendStringInfo(initiateTimeseriesPartitionsCommand, appendStringInfo(initiateTimeseriesPartitionsCommand,

View File

@ -25,6 +25,10 @@
#define Anum_citus_timeseries_table_compression_threshold 6 #define Anum_citus_timeseries_table_compression_threshold 6
#define Anum_citus_timeseries_table_retention_threshold 7 #define Anum_citus_timeseries_table_retention_threshold 7
/*
* Taken from the Postgres code. Postgres' uses that conversion
* for internal interval conparison.
*/
#define INTERVAL_TO_SEC(ivp) \ #define INTERVAL_TO_SEC(ivp) \
(((double) (ivp)->time) / ((double) USECS_PER_SEC) + \ (((double) (ivp)->time) / ((double) USECS_PER_SEC) + \
(ivp)->day * (24.0 * SECS_PER_HOUR) + \ (ivp)->day * (24.0 * SECS_PER_HOUR) + \