HomeSoftware Heritage

Use a temporary table to update scheduler metrics

This commit no longer exists in the repository. It may have been part of a branch which was deleted.

Description

Use a temporary table to update scheduler metrics

When using `insert into <...> select <...>`, PostgreSQL disables
parallel querying. Under some circumstances (in our large production
database), this makes updating the scheduler metrics take a (very) long
time.

Parallel querying is allowed for `create table <...> as select <...>`,
and doing so restores the small(er) runtimes for this query (15 minutes
instead of multiple hours). To use that, we have to turn the function
into plpgsql instead of plain sql.

Details

Commit No Longer Exists

This commit no longer exists in the repository.