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?

A Programmer's Introduction to Mathematics

https://pimbook.org/
1•u1hcw9nx•38s ago•0 comments

Bash and JSON Is All You Need: Microsoft Deletes Every Agent Tool, Beats Claude

https://arxiv.org/abs/2612.02442
2•mrkn1•1m ago•0 comments

Bring back Gmail "Send mail as" using JMAP

https://github.com/ndcterm/sendfromgmail
1•ndcterm•1m ago•0 comments

MedGemma 2: our most advanced open model for healthcare

https://blog.google/innovation-and-ai/technology/health/medgemma-2/
1•dvaplima•1m ago•0 comments

Show HN: CLI to share secrets with post-quantum crypto

https://github.com/scosman/secret_share
1•scosman•2m ago•0 comments

No one cares about DevEx anymore

https://leaddev.com/culture/no-one-cares-about-devex-anymore
1•mooreds•2m ago•0 comments

Craft: A Tendon-Driven Hand with Hybrid Hard-Soft Compliance

https://arxiv.org/abs/2603.12120
1•PaulHoule•3m ago•0 comments

Rex is now generally available

https://www.superlogical.com/rex
1•kylebarron•3m ago•0 comments

Three emails to send when an invoice goes late

https://4600859971805.gumroad.com/l/zyiqao
1•lateinvoice•3m ago•0 comments

Problems at SoftBank

https://hntrbrk.com/investigations/softbank
1•stevefan1999•3m ago•0 comments

Qualcomm High Bandwidth Compute (HBC) – HBM Replacement (Fused Compute+Mem Dies)

https://www.qualcomm.com/data-center/expertise/ai-accelerators
1•peter_d_sherman•3m ago•0 comments

What's the best coding agent harness? I built a benchmark to find out

https://fariszr.com/benchmarks/
2•fariszr•4m ago•0 comments

Entities Identified as Chinese Military Companies [pdf]

https://media.defense.gov/2026/Jun/08/2003945537/-1/-1/1/ENTITIES-IDENTIFIED-AS-CHINESE-MILITARY-...
2•mgh2•5m ago•0 comments

Ask HN: What if all banking records vanished worldwide?

3•michaelsbradley•5m ago•0 comments

Tinyagent – a ReAct agent loop you can read in one sitting (~600 LOC TS)

https://github.com/riverlee798/tinyagent
2•riverlee798•5m ago•0 comments

Otter Yoga

https://westmeister.com/otter-yoga/
2•mooreds•5m ago•0 comments

Proof of Geography – Verify server location via speed-of-light bounds

https://nytex.com/proofofgeography
3•robmay•5m ago•2 comments

Noden: macOS SSH, SFTP and RDP Client with a Vault

https://nodenapp.com/
2•thunderbong•7m ago•0 comments

ArkType 3.0 – Set-theoretic precompiled TS validator

https://arktype.io/docs/blog/3.0
1•ssalbdivad•8m ago•0 comments

SoftBank Props Up Arm to Fund Its AI Empire

https://hntrbrk.com/investigations/arm
2•stevefan1999•10m ago•0 comments

Ask HN: Did 'datasheets for datasets' ever take off?

2•padraic7a•11m ago•0 comments

Why Quantum Key Distribution provides permanent security

https://www.zerothird.com/technology/qkd-vs-traditional-cryptography
2•mnewme•11m ago•0 comments

Systems Research Is the Job

https://rakyll.org/systems-research/
2•aray07•12m ago•0 comments

'No longer a drill': OpenAI, Anthropic and Microsoft call for urgent switch

https://www.theguardian.com/technology/2026/dec/03/microsoft-google-apple-anthropic-open-ai-joint...
3•matanyall•13m ago•2 comments

Tesla shareholders set to meet as SpaceX merger talks loom

https://www.reuters.com/legal/transactional/tesla-shareholders-set-meet-spacex-merger-talks-loom-...
2•aghuang•13m ago•0 comments

JEPA world models need a better benchmark than Push-T

https://haddyalchaer.com/pusht-pro
1•halcdev•14m ago•0 comments

Show HN: Blur Photo Online

https://blurphoto.app/
1•artiomartiom•14m ago•0 comments

Tesla and SpaceX could merge by Christmas

https://finance.yahoo.com/technology/article/tesla-and-spacex-could-merge-by-christmas-report-163...
2•nephihaha•14m ago•0 comments

Banks are offloading AI and data center debt via risk transfers

https://www.bloomberg.com/news/articles/2026-12-03/ai-chip-loan-worth-3-1-billion-stalls-despite-...
3•Gonzih•15m ago•0 comments

Show HN: CodeYam, a free software factory for the coding agent you use

https://github.com/codeyam-ai/codespaces-starter
1•nadis•16m ago•1 comments