A lambda that DELETE
s and COPY
s 8 parquet files from S3 into 8 Redshift tables (using boto3).
Each table is created from a single file, each with less than 3K rows.
7 of the queries take 2-3 seconds each, and one takes 50+ seconds.
I have exhausted my checks and not sure what this can be, this didn't work:
- Removed all fks/constraints
VACUUM
/ANALYZE
the tables- Recreated the tables
- Changed the isolation levels
- Increased the Lambda memory/CPU allocation
Notable considerations:
- When I run it directly on Redshift (not the datashare), the
COPY
takes 2s. - It's definitely the
COPY
and not theDELETE
(confirmed via logging).
Any suggestions appreciated!