using different SQL command can speed up insert 2x with Postgres DB
Boosting Postgres INSERT Performance by 50% With UNNEST
Boosting Postgres INSERT Performance by 50% With UNNEST
INSERT INTO sensors (ts, sensorid, value)
SELECT *
FROM unnest(
$1::timestamptz[],
$2::text[],
$3::float8[]
)
insteadINSERT INTO sensors (sensorid, ts, value) VALUES ($1, $2, $3), ($4, $5, $6), ..., ($2998, $2999, $3000);
No comments:
Post a Comment