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•7mo 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•7mo 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•7mo 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•7mo 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•7mo ago
Load test against a clone instead of a DB whose contents you care about?

Docker Auth Issues

1•fuomag9•46s ago•0 comments

Amid talk of a brain drain, some scientists leave U.S. behind

https://www.statnews.com/2025/12/17/research-cuts-fuel-scientific-brain-drain-american-science-sh...
1•bikenaga•1m ago•0 comments

X sues challenger for trying to 'steal' Twitter brand

https://www.euronews.com/next/2025/12/17/x-sues-challenger-operation-bluebird-for-trying-to-steal...
2•choult•2m ago•0 comments

Browser extensions with 8M users collect extended AI conversations

https://arstechnica.com/security/2025/12/browser-extensions-with-8-million-users-collect-extended...
1•bikenaga•4m ago•0 comments

Throw More Darts

https://derwiki.medium.com/throw-more-darts-7d1e79179a29
1•derwiki•4m ago•0 comments

Tell HN: HN Was Down

31•uyzstvqs•4m ago•2 comments

Asahi Linux Progress Linux 6.18

https://asahilinux.org/2025/12/progress-report-6-18/
1•calcifer•5m ago•0 comments

Rigorous Work with Fallible AI

https://wrenchatwork.substack.com/p/rigorous-work-with-fallible-ai
1•alvarop•5m ago•0 comments

Nvidia plans heavy cuts to GPU supply in early 2026

https://overclock3d.net/news/gpu-displays/nvidia-plans-heavy-cuts-to-gpu-supply-in-early-2026/
3•tareqak•6m ago•0 comments

Ask HN: Was HN just down for anyone else?

18•rozenmd•6m ago•6 comments

Connect JupyterLiteAI to any-LLM-gateway for AI with budget limits

https://jupyterlite-ai.readthedocs.io/en/latest/any-llm-gateway/
1•mzlaai•6m ago•0 comments

Learn Eleventy

https://learn-eleventy.pages.dev/
1•eustoria•6m ago•0 comments

Show HN: Eqlize – Query SQLite Using EdgeQL

https://jcuenod.github.io/eqlize-demo/
1•jcuenod•6m ago•0 comments

Show HN: I asked Gemini 3 pro to imagine a job board 10 years from now

https://job-board-2035-24pj4q.app.test.neptune.dev
2•jvcor13•7m ago•0 comments

The great AI hype correction of 2025

https://www.technologyreview.com/2025/12/15/1129174/the-great-ai-hype-correction-of-2025/
1•Brajeshwar•7m ago•0 comments

The State of AI Coding Report 2025

https://www.greptile.com/state-of-ai-coding-2025
2•dakshgupta•7m ago•1 comments

The Great Ptolemaic Smackdown (2013)

http://tofspot.blogspot.com/2013/08/the-great-ptolemaic-smackdown.html
1•Tomte•7m ago•0 comments

Meta is using private AI chats for ADs

https://proton.me/blog/meta-ai-ads
1•eustoria•7m ago•0 comments

Why Were Medieval Europeans So Obsessed with Long, Pointy Shoes?

https://www.atlasobscura.com/articles/medieval-europeans-pointy-shoes
1•Brajeshwar•7m ago•0 comments

Industrial policy returns as a weapon of national security

https://www.theglobalcurrents.com/p/industrial-policy-returns-as-a-weapon
1•hunglee2•7m ago•0 comments

XDG Base Directory Specification

https://specifications.freedesktop.org/basedir/latest/
1•Brajeshwar•7m ago•0 comments

China built its 'Manhattan Project' to rival the West in AI chips

https://www.reuters.com/world/china/how-china-built-its-manhattan-project-rival-west-ai-chips-202...
1•DustinEchoes•8m ago•0 comments

Improper HMAC Signature Verification in auth0/node-jws

https://github.com/auth0/node-jws/security/advisories/GHSA-869p-cjfg-cm3x
1•gearnode•8m ago•0 comments

HomeBox

https://homebox.software/en/
1•Tomte•8m ago•0 comments

"Mozilla's new CEO announced that Firefox will evolve into a modern AI browser."

https://mastodon.social/@nixCraft/115731006480642350
1•pavel_lishin•8m ago•0 comments

Opus 4.5 vs. GPT 5.2 vs. Gemini 3 Pro for Elixir development

https://elixirforum.com/t/opus-4-5-vs-gpt-5-2-vs-gemini-3-pro-for-elixir-development/73685
1•vtail•8m ago•0 comments

OpenAI in talks with Amazon about investment that could exceed $10B

https://www.cnbc.com/2025/12/16/openai-in-talks-with-amazon-about-investment-could-top-10-billion...
1•mgh2•8m ago•0 comments

Show HN: There's a full suite of open alternatives to BigTech hardware now

1•iris-digital•8m ago•0 comments

Launch HN: Kenobi (YC W22) – Personalize your website for every visitor

2•sarreph•8m ago•0 comments

Postfix Macros and Let Place

https://nadrieril.github.io/blog/2025/12/09/postfix-macros-and-let-place.html
1•lukastyrychtr•8m ago•0 comments