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

The SEC plans to end quarterly reporting

https://keepitquarterly.org/
1•froglop•7m ago•0 comments

I scanned 100 random Supabase projects. 22% leak user data anonymously

https://perufitlife.github.io/supabase-security-skill/blog/scanned-100-supabase-projects.html
1•renzom13•8m ago•0 comments

When GPT 5.5 flags your chat for possible cybersecurity risk–ask it to help you

https://martin.wojtczyk.de/2026/05/11/when-gpt-5-5-flags-your-chat-for-possible-cybersecurity-ris...
1•wojtczyk•12m ago•0 comments

The Vercel breach wasn't just a hack, it was a trust failure

https://www.inc.com/heather-wilde/the-vercel-breach-wasnt-just-a-hack-it-was-a-trust-failure/9133...
2•bobrenze•15m ago•0 comments

The future of work isn't human vs. AI, it's human with AI

https://www.inc.com/heather-wilde/the-future-of-work-isnt-human-vs-ai-its-human-with-ai/91335123
1•bobrenze•16m ago•0 comments

7 lines of code, 3 minutes: Implement a programming language (2010)

https://matt.might.net/articles/implementing-a-programming-language/
1•azhenley•18m ago•0 comments

Microbenchmark-Driven Analytical Performance Modeling Across Modern GPUs

https://arxiv.org/abs/2605.04178
1•matt_d•31m ago•0 comments

Baidu ERNIE 5.1 just dropped

https://ernie.baidu.com/
2•pretext•34m ago•0 comments

RPCS3 says "learn to code" as it bans AI agents from project

https://www.neowin.net/news/rpcs3-says-learn-to-code-as-it-bans-ai-agents-from-project/
1•bundie•38m ago•0 comments

I want to archive but DMCA stopped me

1•quanvm0501alt1•43m ago•0 comments

The eye in your pocket: digital devices are made to track you

https://aeon.co/essays/things-have-jobs-and-digital-devices-are-made-to-track-you
3•the-mitr•43m ago•0 comments

PyTorch DevLog

https://docs.pytorch.org/devlogs/
2•matt_d•52m ago•0 comments

Lie-to-Children

https://en.wikipedia.org/wiki/Lie-to-children
3•o4c•1h ago•0 comments

I reverse engineered macOS to disable built-in display

https://frankster0542.gumroad.com/l/saafi
2•fkusiapp•1h ago•0 comments

Ask HN: How much does Gemini API cost for a simple n8n workflow?

1•Meld5792•1h ago•0 comments

MCP server that gives a forensic verdict on biopharma catalyst plays

https://github.com/yesc97/biopharma-catalyst-mcp
2•yesc97•1h ago•0 comments

Addressing GitHub's recent availability issues

https://github.blog/news-insights/company-news/addressing-githubs-recent-availability-issues-2/
2•mvdtnz•1h ago•3 comments

Plenty of Hours in the Day

https://www.wsj.com/arts-culture/books/big-time-review-plenty-of-hours-in-the-day-d3744c1a
1•lxm•1h ago•0 comments

Show HN: Kheeper, a registry designed for bootable images

https://kheeper.com/
2•areed•1h ago•0 comments

Trump's Border Spending Spurs Boom in AI-Infused Surveillance

https://www.wsj.com/tech/trumps-border-spending-spurs-boom-in-ai-infused-surveillance-4714521b
4•lxm•1h ago•0 comments

America the Undammed

https://www.nytimes.com/2026/05/07/climate/america-the-undammed.html
1•lxm•1h ago•1 comments

University student arrested in Taiwan for radio hack that halted high speed rail

https://www.rtl-sdr.com/student-arrested-in-taiwan-for-using-sdr-and-handheld-radios-to-halt-four...
2•bsgamble•2h ago•0 comments

SmartScreen warnings triggered after migration from EOC. EV certs affected too

https://github.com/Azure/artifact-signing-action/issues/128
1•polywickstudio•2h ago•2 comments

Open Source Volunteer Opportunities

https://ossvolunteers.com/
1•pabs3•2h ago•0 comments

SVG Frame-by-Frame Animation Generator

https://github.com/Emasoft/svg2fbf
2•beepill•2h ago•1 comments

The Bottom-Up Building of a Language for Subleq with Text Macros

https://coe.psu.ac.th/ad/subleq/
2•ADavison2560•2h ago•0 comments

The Greatest Shot in Television: James Burke Had One Chance to Nail This Scene

https://www.openculture.com/2024/10/the-greatest-shot-in-television.html
57•susam•2h ago•20 comments

Copilot Builder enables welding with AI

https://www.millerwelds.com/products/copilot-builder-with-blue-iq-powered-by-novai
1•DarkContinent•2h ago•0 comments

University Claims Withholding Water from Data Center 'Unlawfully Discriminatory'

https://www.404media.co/university-claims-withholding-water-from-nuclear-weapons-data-center-is-u...
2•adrienne•2h ago•1 comments

I Got Tired of Rewriting Prompts So I Built This

https://github.com/Ademking/SkillPrompts
2•ademking•2h ago•0 comments