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

Show HN: Woid – High-performance C++ type erasure and polymorphism library

https://github.com/akopich/woid
1•akopich•1m ago•1 comments

Show HN: Rankiwiki a multilingual community ranking site

1•rankiwiki•2m ago•0 comments

Show HN: VeridisQuo – open-source deepfake detector with explainable AI

https://github.com/VeridisQuo-orga/VeridisQuo
1•theocastillo•3m ago•1 comments

Friday Links #33 – Fresh JavaScript Tools and Trends

https://jsdevspace.substack.com/p/friday-links-33-fresh-javascript
1•javatuts•4m ago•0 comments

Moss-kernel: a Linux-compatible kernel written in Rust

https://github.com/hexagonal-sun/moss-kernel
1•ravenical•8m ago•0 comments

A Simulation of Being Dropped Randomly in the Ocean Every Day for 5 Years

https://old.reddit.com/r/theydidthemath/comments/1q840uk/self_a_simulation_of_being_dropped_rando...
1•debesyla•9m ago•0 comments

Looking Back at the Best Inventions of 2001

https://shkspr.mobi/blog/2026/01/looking-back-at-the-best-inventions-of-2001/
1•blenderob•9m ago•0 comments

Organ Meat Is All the Rage Thanks to MAHA and the Natural Food Fad

https://www.bloomberg.com/news/articles/2026-01-09/liver-heart-and-tallow-are-maha-favorites-foun...
2•helsinkiandrew•10m ago•2 comments

Transcript: Are martial arts the answer to AI? – Yuval Noah Harari

https://www.danielfalbo.com/bookmarks/martial-arts-ai
1•danielfalbo•10m ago•0 comments

No 10: Grok changes 'insulting' and make deepfake creation a 'premium service'

https://uk.finance.yahoo.com/news/no-10-grok-changes-insulting-121140676.html
1•chrisjj•12m ago•0 comments

TuneKit: Fine-Tune SLMs

https://tunekit.app/
1•handfuloflight•12m ago•0 comments

39c3: In-house electronics manufacturing from scratch: How hard can it be? [video]

https://media.ccc.de/v/39c3-in-house-electronics-manufacturing-from-scratch-how-hard-can-it-be
1•fried-gluttony•13m ago•0 comments

TicTacToe for the AGC

https://github.com/NeilFraser/AGC-code/blob/main/Apps/TicTacToe.agc
1•ColinWright•13m ago•0 comments

Casio AE1200WH-1A

https://www.casio.com/us/watches/casio/product.AE-1200WH-1AV/
1•geowalker•14m ago•1 comments

China's humanoid robots come out fighting

https://www.ft.com/content/46d5a159-f6e5-4fd3-a08b-e58dd83ca0b1
1•ashishgupta2209•14m ago•0 comments

Elixir v1.19.5 Released

https://elixirforum.com/t/elixir-v1-19-5-released/73923
2•amalinovic•15m ago•0 comments

The Future of Coding Agents

https://steve-yegge.medium.com/the-future-of-coding-agents-e9451a84207c
1•terryf•15m ago•0 comments

SimpleMem: Efficient Lifelong Memory for LLM Agents

https://github.com/aiming-lab/SimpleMem
1•simonpure•15m ago•0 comments

AI LeetCode Tutor Platform Looking for Beta Users

https://codeboss.codes
1•ubervincet•16m ago•1 comments

The disappointingly ongoing success of WvDial (2009)

https://apenwarr.ca/log/20091224
2•pantalaimon•22m ago•0 comments

Why AI is both the problem and the cure for legacy code

https://leaddev.com/ai/why-ai-both-problem-cure-legacy-code
1•PretzelFisch•22m ago•0 comments

Telegram introduced AI Summaries. I filed bug report for them

https://bugs.telegram.org/c/58400
1•listic•23m ago•1 comments

Chinese Demand for Copper Vanishes After Prices Hit Record

https://finance.yahoo.com/news/chinese-demand-copper-vanishes-prices-075401948.html
2•thomassmith65•23m ago•0 comments

Wizio Bundle App

https://apps.shopify.com/wizio-product-bundle-upsell
1•wizioapp•23m ago•0 comments

How to Go to China (Again)

https://nicholasachow.substack.com/p/how-to-go-to-china-again
1•martialg•25m ago•0 comments

Fragments: January 8

https://martinfowler.com/fragments/2026-01-08.html
1•gpi•26m ago•0 comments

Robot accidentally kicks its operator in the groin while teleportation

https://scienceclock.com/robot-kicks-trainer-groin/
2•akg130522•27m ago•0 comments

Lessons from starting, building, and exiting a devtools startup (2024)

https://boristane.com/blog/learnings-from-starting-building-and-exiting-a-devtools-startup/
1•tosh•28m ago•0 comments

TongueFu – Martial Art of conversations - 10 credits free

https://tonguefu.app
1•abhi555shek•31m ago•1 comments

Apify Agent [Preview]: FOSS Browser Automation Pipeline

https://apify.com/cyberfly/apify-agent
1•cybrefly•32m ago•1 comments