Duplicate key value violates unique constraint "workflow_statistics_pkey"

Hi @MatthieuParis, it seems this was originally done intentionally because the TypeORM library does not have support for the “on conflict increment” logic used here. So instead, n8n uses a try → catch logic, meaning it is expected to have the respective query error.

The team is currently discussing alternatives though, so this might change in the future.

I am surprised this leads to general slowness though and was not able to reproduce this on my end. Which operation exactly is slow for you?