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?

Show HN: T-Rex.world

1•nirupan23•1m ago•0 comments

SQLite WAL in 2026: an architecture note on checkpoint starvation

https://cronfeed.work/oss-sqlite-wal-architecture-note-checkpoint-starvation-concurrency-boundary...
1•tonyl•3m ago•0 comments

Social Credit

https://nicholasdecker.substack.com/p/social-credit
1•barry-cotter•3m ago•0 comments

Elon vs. Altman: What Their Infrastructure Stacks Reveal About Power

https://mythcoreops.substack.com/p/elon-vs-altman-what-their-infrastructure
1•ReadTheProducts•6m ago•0 comments

Tim Cook's Impeccable Timing

https://stratechery.com/2026/tim-cooks-impeccable-timing/
2•hasheddan•6m ago•0 comments

AI Database Landscape in 2026: Vector, ML-in-DB, LLM-Augmented, Predictive

https://aito.ai/blog/the-ai-database-landscape-in-2026-where-does-structured-prediction-fit/
1•arauhala•11m ago•1 comments

Show HN: Dreamtime – A fresh bedtime story for your children every night

https://trydreamtime.com
1•jblox•11m ago•0 comments

How well do LLMs work outside English? We tested 8 models in 8 languages [pdf]

https://info.rws.com/hubfs/2026/trainai/llm-data-gen-study-2.0-campaign/trainai-multilingual-llm-...
1•curioussquirrel•12m ago•2 comments

Polymarket in talks to raise money at about $15B valuation

https://www.reuters.com/business/polymarket-talks-raise-money-about-15-billion-valuation-informat...
2•JumpCrisscross•12m ago•0 comments

Show HN: Hevc.js – HEVC/H.265 to H.264 transcoding in WebAssembly (236KB)

https://www.hevcjs.dev/
1•privaloops•13m ago•0 comments

Datahugging shields proprietary AI models from research that could disprove them

https://www.nature.com/articles/s44387-026-00094-2
1•apwheele•15m ago•0 comments

My file access workaround for cron in Tahoe

1•noduerme•17m ago•0 comments

Using LLMs effectively isn't about prompting

https://www.seangoedecke.com/beyond-prompting/
1•adityaathalye•19m ago•0 comments

Smoking ban for people born after 2008 in the UK agreed

https://www.bbc.co.uk/news/articles/cn08jy6w0l5o
6•AndrewDucker•20m ago•3 comments

Claude Sonnet 4.6 thinking duplicates what it has said, wasting tokens

1•szmarczak•22m ago•0 comments

French prosecutors issue summons to Musk after raid on X offices in Paris

https://courthousenews.com/french-prosecutors-issue-summons-to-musk-after-raid-on-x-offices-in-pa...
7•vrganj•22m ago•1 comments

AI Prevents Meritocracy

https://www.privacyguides.org/videos/2026/04/19/interview-with-carissa-veliz-author-of-privacy-is...
2•freddyym•22m ago•0 comments

Global growth in solar "the largest ever observed for any source"

https://arstechnica.com/science/2026/04/global-growth-in-solar-the-largest-ever-observed-for-any-...
2•AndrewDucker•23m ago•0 comments

Java script error: why The Devil Wears Prada 2's Starbucks tie-in leaves a taste

https://www.theguardian.com/film/2026/apr/21/the-devil-wears-prada-2-starbucks-collaboration
1•TruffleLabs•23m ago•2 comments

California tries to fix its housing mess

https://economist.com/united-states/2025/10/14/california-tries-to-fix-its-housing-mess
1•andsoitis•25m ago•0 comments

Digging for clues about the North Pole's past

https://www.technologyreview.com/2026/04/21/1135231/digging-for-truth-north-pole-past-seabed/
1•joozio•27m ago•0 comments

Schmoozebots: Study finds flattery will get AI everywhere

https://www.theregister.com/2026/04/20/chatbots_win_trust_by_sounding/
1•pseudolus•27m ago•1 comments

Ask HN: Is taking input from your microphone a TRNG?

1•smalltorch•28m ago•0 comments

BlackRock's AI Transformation

https://www.wsj.com/cio-journal/inside-blackrocks-ai-transformation-03a1e8c7
1•monkeydust•28m ago•0 comments

Quantum 'Jamming' Explores the Fundamental Principles of Nature

https://www.quantamagazine.org/quantum-jamming-explores-the-truly-fundamental-principles-of-natur...
1•pseudolus•29m ago•0 comments

Laws of Software Engineering

https://lawsofsoftwareengineering.com
5•milanm081•31m ago•2 comments

Show HN: Rapunzel, a tree-style tab browser for agents

https://github.com/salmanjavaid/rapunzel
1•WasimBhai•31m ago•0 comments

My favorite hard science fiction books by old masters

https://bookdna.com/best-books/hard-science-fiction-by-old-masters
2•bwb•33m ago•1 comments

AI Affiliate Campaign Builder

https://www.indiehackers.com/product/ai-affiliate-campaign-builder
1•rooseveltc•33m ago•0 comments

An amateur historian's favorite books about the Silk Road

https://bookdna.com/best-books/silk-road
1•bwb•34m ago•1 comments