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?

TNI and TNI-R: Transient Node Integration for Precision Orbital

https://zenodo.org/records/17809868
1•okushigue•3m ago•1 comments

Aerogel can make the ocean drinkable [video]

https://www.youtube.com/shorts/OW9Mq3wrEqY
1•thelastgallon•5m ago•0 comments

ACM Digital Library started showing AI summaries of articles with abstracts

https://dl.acm.org/generative-ai/summarizations
1•andrybak•5m ago•1 comments

Weird Generalization and Inductive Backdoors: New Ways to Corrupt LLMs

https://arxiv.org/abs/2512.09742
1•bediger4000•5m ago•0 comments

'Twitter never left:' X sues Operation Bluebird for trademark infringement

https://www.theverge.com/news/845882/x-corp-operation-bluebird-twitter-lawsuit-trademark-infringe...
2•g-b-r•7m ago•0 comments

The Joy of Hex and Brouwer's Fixed Point Theorem (2013)

https://vigoroushandwaving.wordpress.com/2013/09/30/the-joy-of-hex-and-brouwers-fixed-point-theorem/
1•nill0•8m ago•0 comments

New Ways to Corrupt LLMs

https://cacm.acm.org/blogcacm/new-ways-to-corrupt-llms/
3•zdw•17m ago•0 comments

AI and camera counter human trafficking

https://spectrum.ieee.org/traffickcam-human-trafficking-hotel-ai
1•asdefghyk•20m ago•1 comments

AI Browser Extensions Leave Fingerprints Everywhere

https://webdecoy.com/blog/detect-ai-browser-extensions-claude-chatgpt-copilot/
3•cport1•22m ago•0 comments

Norman Podhoretz, 1930-2025

https://www.commentary.org/john-podhoretz/norman-podhoretz-1930-2025/
1•stmw•30m ago•0 comments

FTX insider Caroline Ellison has been moved out of prison

https://www.businessinsider.com/caroline-ellison-prison-release-ftx-sam-bankman-fried-2025-12
7•harambae•37m ago•1 comments

The Genius Effects of Old Movies [video]

https://www.youtube.com/watch?v=TunR4zCQ5Fk
3•billybuckwheat•43m ago•0 comments

Show HN: Made a Visionboard Tool

https://visionboardit.art/
1•girlwhocode•44m ago•0 comments

Minimum Viable Benchmark (For Evaluating LLMs)

https://blog.nilenso.com/blog/2025/11/28/minimum-viable-benchmark/
1•todsacerdoti•45m ago•0 comments

Fara-7B: An Efficient Agentic Model for Computer Use

https://www.microsoft.com/en-us/research/blog/fara-7b-an-efficient-agentic-model-for-computer-use/
1•mjshashank•46m ago•0 comments

Apple TV's new intro was done practical, not CGI or AI [video]

https://www.youtube.com/shorts/C3uLRJGVkmo
4•busymom0•50m ago•2 comments

Luminar Technologies, Inc. Initiates Voluntary Chapter 11 Proceedings

https://investors.luminartech.com/news-events/press-releases/detail/110/luminar-technologies-inc-...
2•rguiscard•57m ago•0 comments

The Lost Generation

https://www.compactmag.com/article/the-lost-generation/
6•koolba•1h ago•0 comments

Video: Lunar impact flash detected on the moon by Armagh Observatory

https://phys.org/news/2025-12-video-lunar-impact-moon-armagh.html
3•1659447091•1h ago•0 comments

How I Assess Open Source Libraries

https://nesbitt.io/2025/12/15/how-i-assess-open-source-libraries.html
1•gpi•1h ago•0 comments

Deaf Crocodile Blu-Rays

https://deafcrocodile.com/collections/blu-rays
2•gregsadetsky•1h ago•0 comments

The Core Problems of AI Coding

https://magong.se/posts/real-problems-ai-coding-lesswrong
2•mikasisiki•1h ago•0 comments

Project Zeros New Website

https://projectzero.google/
1•0xkato•1h ago•1 comments

Show HN: Website to APK Convertor

https://website2apps.com/
1•Codegres•1h ago•1 comments

Building a WASM Runner with Cloud Hypervisor

https://burakemir.ch/post/building-wasm-runner/
1•todsacerdoti•1h ago•0 comments

A Guide to Magnetizing N48 Magnets in Ansys Maxwell

https://blog.ozeninc.com/resources/from-datasheet-to-demagnetization-a-guide-to-magnetizing-n48-m...
3•peter_d_sherman•1h ago•0 comments

The Bifurcation in the AI Market

https://tomtunguz.com/2025-12-16-open-router-insights/
2•jaynate•1h ago•0 comments

OpenAI in Talks to Raise $10B, Adopt Amazon's AI Chips

https://www.bloomberg.com/news/articles/2025-12-17/openai-in-talks-to-raise-10-billion-from-amazo...
2•marc__1•1h ago•1 comments

Show HN: Better Gmail Tabs – turn search queries into tabs for fast email load

https://chromewebstore.google.com/detail/better-gmail-tabs/ffgbhpheihcopgdlgbabanhbgemohjgc
1•jharohit•1h ago•0 comments

Show HN: Obsidenc – a Rust-based paranoid-grade encryption utility

https://github.com/markrai/obsidenc
2•markrai•1h ago•0 comments