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?

Ethernet Commoditizes Everything. Except EOS

https://routerjockey.com/ethernet-commoditizes-everthing-except-eos-arista-nfd40/
1•tonhe•39s ago•0 comments

Show HN: I built a zero-tracking news hub to escape doomscrolling at (AGE 17y)

1•blazeeofsun•1m ago•1 comments

Anaconda acquires Outerbounds to rein in the buggy code AI agents keep shipping

https://thenewstack.io/anaconda-ai-outerbounds-python-metaflow/
1•Brajeshwar•2m ago•0 comments

Kubereboot/Kured: Kubernetes Reboot Daemon

https://github.com/kubereboot/kured
1•ankitg12•4m ago•0 comments

OpenAI: WebAssembly and Rust Are Reshaping Data Visualization in BI

https://blog.gopenai.com/dashboard-studio-rs-how-webassembly-and-rust-are-reshaping-data-visualiz...
1•mendyberger•4m ago•0 comments

Prism: Demystifying Retention and Interaction in Mid-Training

https://arxiv.org/abs/2603.17074
1•mdp2021•5m ago•0 comments

You probably dont want RLS

https://planetscale.com/blog/rls-sounds-great-until-it-isnt
1•imjosh-dev•6m ago•0 comments

Building a CDC Pipeline, Part 1: PostgreSQL WAL Internals

https://georgioszefkilis.substack.com/p/building-a-cdc-pipeline-part-1-postgresql
1•speckx•6m ago•0 comments

AI could help human scientists pick promising research topics

https://physicsworld.com/a/ai-could-help-human-scientists-pick-promising-research-topics/
1•zeristor•7m ago•0 comments

How A.I. Killed Student Writing (and Revived It)

https://www.nytimes.com/2026/04/30/us/ai-students-cheating-homework-classrooms.html
2•apparent•9m ago•0 comments

Show HN: TRiP – a complete transformer engine in C built from scratch just by me

https://github.com/carlovalenti/TRiP
1•carlovalenti•9m ago•0 comments

Judge Orders Matt Mullenweg to Explain Missing Messages in WP Engine Dispute

https://www.therepository.email/federal-judge-orders-matt-mullenweg-to-explain-missing-messages-i...
2•docdeek•10m ago•0 comments

The Bloomberg Terminal Is Getting an AI Makeover, Like It or Not

https://www.wired.com/story/the-bloomberg-terminal-is-getting-an-ai-makeover-like-it-or-not/
1•01-_-•10m ago•0 comments

Non-Programmer Code Sharing

1•CombatHacker•11m ago•0 comments

Revealing NVIDIA Driver Command Streams for CPU-GPU Runtime Behavior Insight

https://arxiv.org/abs/2604.26889
1•matt_d•11m ago•0 comments

AI optimism is waning

https://bayeslord.substack.com/p/ai-optimism-is-waning
3•swah•12m ago•0 comments

Guardians: Static verification for AI agent workflows

https://github.com/metareflection/guardians
1•matt_d•12m ago•0 comments

CopyFail Was Not Disclosed to Distros

https://www.openwall.com/lists/oss-security/2026/04/30/10
5•ori_b•14m ago•0 comments

Show HN: I built a private GitHub in 650 lines of PostgreSQL

https://github.com/calebwin/gitgres
2•calebhwin•15m ago•0 comments

AI Investment Boosted Economic Growth, While Consumers Tapped the Brakes

https://www.wsj.com/economy/central-banking/u-s-economy-grew-at-2-rate-in-first-quarter-6e0c18cc
1•JumpCrisscross•16m ago•0 comments

Show HN: Larkin – Authorization middleware for x402 agent payments

https://larkin.sh
1•mikebom•16m ago•0 comments

Vision agents vs. structured APIs on the same internal tool task

4•FirestarAlpha•16m ago•0 comments

The Whistleblower Who Uncovered the NSA's 'Big Brother Machine'

https://thereader.mitpress.mit.edu/the-whistleblower-who-uncovered-the-nsas-big-brother-machine/
14•the-mitr•16m ago•0 comments

Xatastor: ZFS and NVMe-Of for Postgres Databases

https://xata.io/blog/xatastor-zfs-nvme-of-for-millions-of-postgres-databases
3•tee-es-gee•17m ago•0 comments

Fast GPU Linear Algebra via Compile Time Expression Fusion

https://arxiv.org/abs/2604.22242
1•matt_d•19m ago•0 comments

American Dads Became the Parents Their Fathers Never Were

https://www.derekthompson.org/p/why-do-richer-dads-spend-more-time
1•ozozozd•19m ago•0 comments

Command Decision System for organizational risk (not average-based)

https://github.com/knuppjason-source/Human-Factors-App
1•Knuppjason•20m ago•0 comments

Show HN: Phase Router – capacity-aware routing for MoE

https://github.com/TSltd/phase_router_rs
1•TSltd•20m ago•0 comments

Largest Digital Human Rights Conference Suddenly Canceled

https://www.404media.co/rightscon-human-rights-conference-suddenly-postponed/
11•Brajeshwar•21m ago•0 comments

Long-Running Agents

https://addyo.substack.com/p/long-running-agents
3•swolpers•23m ago•1 comments