frontpage.
newsnewestaskshowjobs

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?

Neural Representation of Minimal Surfaces

https://arxiv.org/abs/2607.23437
1•E-Reverance•55s ago•0 comments

CTO / Head of Eng / VPE folks at startups are leaving / burning out

https://twitter.com/GergelyOrosz/status/2081845248120988114
1•tosh•1m ago•0 comments

Meta disregarded its own research on teen harm, Tennessee tells jury

https://www.reuters.com/legal/litigation/meta-disregarded-its-own-research-teen-harm-tennessee-te...
1•1vuio0pswjnm7•1m ago•0 comments

PyTorch: A Reference Language

https://docs.pytorch.org/devlogs/compiler/2026-07-25-pytorch-a-reference-language/
1•matt_d•2m ago•0 comments

Migrating 6.5B Rows from MongoDB

https://usefathom.com/blog/migrating-gauges-from-mongodb
1•okozzie•4m ago•0 comments

AI Tools Uncover Record Software Flaws in Tech Sector, Database Shows

https://www.bloomberg.com/news/articles/2026-07-27/ai-hunts-for-cyber-flaws-finding-record-number...
1•justworks•6m ago•0 comments

API Testing Chrome Extension(REST, Soap, WebSockets, SSE)

https://chromewebstore.google.com/detail/repost-api-tester/eipmeckflplenlbnlhbpmjojahephhkp
1•info-chirila•7m ago•0 comments

Why Agentic Systems Need Ontologies [video]

https://www.youtube.com/watch?v=Sir59K8ZDPU
2•handfuloflight•12m ago•0 comments

Half-Life on a Real PlayStation 1 – Full Hazard Course, Uncut [video]

https://www.youtube.com/watch?v=aEaa9CeCsbQ
2•unlabeledmabel•16m ago•0 comments

Token Use by Model

https://twitter.com/jpschroeder/status/2081751862768717956
2•MrBuddyCasino•16m ago•0 comments

Show HN: Etymology Database from Wiktionary

https://etymologue.com/
2•jlauf•19m ago•0 comments

Day 0 Kimi-K3 Inference Deployment with Atom on AMD Instinct MI355X GPUs

https://www.amd.com/en/developer/resources/technical-articles/2026/kimi-k3-on-amd-instinct-gpus.html
3•stevefan1999•19m ago•0 comments

Capturing the Narrative

https://arxiv.org/abs/2607.23993
3•jruohonen•26m ago•1 comments

CastToAny – Turn podcasts and videos into publish-ready content

https://casttoany.com
3•freerick•29m ago•0 comments

Show HN: A 6M-token movable window on a single 46GB GPU

https://arxiv.org/abs/2607.23806
2•Wetime•36m ago•0 comments

eBay and former execs will pay $56M to settle harassment of Natick couple

https://www.bostonglobe.com/2026/07/27/business/ebay-harassed-ina-david-steiner-settlement/
5•apress•37m ago•0 comments

What will more intelligence do for us

https://www.noahpinion.blog/p/what-will-more-intelligence-actually
4•paulpauper•38m ago•0 comments

Would You Go Back to a Time Before Smartphones If You Could?

https://www.theatlantic.com/podcasts/2026/07/would-you-go-back-to-a-time-before-smartphones-if-yo...
4•paulpauper•39m ago•1 comments

Another Symptom of Growing Isolation

https://www.theatlantic.com/family/2026/07/talking-less-reasons/688074/
3•paulpauper•39m ago•0 comments

Protocol-Level Attacks on Agentic Commerce Platforms: Taxonomy and Defense

https://arxiv.org/abs/2607.21824
2•sbulaev•41m ago•0 comments

"Opus 5 is a really bad model"

https://twitter.com/HarukaKunori/status/2081697911847481502
7•behnamoh•45m ago•0 comments

A Science of Reality: Observers, Interfaces, and Traces [pdf]

https://traceinstitute.org/papers/TRACE_INSTITUTE_WHITE_PAPER.pdf
3•andsoitis•47m ago•0 comments

Why do we think we understand the world more than we actually do?

https://thedecisionlab.com/biases/the-illusion-of-explanatory-depth
5•rramadass•47m ago•1 comments

Claude Fable 5: What It Is and Why the Hype?

https://lazerg.uz/en/blog/claude-fable-5-nima
3•lazerg•49m ago•0 comments

The age of token efficiency, the age of libraries

https://golemui.com/blog/the-age-of-token-efficiency/
3•handfuloflight•52m ago•0 comments

Ex-JPMorgan banker Chirayu Rana files fed civil rights suit; racism/sexual abuse

https://www.morningstar.com/news/pr-newswire/20260727ny12568/former-jpmorgan-executive-files-swee...
2•sizzle•52m ago•1 comments

Manticore Search 28.4.4:Faster KNN, conversational search, installs and faceting

https://medium.com/@s_nikolaev/manticore-search-28-4-4-faster-knn-better-conversational-search-an...
2•snikolaev•53m ago•0 comments

VibeUE: Unreal Engine Vibe Coding Tool

https://github.com/kevinpbuckley/VibeUE
2•nateb2022•54m ago•0 comments

Newspeak

https://github.com/dv-hart/newspeak
2•handfuloflight•1h ago•0 comments

Show HN: I taught Claude Code to file Indian income-tax returns (ITR)

https://github.com/karanb192/itr-wala
2•karanb192•1h ago•0 comments