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?

German political spies mistook a random Berlin woman and got her fired

https://www.eugyppius.com/p/how-german-political-spies-mistook
2•Jerry2•1m ago•0 comments

I'm Not Consulting an LLM

https://lr0.org/blog/p/gpt/
1•birdculture•2m ago•0 comments

Game Theory #9: the US-Iran War [video]

https://www.youtube.com/watch?v=jIS2eB-rGv0
1•flawn•3m ago•0 comments

Dotfiles for Consistent AI-Assisted Development – Dylan Bochman

https://dylanbochman.com/blog/2026-01-25-dotfiles-for-ai-assisted-development/
1•ankitg12•6m ago•0 comments

When the chain becomes the product: Seven years inside a token-funded venture

https://markmhendrickson.com/posts/when-the-chain-becomes-the-product/
1•mhendric•9m ago•0 comments

Making Firefox's right-click not suck, more, with userChrome.css

https://joshua.hu/firefox-making-right-click-not-suck-even-more-userchrome
2•nocy•10m ago•0 comments

Ask HN: Why there are no actual studies that show AI is more productive?

3•make_it_sure•14m ago•1 comments

Show HN: Run any VLM on real-time video

https://overshoot.ai/
1•zakariaelhjouji•16m ago•0 comments

What Automattic's AI Enablement Training Means for WordPress

https://automattic.com/2026/02/25/ai-enablement-wordpress/
1•taubek•16m ago•0 comments

Unredact

https://github.com/Alex-Gilbert/unredact
1•kruuuder•19m ago•1 comments

Ask HN: Meta ad / business account and pages gone

1•holistio•21m ago•0 comments

Show HN: Flora – Compile-time Dependency Injection for Go without reflection

https://github.com/soner3/flora
1•soner3•23m ago•1 comments

Fantasque Player

https://raphaelbastide.com/fantasque-player/
1•tarball•24m ago•0 comments

Salt Typhoon hacked 80 countries – AT&T can't confirm hackers are out

2•Abhscanink•25m ago•0 comments

Attackers prompted Gemini over 100k times while trying to clone it, Google s

https://arstechnica.com/ai/2026/02/attackers-prompted-gemini-over-100000-times-while-trying-to-cl...
4•joozio•27m ago•1 comments

Superpowers for Claude Code: Complete Guide 2026

https://www.pasqualepillitteri.it/en/news/215/superpowers-claude-code-complete-guide
2•doener•28m ago•0 comments

Invoker Commands API

https://developer.mozilla.org/en-US/docs/Web/API/Invoker_Commands_API
2•maqnius•29m ago•1 comments

Show HN: Codebrief – Make sense of AI-generated code changes

https://github.com/that-one-arab/codebrief
1•mo-dulaimi•30m ago•0 comments

Show HN: MindPlexa – Open-source AI-powered infinite canvas: Next.js, React Flow

https://github.com/jayasth/MindPlexa
1•jaysth•31m ago•0 comments

SWE-CI: Evaluating Agent Capabilities in Maintaining Codebases via CI

https://arxiv.org/abs/2603.03823
14•mpweiher•34m ago•1 comments

SCRY 17-source research engine for Claude Code(no API keys, pure stdlib)

https://github.com/Kastarter/scry
1•Kastarted•37m ago•0 comments

Show HN: Cursor skill for Claude Code's /loop scheduler

https://gist.github.com/aydinnyunus/9d507810e78554e2a18668a3dcfd65a8
1•runtimepanic•38m ago•0 comments

Show HN: Go LLM inference with a Vulkan GPU back end that beats Ollama's CUDA

https://github.com/computerex/dlgo
1•computerex•39m ago•0 comments

I built a tool that tailor your resume and cover letter for every job in seconds

https://cvrepair.guru
1•ahmedgmurtaza•45m ago•3 comments

LLMs take the fun out of coding

https://twitter.com/atmoio/status/2030289138126107074
2•vhiremath4•46m ago•2 comments

Show HN: MOCC – Turn your MRR or follower milestones into beautiful mockups

https://mocc-delta.vercel.app/
2•suryanshmishrai•51m ago•0 comments

New Research Reassesses the Value of Agents.md Files for AI Coding

https://www.infoq.com/news/2026/03/agents-context-file-value-review/
7•noemit•53m ago•4 comments

Ask HN: Has finding more competitors ever made you more confident?

1•stokemoney•54m ago•0 comments

The Synthetic Data Playbook: Generating Trillions of the Finest Tokens

https://huggingface.co/spaces/HuggingFaceFW/finephrase
2•JoelNiklaus•55m ago•0 comments

72 commits in a day, a third of them reverting the rest

1•madebyjam•56m ago•0 comments