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

Event Horizon – a Pihole Companion for non-technical network users

https://old.reddit.com/r/pihole/comments/1q25ekd/introducing_event_horizon_a_pihole_companion_for/
1•taubek•45s ago•0 comments

Reassemble

https://web.archive.org/web/20150311174405/https://web.stanford.edu/class/cs107/assign1.html
1•tosh•1m ago•0 comments

Show HN: How to do outpainting (canvas expansion) on an image [video]

https://www.youtube.com/watch?v=5Cq_grMKKj8
1•julienreszka•2m ago•0 comments

Restoring axon plasticity:chemogenetic activation saves autism-related behaviors

https://www.nature.com/articles/s41419-026-08873-0
1•bookofjoe•2m ago•0 comments

Rationales for Standards

https://www.thomas-huehn.com/rationales-for-standards/
2•Tomte•5m ago•0 comments

Baby botulism outbreak: FDA still doesn't know cause–or how to prevent it

https://arstechnica.com/health/2026/06/baby-botulism-outbreak-fda-still-doesnt-know-cause-or-how-...
1•Brajeshwar•5m ago•0 comments

Are Memories Transferable – Or Edible?

https://www.quantamagazine.org/are-memories-transferable-or-edible-20260605/
1•Brajeshwar•6m ago•0 comments

Show HN: Ccgs – Collaborative Claude Code sessions, stored in Git branches

https://github.com/ingram-technologies/claude-git-sessions
2•scrollaway•6m ago•0 comments

Protein name confusion created antibody mix-up affecting papers

https://www.science.org/content/article/protein-name-confusion-created-antibody-mix-affecting-hun...
1•Brajeshwar•7m ago•0 comments

Stealth Isn't Strategy: Post-Stealth Warfare a "Dirty Mix" of Humans and Robots

https://www.militarystrategymagazine.com/exclusives/stealth-isnt-strategy-post-stealth-warfare-wi...
2•anjel•10m ago•0 comments

Slopper GitHub Action: Fighting AI Slop Contributions on Open Source Projects

https://github.com/malvads/Slopper
1•malvads•13m ago•0 comments

You Can Run

https://magazine.atavist.com/2026/mccann-cocaine-fugitives
2•bryanrasmussen•15m ago•0 comments

The fourth law (on AI-generated supercustomized email marketing)

https://www.robinsloan.com/lab/fourth-law/
1•brandur•15m ago•0 comments

We have decided to make our service FREE. (Bloomberg Terminal for Everyone)

https://www.bullbear.ninja/notes/everything-free-ad-supported
2•haebom•16m ago•1 comments

Claudemux – Run and coordinate multiple Claude Codes reliably

https://github.com/wastedcode/claudemux
1•zeppelin_7•16m ago•1 comments

Authentic looking D&D homebrews with Markdown

https://homebrewery.naturalcrit.com/
1•Svoka•17m ago•1 comments

Show HN: Oh my wrist – Garmin alerts for Claude Code and OpenCode

https://github.com/yazon/oh-my-wrist
1•yazon•19m ago•0 comments

The mayor of Shelbyville, IN says only 'shitty houses' oppose data center

https://www.theverge.com/ai-artificial-intelligence/944984/shelbyville-indiana-mayor-shitty-house...
2•timpera•19m ago•0 comments

Adobe Photoshop: A Case for Keeping an Intel or PowerPC Mac

https://lowendmac.com/2025/adobe-photoshop-a-case-for-keeping-an-intel-or-powerpc-mac/
1•herbertl•22m ago•0 comments

Blackopscloud: Private VPS in seconds, email signup, crypto

https://blackopscloud.com/verify?redirect=%2F
2•hardboners69•23m ago•1 comments

Language models transmit behavioural traits through hidden signals in data

https://www.nature.com/articles/s41586-026-10319-8
2•momentmaker•25m ago•0 comments

Communities of Not

https://lucumr.pocoo.org/2026/6/6/communities-of-not/
2•Tomte•28m ago•0 comments

VibeOS

https://github.com/hansstam86/wibeos/tree/main
1•hans863•30m ago•1 comments

Every AI Agent Feature Is a Cache Invalidation Surface

https://www.openclacky.com/engineering/cache-invalidation-surface
1•gemHunter•33m ago•0 comments

From State to Foresight: Adding a Predictive World Model to an LLM Assistant

https://zenfox.ai/research/world-model-llm-assistant
1•zenfoxai•34m ago•0 comments

The last astronomers: astrophysicists left questioning the soul of their field

https://www.science.org/content/article/amid-flood-ai-advances-astrophysicists-are-questioning-so...
3•creamyhorror•35m ago•0 comments

Police in England and Wales told to halt AI use in court statements

https://www.ft.com/content/229e5949-3ebc-4151-8a86-a01b5e259241
8•nmstoker•35m ago•0 comments

A 40-Node 1U Cluster Gigabyte R1C7-K0A-AS1

https://www.servethehome.com/a-40-node-1u-cluster-gigabyte-r1c7-k0a-as1/
2•ksec•39m ago•1 comments

Scientists found a surprisingly simple way to create powerful quantum states

https://www.sciencedaily.com/releases/2026/06/260606075510.htm
1•hsnewman•40m ago•1 comments

Total Reciprocity Public License

https://trplfoundation.org/
2•birdculture•40m ago•0 comments