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

Linux, Windows or macOS: Which Operating System to Use in 2026?

https://www.lucasaguiar.xyz/posts/linux-windows-macos-qual-usar-2026/
1•isfttr•6m ago•1 comments

File Approved – File approvals without the back-and-forth

https://fileapproved.com
1•vannventures•7m ago•0 comments

Echon – A Discord alternative built in Tauri/Rust

https://echon-voice.com
2•highest678•12m ago•0 comments

The Art of Operating Systems (2019)

https://denninginstitute.com/pjd/ArtOS2/
3•aragonite•14m ago•0 comments

Amp's GPT 5.5 Model Analysis

https://ampcode.com/models/gpt-5.5
3•goranmoomin•16m ago•0 comments

Pulitzer Prize Winner in International Reporting

https://www.pulitzer.org/winners/dake-kang-garance-burke-byron-tau-aniruddha-ghosal-and-yael-grau...
2•jay_kyburz•29m ago•2 comments

The artful way of the stack-machine

https://www.pepnom.org/post/post.5.may.2026.html
2•mjbq•32m ago•1 comments

Why AI Agents Need Proof Chains, Not Just Logs

https://github.com/rodriguezaa22ar-boop/atlas-trust-infrastructure
2•astra_omnia•34m ago•0 comments

Process-Level Reward Modeling for Agentic Data Analysis

https://arxiv.org/abs/2604.24198
3•gmays•41m ago•0 comments

You can get dragged into a police investigation by proximity alone – for now

https://www.theverge.com/report/919664/chatrie-v-united-states-supreme-court-arguments-fourth-ame...
1•Cider9986•42m ago•0 comments

What I'm Hearing About Cognitive Debt (So Far)

https://margaretstorey.com/blog/2026/02/18/cognitive-debt-revisited/
11•raphaelcosta•43m ago•1 comments

White House considers government reviews for AI models

https://www.reuters.com/world/white-house-considers-vetting-ai-models-before-they-are-released-ny...
2•AlexDragusin•46m ago•0 comments

The Car That Watches You Back: The Advertising Infrastructure of Modern Cars

https://nobodyaskedforthis.lol/posts/connected-car/
2•cadito•50m ago•0 comments

Nobody Here – 'The Story of Vaporwave' (2026) – Full Movie

https://www.youtube.com/watch?v=6kNqw7UdENg
3•fallinditch•51m ago•1 comments

Astronomers uncover > 1k radio galaxies with 'wings,' expanding a rare class

https://phys.org/news/2026-05-astronomers-uncover-radio-galaxies-wings.html
1•wglb•51m ago•1 comments

DeArrow: Crowdsourcing better titles and thumbnails on YouTube

https://github.com/ajayyy/DeArrow
2•gasull•52m ago•1 comments

Ahead of Race to IPO, OpenAI Discussed Spinning Out Robotics, Hardware Divisions

https://www.wsj.com/tech/ahead-of-race-to-ipo-openai-discussed-spinning-out-robotics-hardware-div...
1•spenvo•52m ago•0 comments

World-R1: Reinforcing 3D Constraints for Text-to-Video Generation

https://microsoft.github.io/World-R1/
2•gmays•53m ago•0 comments

Some children are drawing on fake moustaches to bypass online age checks

https://www.independent.co.uk/news/uk/home-news/children-bypassing-age-verification-social-media-...
5•latexr•58m ago•0 comments

Phased-Out Plugs

https://plugsocketmuseum.nl/Unusual.html
2•gaws•1h ago•1 comments

The Only Thing Worse Than Spirit Airlines Is a World Without Spirit Airlines

https://www.theatlantic.com/technology/2026/05/spirit-airlines-cancellation-closure/687047/
2•RestlessMind•1h ago•0 comments

Eaglepress.org – Content Management System Python 3

https://eaglepress.org
2•eagle10ne•1h ago•0 comments

Show HN: A tiny C program where an LLM rewires its DAG while running

https://github.com/kouhxp/liteflow
3•mrkn1•1h ago•0 comments

Achieving 3X speedups with diffusion-style speculative decoding

https://developers.googleblog.com/supercharging-llm-inference-on-google-tpus-achieving-3x-speedup...
2•xnx•1h ago•0 comments

Ctx – Persistent Memory for Claude Code, Cursor, and AI Coding Tools

https://github.com/ActiveMemory/ctx
2•parlakisik•1h ago•0 comments

OpenAI co-founder discloses nearly $30B stake, financial ties to Altman

https://www.reuters.com/sustainability/boards-policy-regulation/openai-co-founder-discloses-nearl...
2•PessimalDecimal•1h ago•0 comments

The Most Counterintuitive Way to Build a Brain [video]

https://www.youtube.com/watch?v=cDxtFtoQVNc
1•kburman•1h ago•0 comments

OpenPartner – the open-source referral and partner program platform

https://openpartner.dev/
1•keithfawcett•1h ago•0 comments

The em dashes ( –) – The unsaid AI SLOP Tax

https://old.reddit.com/r/ClaudeAI/comments/1t3rrfr/the_em_dashes_the_unsaid_ai_slop_tax/
1•thegdsks•1h ago•1 comments

Webistearchiver – macOS – Save and manage websites. Locally and minimalistically

https://websitearchiver.net
2•kipdev•1h ago•1 comments