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?

Sentinel Protocol – open-source AI firewall

1•Raviteja_•2m ago•0 comments

Show HN: SupaSidebar – I made Arc's sidebar universal for every browser

https://www.supasidebar.com
1•supasidebar•3m ago•0 comments

Thermal Imaging for Cardiorespiratory and Sudomotor Response Monitoring

https://arxiv.org/abs/2602.12361
1•PaulHoule•4m ago•0 comments

Git City

https://www.thegitcity.com/
1•mellosouls•4m ago•0 comments

Show HN: Termstage – Animated terminal SVGs from YAML, no screen recording

https://github.com/saikatkumardey/termstage
1•saikatkumardey•4m ago•1 comments

Show HN: Phone a Friend for Claude Code – GPT, Gemini, DeepSeek via MCP

1•spranab•4m ago•0 comments

phyz@home: distributed quantum gravity

https://home.phyz.dev
1•ecto•4m ago•0 comments

Show HN: The von Neumann era is over. Fabricating physical 3-phase AC ternary AI

1•tech_founder•4m ago•0 comments

Non-Consumer Hardware Represents ~15% of YC W26

https://www.extruct.ai/research/industrial-tech-thesis/
1•zkid18•4m ago•0 comments

Area Man Discovers Gravity

https://campedersen.com/phyz-at-home
1•ecto•5m ago•0 comments

Garden Horizons Codes

https://garden-horizons.com/
1•candseven•5m ago•0 comments

Seized Art, Eavesdropping at Detention Center as Kids Shared Their Stories

https://www.propublica.org/article/dilley-detention-center-kids-art-removal
1•hn_acker•5m ago•2 comments

Show HN: Ccperm – Audit Claude Code permissions across projects

https://github.com/letsur-dev/ccperm
1•dongekon•6m ago•0 comments

Lindsay Casale π² on X: "Never Apply to Another Job Again" / X

https://twitter.com/LindsayCasale/status/2026758489276821655
1•bilsbie•7m ago•0 comments

Show HN: StageWright – A performance-focused Playwright reporter with AI

https://stagewright.dev/
1•qagaryparker•7m ago•0 comments

Non-public document reveals science may not be prioritized on next Mars mission

https://arstechnica.com/space/2026/02/a-non-public-document-reveals-that-science-may-not-be-prior...
1•LorenDB•7m ago•0 comments

Trapped in MS Office

https://ia.net/topics/trapped-in-ms-office
1•Coral-Tiny•7m ago•0 comments

Show HN: WP-Hunter, WP recon and SAST tool (building Agentic AI pipeline)

https://github.com/xeloxa/WP-Hunter
1•xeloxa•8m ago•0 comments

Claude Code: The Revolution Nobody Noticed

https://dentro.de/ai/blog/2026/02/24/claude-code-the-revolution-nobody-noticed/
1•myk-e•8m ago•0 comments

Show HN: How AI Content Automation Is Reshaping SaaS Marketing in 2025

1•jackcofounder•9m ago•0 comments

New Hetzner prices: +30% starting on 1 April

https://p169.p3.n0.cdn.zight.com/items/geuGklEB/591bb9f6-ef96-41d8-9288-f14fa008570f.png
2•lovegrenoble•9m ago•1 comments

Google is serving straight-up malware as the top result for Claude Code

https://minimumviableposts.substack.com/p/google-is-serving-straight-up-malware
1•ageitgey•10m ago•0 comments

Ask HN: AI causing loss of sharing and the 2 lemon market standoff?

1•franktankbank•11m ago•0 comments

In 2025, Meta paid an effective federal tax rate of 3.5%

https://bsky.app/profile/rbreich.bsky.social/post/3mfptlfeucn2i
2•doener•11m ago•0 comments

Why Asian firms are not cheering Trump tariff ruling

https://www.bbc.com/news/articles/cdr2kmjd31ro
1•tartoran•12m ago•0 comments

Show HN: A closed source engine that stops hallucinations deterministically

https://github.com/007andahalf/Kairos-Sovereign-Engine
2•MattijsMoens•12m ago•1 comments

Show HN: I built a tutorial to help you learn Kuberenetes in most simplest way

https://kubernetes-made-simple.vercel.app/
3•mr_o47•13m ago•0 comments

Show HN:Covenant: Self hostable AI gateway with behavioral contracts

https://github.com/Vinesh2929/Covenant_API_Gateway
1•VineshNathan29•14m ago•1 comments

Model Collapse Ends AI Hype

https://www.youtube.com/watch?v=ShusuVq32hc
1•todsacerdoti•15m ago•0 comments

Show HN: I solved Claude Code's prompt injection problem, saved tokens doing it

https://github.com/timstarkk/mcp-safe-fetch
1•timstark•15m ago•0 comments