Keeping a transaction open for that long is arguably a bad idea. You might need a consistent snapshot, but the cost is significant.
Also, paginating inefficiently with OFFSET is a problem is general. Even if you’re keeping a long transaction open, you can make it last less by optimising the read queries.
noman-land 2 days ago [-]
This is actually a pretty interesting post about databases.
Rendered at 19:15:31 GMT+0000 (Coordinated Universal Time) with Vercel.
Also, paginating inefficiently with OFFSET is a problem is general. Even if you’re keeping a long transaction open, you can make it last less by optimising the read queries.