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

Show HN: LookGood Live – Chrome plugin enhances your appearance on camera video

https://webcameffects.app/en/extensions/looksgood-live/
1•mda_damico•3m ago•0 comments

Meta, Google lose US case over social media harm to kids

https://www.reuters.com/legal/litigation/jury-reaches-verdict-meta-google-trial-social-media-addi...
1•1vuio0pswjnm7•10m ago•0 comments

Six open table formats compared across 5 architectural forks

https://medium.com/@shaoting.huang/the-table-format-wars-4daa6ba3dd84
1•fujidanbao•10m ago•0 comments

Async, Sync, in Between

https://antfu.me/posts/async-sync-in-between
1•luispa•11m ago•0 comments

Comparison of embedding size reduction methods for vector search

https://corvi.careers/blog/vector-search-embedding-compression/
1•sp1982•12m ago•0 comments

Earliest iron blooms discovered off the Carmel coast

https://www.nature.com/articles/s40494-026-02409-7
1•wslh•13m ago•0 comments

Writing Changes Mathematical Thought

https://www.quantamagazine.org/how-writing-changes-mathematical-thought-20260325/
1•sonabinu•14m ago•0 comments

Chinese National and 2 US Citizens Charged W Conspiring to Smuggle AITech to CCP

https://www.justice.gov/opa/pr/chinese-national-and-two-us-citizens-charged-conspiring-smuggle-ar...
1•737min•14m ago•0 comments

Ask HN: Has Claude Code degraded intelligence?

1•narmiouh•15m ago•0 comments

Weaponizing Extension Packs with PackRAT

https://blog.yeethsecurity.com/2026/03/13/PackRat.html
1•somerandom1337•19m ago•0 comments

LA Jurors Find Meta, YouTube Liable for Youth Mental Health Problems, Award $6M

https://www.law.com/2026/03/25/los-angeles-jurors-find-meta-and-youtube-liable-for-youths-mental-...
1•1vuio0pswjnm7•24m ago•1 comments

Verdicts against social media companies carry consequences. But questions linger

https://www.boston25news.com/news/business/verdicts-against/EZ3JDN546E7RHDQDVPTYYGCAGI/
1•1vuio0pswjnm7•27m ago•0 comments

VS Code plugin to annotate in Markdown previews for your AI

https://github.com/41fred/ai-markdown-feedback
1•41fred•29m ago•1 comments

Web and File Server Comparison (NT Server 4.0 versus RedHat 5.2 on Linux 2.2.2)

http://www.mindcraft.com/whitepapers/first-nts4rhlinux.html
2•markus_zhang•31m ago•0 comments

Isolated Web Apps

https://chromeos.dev/en/web/isolated-web-apps
1•h4ch1•33m ago•0 comments

Every Online Conversation about AI, Summarized

https://rushyendramaganty.com/ai
3•finolex1•34m ago•0 comments

KKR to acquire Nothing Bundt Cakes for over $2B

https://www.reuters.com/business/retail-consumer/kkr-acquire-nothing-bundt-cakes-over-2-billion-w...
3•mattas•35m ago•0 comments

Docker Coding Agent Sandboxes (2025)

https://www.docker.com/blog/docker-sandboxes-a-new-approach-for-coding-agent-safety/
1•nateb2022•38m ago•0 comments

Your First Parser

https://davesnx.github.io/parseff/guides/first-parser/
2•y1n0•41m ago•0 comments

Fyrox Game Engine 1.0.0

https://fyrox.rs/blog/post/fyrox-game-engine-1-0-0/
1•robinsonrc•44m ago•0 comments

Buy Them the Tools

https://eric.mann.blog/buy-them-the-tools/
1•eamann•44m ago•0 comments

Electric Motorcycles Don't Have to Be Security Nightmares, but This One Was

https://hackaday.com/2026/03/25/electric-motorcycles-dont-have-to-be-security-nightmares-but-this...
1•initramfs•45m ago•1 comments

SpaceX set to file for share sale

https://www.bbc.com/news/articles/c5y8d721q18o
1•y1n0•46m ago•0 comments

FCC imposes ban on new foreign-made routers, allows 2 yrs firmware updates

https://arstechnica.com/tech-policy/2026/03/trump-fcc-prohibits-import-and-sale-of-new-wi-fi-rout...
3•walterbell•47m ago•3 comments

Mark to Market

https://cameronwestland.com/mark-to-market/
1•camwest•48m ago•0 comments

Background Agents Landscape

https://background-agents.com/landscape
1•sidk24•52m ago•0 comments

MCP Server for ERPNext / Frappe ERP – MCP Apps

https://github.com/Casys-AI/mcp-erpnext
1•ErwanLP•56m ago•0 comments

Ask HN: Why is a "War ON Iran" being labelled as a "War IN Iran"?

2•vfclists•1h ago•2 comments

streaming service for reading (6M+ titles)

https://lex-books.com
2•davidmainayar•1h ago•1 comments

The Alignment Illusion

https://cameronwestland.com/the-alignment-illusion/
2•camwest•1h ago•0 comments