Learn R Programming

timeseriesdb (version 0.4.1)

storeListChunkWise: Store a List of Time Series Chunk Wise to Avoid Memory Problem

Description

This function is a wrapper around storeTimeSeries. It is used to split large lists of time series according to memory limitations. This function uses INSERT INTO instead of the more convenient dbWritetable for performance reasons. DO NOT USE THIS FUNCTIONS IN LOOPS OR LAPPLY! This function can handle a set of time series on its own and is much faster than looping over a list. Non-unique primary keys are overwritten !

Usage

storeListChunkWise(series, con, li = NULL, tbl = "timeseries_main",
  md_unlocal = "meta_data_unlocalized", overwrite = T, chunksize = 10000,
  schema = "timeseries", show_progress = FALSE)

Arguments

series

character name of a time series, S3 class ts. When used with lists it is convenient to set series to names(li). Note that the series name needs to be unique in the database!

con

a PostgreSQL connection object.

li

list of time series. Defaults to NULL to no break legacy calls that use lookup environments.

tbl

character string denoting the name of the main time series table in the PostgreSQL database.

md_unlocal

character string denoting the name of the table that holds unlocalized meta information.

overwrite

logical should existing records (same primary key) be overwritten? Defaults to TRUE.

chunksize

integer number of chunks. Defaults to chunks of 10K.

schema

SQL schema name. Defaults to timeseries.

show_progress

If TRUE, storeListChunkWise will print a progress indicator to the console. Default FALSE.