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?

Minecraft Java Edition 26.2 Snapshot 1: Initial Vulkan Support

https://www.minecraft.net/en-us/article/minecraft-26-2-snapshot-1
1•exploraz•9s ago•0 comments

Molecular editing tool relocates alcohol groups

https://openyourmindabretumente.blogspot.com/2026/04/molecular-editing-tool-relocates.html
1•ericzapata•15s ago•0 comments

Tabsdata vs. Airbyte: Up to 86x faster

https://medium.com/tabsdata/benchmarking-airbyte-vs-tabsdata-ee67a0639bef
1•immortan_dag•1m ago•0 comments

Nix: Privilege escalation via symlink following during FOD output registration

https://discourse.nixos.org/t/nix-security-advisory-privilege-escalation-via-symlink-following-du...
1•hexa-•4m ago•0 comments

The Musician's Guide to Leaving Windows [video]

https://www.youtube.com/watch?v=UaY23TSa4-0
1•Kye•5m ago•0 comments

When the compiler lies: breaking memory safety in safe Go

https://ciolek.dev/posts/when-the-compiler-lies
1•irke882•6m ago•0 comments

Anthropic holds Mythos model due to hacking risks

https://www.axios.com/2026/04/07/anthropic-mythos-preview-cybersecurity-risks
2•FergusArgyll•6m ago•0 comments

Fifth Element Star Milla Jovovich Reveals AI Memory Tool MemPalace

https://decrypt.co/363524/fifth-element-milla-jovovich-ai-tool-mempalace
2•iamben•6m ago•0 comments

BYD's luxury EV with 5-min fast charging and 500 miles range is headed overseas

https://electrek.co/2026/04/07/byd-ev-5-min-charging-500-miles-range-overseas/
2•breve•9m ago•0 comments

SQLite in the browser with WASM and real-time ER diagram

https://fasttools.dev/en/sql-playground
1•fabiano-salles•12m ago•1 comments

WSLg: Windows Subsystem for Linux GUI

https://github.com/microsoft/wslg
1•aragonite•12m ago•0 comments

Show HN: I made a Git wrapper with undo button

https://crates.io/crates/g-cli
1•alonsovm•13m ago•0 comments

Anthropic latest AI model too powerful for public release and broke containment

https://www.businessinsider.com/anthropic-mythos-latest-ai-model-too-powerful-to-be-released-2026-4
1•makerdiety•14m ago•0 comments

GLM-5.1 matches Opus 4.6 in agentic performance, at ~1/3 actual cost

https://app.uniclaw.ai/arena/visualize?via=hn
2•skysniper•14m ago•1 comments

GEON: Structure-first decoding for language models

https://github.com/singhalpm-hub/geon-decoder
1•singhalpm•17m ago•0 comments

Author's preface to the book: "PGP Source Code and Internals" (1995)

https://philzimmermann.com/EN/essays/BookPreface.html
2•ipnon•19m ago•0 comments

I Just Wanted a Button. It Escalated [video]

https://www.youtube.com/watch?v=ljrKFFjFT04
1•big_toast•22m ago•1 comments

Midlife Sleep Irregularity Linked to Higher Risk of Major Cardiac Events

https://doi.org/10.1186/s12872-026-05762-4
2•gnabgib•22m ago•2 comments

Ask HN: Any advice on 'hacking' Ford lightning?

1•iugtmkbdfil834•25m ago•0 comments

Trump agrees to suspend 'bombing and attack of Iran' for 2 weeks

https://www.reuters.com/world/iran-war-live-tehran-rejects-ceasefire-deal-trumps-deadline-reopen-...
12•g-b-r•27m ago•8 comments

'Definitely a Sham': As Tariffs Climb, Fraud Proliferates

https://www.nytimes.com/2026/04/07/us/politics/tariffs-trade-import-fraud.html
2•thedogeye•29m ago•0 comments

Deere and Co agrees to pay $99M to settle 'right to repair' lawsuit

https://apnews.com/article/john-deere-repair-lawsuit-settlement-595d4b089689cd94418991326275b68d
5•RyanShook•29m ago•0 comments

Own your AI. Optimized down to the kernel

https://runinfra.ai/
1•OsamaJaber•30m ago•0 comments

Breakthrough Alzheimer's Drug Rewires the Brain Instead of Just Clearing Plaques

https://scitechdaily.com/breakthrough-alzheimers-drug-rewires-the-brain-instead-of-just-clearing-...
1•bookofjoe•31m ago•0 comments

Show HN: Clify – generate a CLI from any API docs, use it as agent tooling

https://github.com/derrickko/clify
3•dko•33m ago•0 comments

I made a Claude skill that refuses to write code for you

https://github.com/Tech-Matt/claude-mentor-skill
1•Tech-Matt•40m ago•1 comments

Astronautas da Artemis II levaram mensagem espiritual à órbita lunar

https://spacenewshub.substack.com/p/astronautas-da-artemis-ii-levaram
1•baldaci•44m ago•0 comments

Ex-Meta worker investigated for downloading 30k private Facebook photos

https://www.bbc.com/news/articles/cvg049xz1ygo
3•1659447091•48m ago•0 comments

MCP has 97M installs. It's also an open door into every dev environment

https://rawtext.io/tools/97-million-installs-zero-questions/
2•just_a_watcher•48m ago•0 comments

New York Times Got Played by a Telehealth Scam and Called It the Future of AI

https://www.techdirt.com/2026/04/07/the-new-york-times-got-played-by-a-telehealth-scam-and-called...
3•hn_acker•50m ago•3 comments