originally posted on the @databases blog
Postgres is normally very fast, but it can become slow (or even fail completely), if you have too many parameters in your queries. When it comes to operating on data in bulk, UNNEST
is the only way to achieve fast, reliable queries. This post has examples for using UNNEST
to do all types of bulk transactions.