frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Ask HN: How can I load test PostgreSQL but avoid changing actual data?

1•LawZiL•9mo ago
I'm running a load test on my Node.js application and want to simulate realistic write-heavy scenarios to stress test the system — especially the PostgreSQL database.

There's a part of the code that performs UPDATE queries, but during load testing, I don't want these updates to actually change the state of the database. However, I still want the database to experience the full impact of the update — query planning, locking, I/O, WAL writes, etc. — so I can measure how it affects performance under peak load.

Is there a best-practice approach to achieve this?

So far, the most viable option I’ve found is to wrap the UPDATE queries in a transaction and then roll it back — that way, the queries still execute, but the state doesn’t change. Is this the right way to go? Does rollback introduce any performance overhead that would skew my results? Are there better or more realistic alternatives that simulate the full write path without persisting changes?

Thanks in advance!

Comments

sargstuff•9mo ago
pgbench[2] / pgreplay-go[0] / python locust[1]

very old school approach:

Misuse sql VIEW[3][4] to generate a temporary parallel table setup. Testing database separate from production database would be 'better', IMHO.

-----

[0] pgreplay-go : https://github.com/gocardless/pgreplay-go

[1] python locust : https://miguel-codes.medium.com/unconventional-load-testing-...

[2] pgbench load testing :

   a) https://medium.com/@c.ucanefe/pgbench-load-test-166bdfb5c75a

   b) https://neon.tech/blog/autoscaling-in-action-postgres-load-testing-with-pgbench

   c) https://hackernoon.com/how-to-create-and-load-test-data-in-postgresql-i41e353m
----------------------------

[3] : a) https://hashrocket.com/blog/posts/materialized-view-strategi...

      b) https://tech.jonathangardner.net/wiki/PostgreSQL/Materialized_Views

      c) https://stackoverflow.com/questions/77603705/what-is-the-use-of-materialized-view-in-postgresql
[4] : https://en.wikipedia.org/wiki/View_(SQL)
LawZiL•9mo ago
but again, how can i perform the query, but not actually change the state, i really need the state to keep untouched, but be able to perform the query itself.
MatthiasPortzel•9mo ago
> Does rollback introduce any performance overhead that would skew my results?

I would expect it to be the other way around—since the transactions are rolled back and not committed, they would have significantly less performance impact. But I’m working from an academic model of the database.

apothegm•9mo ago
Load test against a clone instead of a DB whose contents you care about?

Political Extremism in Japan and Its Dangers

1•jocelyner•1m ago•0 comments

Some Thoughts on LLM Coding

https://blog.dave.tf/post/coding-agents/
1•pabs3•2m ago•0 comments

Learning from context is harder than we thought

https://hy.tencent.com/research/100025?langVersion=en&utm_source=tldrai
1•gmays•6m ago•0 comments

Geometrically Allocated Ads in AI Conversations

https://www.june.kim/power-diagrams-ad-auctions
1•kimjune01•7m ago•1 comments

Cryptarithms Number Puzzles

http://www.cryptarithms.com/
1•radeeyate•11m ago•0 comments

Shades of Meaning (2018)

https://mag.uchicago.edu/arts-humanities/shades-meaning
2•mkmk•12m ago•0 comments

Trump to Repeal Landmark Climate Finding in Regulatory Rollback

https://www.wsj.com/politics/policy/trump-to-repeal-landmark-climate-finding-in-huge-regulatory-r...
2•melling•12m ago•0 comments

'The most anti-biking bill in history' – Iowa's near-total bike ban proposal

https://www.cyclingweekly.com/news/the-most-anti-biking-bill-in-history-iowas-near-total-bike-ban...
2•toss1•18m ago•0 comments

Lambda Durable Functions

https://docs.aws.amazon.com/lambda/latest/dg/durable-functions.html
1•plumeria•19m ago•0 comments

Property-based testing as executable specs for agentic coding

https://kiro.dev/blog/property-based-testing/
1•logicprog•20m ago•0 comments

GitHub: We're pausing rollout of GPT-5.3-Codex to focus on platform reliability

https://twitter.com/github/status/2021040916451164412
2•PieUser•25m ago•1 comments

SMTLIB as a Compiler IR I

https://www.philipzucker.com/smt_compiler_i/
1•matt_d•27m ago•0 comments

OpenClaw Is the New Linux

https://openclaw.rocks/blog/openclaw-is-the-new-linux/
3•stubbi•29m ago•3 comments

Show HN: A AI-powered, open-source geostrategy game

https://github.com/benjamin-feldman/openwargames
1•b_feldman•31m ago•0 comments

Show HN: LocaFlow – Fast AI Translation Tool for Xcode Strings, XML and JSON

https://locaflow.dev
1•nikolaitarasov•33m ago•0 comments

Work at tiny corp: "Bounties pay you while judging that fit."

https://tinygrad.org/#worktiny
1•ipnon•35m ago•0 comments

Don't use escaping closures in SwiftUI

https://rensbr.eu/blog/swiftui-escaping-closures/
1•burntcaramel•36m ago•0 comments

How TikTok 2.0 Became a Weapon for ICE

https://newrepublic.com/article/205956/americanized-tiktok-backdoor-ice-surveillance
15•c420•36m ago•0 comments

Health Advice from A.I. Chatbots Is Frequently Wrong, Study Shows

https://www.nytimes.com/2026/02/09/well/chatgpt-health-advice.html
3•ceejayoz•36m ago•0 comments

Cleatus, Fox Sports's football robot (2019)

https://www.fastcompany.com/90293253/the-secret-history-of-cleatus-foxs-enduringly-weird-football...
1•firloop•42m ago•0 comments

Show HN: AetherLang – A DSL for building AI workflows with visual debugging

https://github.com/contrario/aetherlang
1•contrario•44m ago•1 comments

'Goldilocks' Effect for Online Teens? Moderate Social Media Users Fare Better

https://reason.com/2026/02/09/a-goldilocks-effect-for-online-teens-moderate-social-media-users-fa...
2•pseudolus•45m ago•0 comments

Show HN: AICO – Manage AI collaborators like managing employees

https://www.the-aico.com/
1•funiqlab•47m ago•0 comments

Baby headcams reveal how babies encounter faces during development

https://medicalxpress.com/news/2026-01-baby-headcams-reveal-babies-encounter.html
3•PaulHoule•50m ago•0 comments

Equality Saturation Meets ML: The Next Step for Smarter Optimizing Compilers [video]

https://www.youtube.com/watch?v=hqqVTss_mKc
1•matt_d•50m ago•0 comments

Btrfs Brings Experimental Remap-Tree Feature and More in Linux 7.0

https://www.phoronix.com/news/Linux-7.0-Btrfs-Changes
2•mikece•53m ago•0 comments

ClawWatcher – Cost and token monitoring for OpenClaw agents

https://clawwatcher.com/
1•Robinbuilds1•55m ago•2 comments

The Lost Dog That Made Constant Surveillance Feel Like a Favor

https://reclaimthenet.org/the-lost-dog-that-made-constant-surveillance-feel-like-a-favor
2•bilsbie•55m ago•0 comments

Why demand for code is infinite: How AI creates more developer jobs

https://stackoverflow.blog/2026/02/09/why-demand-for-code-is-infinite-how-ai-creates-more-develop...
3•mikece•56m ago•0 comments

A decades-old video game has helped me defeat the doomscroll

https://www.theguardian.com/games/2026/feb/09/how-a-decades-old-video-game-has-helped-me-defeat-t...
2•shadow28•56m ago•0 comments