Open rameshkaranth opened 3 years ago
-- Create a CSV file with data sorted by a column commonly used in the WHERE clause
\COPY (
SELECT * FROM tbl_metrics_partition_2020_q3
WHERE report_date >= '2020-09-01' AND report_date <= '2020-09-30'
ORDER BY report_date -- Add ORDER BY clause here
) TO 'tbl_metrics_partition_fdw_2020_m9.csv' CSV DELIMITER ',' HEADER;
-- Copy the data from the CSV file into the cstore foreign table
\COPY tbl_metrics_partition_fdw_2020_m9 FROM 'tbl_metrics_partition_fdw_2020_m9.csv' CSV DELIMITER ',' HEADER;
Hey team,
I read in the documentation of cstore_fdw that while loading data into cstore foreign table after sorting it on a column that is commonly used in the WHERE clause.
I am using a COPY from CSV to load the data in cstore foreign table like below