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

Ask HN: Have you successfully treated forward head posture ("nerd neck")?

1•trashymctrash•57s ago•0 comments

Snabbit, Urban Company instant maid female gig workers in India work in fear

https://theprint.in/ground-reports/snabbit-urban-company-women-gig-workers-molested-delhi-bengalu...
1•dinosor•6m ago•1 comments

JPEG Compression

https://www.sophielwang.com/blog/jpeg
2•7777777phil•6m ago•0 comments

Why Do Humanoid Robots Still Struggle with the Small Stuff?

https://www.quantamagazine.org/why-do-humanoid-robots-still-struggle-with-the-small-stuff-20260313/
1•Brajeshwar•6m ago•0 comments

How Can Governments Pay Open Source Maintainers?

https://shkspr.mobi/blog/2026/03/how-can-governments-pay-open-source-maintainers/
2•robin_reala•11m ago•0 comments

Show HN: I built Wool, a lightweight distributed Python runtime

https://github.com/wool-labs/wool
3•bzurak•13m ago•1 comments

A Swiss Paperwork Massacre: Why We Fled to Stripe

https://octigen.com/blog/posts/2026-03-09-payment-nightmare/
4•m_mueller•15m ago•0 comments

Ask HN: Will US send ground troops to Iran?

2•general_reveal•22m ago•3 comments

Python JSON SQL DB

https://github.com/andre-git/pysql
1•andre-hn•22m ago•0 comments

Image generation models can think

https://medium.com/seeds-for-the-future/nano-banana-2-image-generators-can-now-think-462a017a95c1
4•hungryminded•25m ago•0 comments

Why Do Clocks Move Clockwise?

https://historyfacts.com/science-industry/article/why-do-clocks-move-clockwise/
2•thunderbong•26m ago•1 comments

Show HN: Clawscribble – Give your AI agent a 32×32 canvas to paint on

https://clawscribble.com/
2•makkoncept•27m ago•0 comments

The datacenter where the day starts with topping up cerebrospinal fluid

https://www.theregister.com/2026/03/14/cortical_labs_biological_cloud/
1•Brajeshwar•28m ago•0 comments

Cycle 33 of the Training of 'Forge'

https://forgeintelligence.substack.com/p/forge-intelligence-edition-7
1•beakmull•28m ago•0 comments

Licensed Microwave Link Map

https://maps.streakwave.com/
2•gregsadetsky•29m ago•0 comments

Show HN: Fusionaly, Web Analytics with SQLite

https://fusionaly.com/
1•karloscodes•30m ago•1 comments

Moscow's Internet Outages Drive Sales of Pagers and Paper Maps

https://www.bloomberg.com/news/articles/2026-03-13/moscow-s-internet-outages-drive-sales-of-pager...
1•geox•31m ago•0 comments

The Forth Language [Byte Magazine Volume 05 Number 08]

https://archive.org/details/byte-magazine-1980-08
2•AlexeyBrin•31m ago•0 comments

Chip material prices double with Middle East crisis

https://www.tomshardware.com/tech-industry/chip-material-prices-double-as-middle-east-conflict-co...
1•giuliomagnifico•35m ago•0 comments

BETO – A protocol that formalizes what LLMs don't know

https://github.com/aramirez-maza/beto-framework
3•aramirez_maza•38m ago•1 comments

OctopusOS – an operating system for governed AI agents

https://octopusos.ai/
3•octopusos•38m ago•2 comments

unix is the next ai evolution

https://www.jeriko.ai/
2•Khaleel7337•41m ago•1 comments

Show HN: RSSext – Not a reader, a Chrome ext with the orig RSS protocol spirit

https://github.com/tchoa91/RSSext
1•tchoa91•43m ago•1 comments

Columba: Messages and voice calls without internet

https://columba.network/
2•XzetaU8•44m ago•0 comments

Show HN: Vercel Blob AI SDK Tools

https://github.com/vercel-labs/vercel-blob-ai-sdk
1•flashbrew•45m ago•0 comments

You Can Approximate Pi by Dropping Needles on the Floor

https://www.wired.com/story/you-can-approximate-pi-by-dropping-needles-on-the-floor/
1•Brajeshwar•47m ago•0 comments

'RAMmageddon' hits labs: AI-driven memory shortage is impacting science

https://www.nature.com/articles/d41586-026-00844-x
3•giuliomagnifico•48m ago•0 comments

Things we learned building for the first generation of agentic commerce

https://stripe.com/blog/10-lessons
1•y1n0•49m ago•0 comments

The Download: how AI is used for military targeting, and The Pentagon's war on

https://www.technologyreview.com/2026/03/13/1134278/the-download-defense-official-ai-chatbots-tar...
1•joozio•51m ago•0 comments

Temperatures expected to remain at or near record levels in coming five years

https://www.metoffice.gov.uk/about-us/news-and-media/media-centre/weather-and-climate-news/2025/g...
3•Anon84•52m ago•0 comments