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?

Show HN: Idea Reality MCP – Pre-build reality check for AI coding agents

https://github.com/mnemox-ai/idea-reality-mcp
1•mnemoxai•38s ago•0 comments

Show HN: Tag Promptless on any GitHub PR/Issue to get updated user-facing docs

1•prithvi2206•55s ago•0 comments

Show HN: Emdash – Open-source agentic development environment

https://github.com/generalaction/emdash
1•onecommit•1m ago•0 comments

Pentagon, Musk's xAI reach agreement to use Grok in classified systems

https://www.aa.com.tr/en/americas/pentagon-musk-s-xai-reach-agreement-to-use-grok-in-classified-s...
1•Betelbuddy•2m ago•0 comments

Former Norwegian premier hospitalized after suicide attempt amid Epstein charges

https://www.aa.com.tr/en/europe/former-norwegian-premier-hospitalized-after-suicide-attempt-amid-...
2•Betelbuddy•5m ago•0 comments

Jira Ticket Analysis Web App (Free)

https://jiralens.com/
1•thebitvader•5m ago•1 comments

Myelin repair promoted by clemastine fumarate in nonhuman primate model

https://www.pnas.org/doi/10.1073/pnas.2520161123
1•bikenaga•5m ago•0 comments

One workspace for inspiration, intelligence, and creation

https://www.inspoai.io
1•sendnow•6m ago•0 comments

Show HN: Unthumb – Replace YT thumbnails with frames from the video

https://chromewebstore.google.com/detail/unthumb-hide-and-replace/ihibeclkodckpjfiihkcdhejpcielpcl
1•philcunliffe•6m ago•0 comments

STARC framework for Bank-Fintech risk management

https://www.independentbanker.org/w/starc-framework-for-bank-fintech-risk-management
1•petethomas•7m ago•0 comments

Emissaries – Constitutional principles for personal agents

https://commontask.org/emissaries/
2•durakot•7m ago•0 comments

Querying 3B Vectors

https://vickiboykis.com/2026/02/21/querying-3-billion-vectors/
1•mooreds•7m ago•0 comments

Finding Hidden Cloud Savings

https://newsletter.masterpoint.io/p/finding-hidden-cloud-savings
1•mooreds•7m ago•0 comments

Anthropic accuses China of 'industrial scale' attempt to steal Claude

https://www.neowin.net/news/anthropic-accuses-china-of-industrial-scale-attempt-to-steal-claudes-...
2•bundie•7m ago•0 comments

Least Privilege Manifesto

https://www.osohq.com/post/least-privilege-manifesto
2•boristane•8m ago•0 comments

Show HN: LoMux – Lightweight FFmpeg GUI in Rust (3MB Binary)

https://github.com/zblauser/LoMux
1•selectedambient•8m ago•0 comments

Sonic Attack on a Silent Vigil

https://earshotngo.substack.com/p/sonic-attack-on-a-silent-vigil
2•moxifly7•12m ago•0 comments

Re-thinking candidate take-homes in the AI Era: transcripts over code

https://rootly.com/blog/re-thinking-candidates-take-homes-in-the-ai-era-transcripts-over-code
1•jjtang1•12m ago•0 comments

1Password Raising Prices ~33%

5•iamben•14m ago•1 comments

Workaholic open source developers need to take breaks

https://www.theregister.com/2026/02/23/open_source_devs_column/
1•CrankyBear•14m ago•0 comments

Tritone Substitution

https://www.johndcook.com/blog/2026/02/23/tritone-sub/
1•ibobev•16m ago•0 comments

Giant Steps

https://www.johndcook.com/blog/2026/02/23/giant-steps/
1•ibobev•16m ago•0 comments

Formal determination of deidentification under California law

https://www.johndcook.com/blog/2026/02/23/copy-and-paste-law/
1•ibobev•16m ago•0 comments

Takeaways of building an MCP Server for my app

https://tagstack.io/blog/mcp-for-tagstack
1•greatNespresso•17m ago•0 comments

The Double Standard Is Killing AI Adoption in Your Team

https://blog.codeminer42.com/the-double-standard-is-killing-ai-adoption-in-your-team/
1•edigleysson•19m ago•0 comments

Show HN: OpenLingo – Connecting Sonnet 4.6 to a Duolingo-like interface

https://github.com/pretzelai/openlingo
1•ramonga•19m ago•0 comments

Show HN: Lattice – Track what top AI labs are publishing daily

https://www.layerthelatestinalattice.com
1•FlynnLachendro•19m ago•1 comments

Show HN: MasqueradeORM – Memory Efficient Node ORM: Just Write Classes

https://github.com/MasqueradeORM/MasqueradeORM
1•masqueradeorm•20m ago•1 comments

Frontier LLM Leaderboard

https://www.onyx.app/llm-leaderboard
1•RohoSwagger•20m ago•0 comments

Nearby Glasses

https://github.com/yjeanrenaud/yj_nearbyglasses
1•zingerlio•21m ago•0 comments