frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Ask HN: How can I load test PostgreSQL but avoid changing actual data?

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

Moiré materials based on M-point twisting

https://www.nature.com/articles/s41586-025-09187-5
1•Bluestein•31s ago•0 comments

Iota Legacy Migration Tool Issue

https://old.reddit.com/r/Iota/comments/1kx02eb/iota_legacy_migration_tool_issue/
1•Bluestein•8m ago•0 comments

Turns out you can just hack any train in the USA

https://twitter.com/midwestneil/status/1943708133421101446
2•lyu07282•8m ago•1 comments

Kawase Hasui Catalogue

https://mokuhanga1.com/kawase-hasui/
1•vinhnx•8m ago•0 comments

Trump announces 30% tariffs on EU and Mexico, starting Aug. 1

https://www.cnbc.com/2025/07/12/trump-tariffs-european-union-eu-mexico-trade.html
2•kamaraju•19m ago•3 comments

Show HN: I built a entire blogging platform just for myself lol

https://lykhari.com
1•yaKashif•23m ago•0 comments

Ask HN: How important is to learn Software Defined Networking?

1•shivajikobardan•26m ago•0 comments

Govern Amazon Bedrock Gen AI Models in SageMaker Unified Studio

https://aws.amazon.com/blogs/machine-learning/configure-fine-grained-access-to-amazon-bedrock-models-using-amazon-sagemaker-unified-studio/
1•funnyguy678•30m ago•0 comments

Hill Space: Neural nets that do perfect arithmetic (to 10⁻¹⁶ precision)

https://hillspace.justindujardin.com/
2•peili7•31m ago•1 comments

Dynamic Chunking for End-to-End Hierarchical Sequence Modeling

https://arxiv.org/abs/2507.07955
1•fzliu•31m ago•0 comments

Show HN: Invoicesplitter – Split and Rename invoices in seconds

https://www.invoicesplitter.com/
1•Protonu3102•34m ago•0 comments

The Jackpot Age

https://twitter.com/thiccyth0t/status/1943773395209924769
1•Michelangelo11•47m ago•0 comments

Migrating My NAS from CoreOS/Flatcar Linux to NixOS

https://michael.stapelberg.ch/posts/2025-07-13-nixos-nas-network-storage-config/
3•Bogdanp•48m ago•0 comments

Using terminal-notifier in Claude Code to get custom notifications

https://www.andreagrandi.it/posts/using-terminal-notifier-claude-code-custom-notifications/
1•andreagrandi•49m ago•0 comments

Commodore 64 Ultimate gets released

https://www.tomshardware.com/video-games/retro-gaming/the-commodore-64-ultimate-computer-is-the-companys-first-hardware-release-in-over-30-years-pre-orders-start-at-usd299
2•smingo•49m ago•1 comments

AI has killed free developer tools

https://redmonk.com/sogrady/2025/07/09/promiscuity-of-modern-developers/
1•nkko•59m ago•0 comments

Azure MCP exploited: Maliciously leaking user's KeyVault secrets to attackers

https://www.tramlines.io/blog/azure-mcp-exploited-maliciously-leaking-user-s-keyvault-secrets-to-attackers
3•pjmlp•1h ago•1 comments

Python: From Zero to Hero

https://pythonz2h.com/
2•blackpc•1h ago•1 comments

Show HN: Smart Guardian – a privacy-first Chrome extension to protect kids

https://github.com/RezaeiSaber/Smart-Guardian
1•saber123•1h ago•0 comments

Flea Circus

https://en.wikipedia.org/wiki/Flea_circus
3•narpaldhillon•1h ago•0 comments

Show HN: MailDropHQ – Free Disposable Email Without Signup

2•jblopez•1h ago•1 comments

Show HN: Alertify

https://github.com/arebaka/alertify
1•arelive•1h ago•0 comments

M&A Is Dead – Long Live Hire&License

https://startupstechvc.beehiiv.com/p/ma-dead-long-live-hirelicense
3•samuel246•1h ago•0 comments

BBC gains rare access to the Congolese mine powering mobile phones

https://www.bbc.com/news/articles/cyvj986l615o
2•andsoitis•1h ago•0 comments

SearchLTE don't just search it, solve it

https://poe.com/SearchLTE
1•Jon_Behrendt•1h ago•1 comments

mkcd: The missing shell shortcut

https://dbohdan.com/mkcd
3•networked•2h ago•0 comments

The JPEG XL Image Coding History, Features, Coding Tools, Design Rationale

https://arxiv.org/abs/2506.05987
1•ksec•2h ago•0 comments

Show HN: I made a vencord plugin to search for messages across discord

https://blog.jaisal.dev/articles/global-search
1•AtomicByte•2h ago•0 comments

IMO 2025 (International Math Olympiad) starts tomorrow – will DeepMind win Gold?

https://www.youtube.com/watch?v=vJjgtOcXq8A
2•mathsTeacher82•2h ago•1 comments

The largest Git repo on the planet

https://devblogs.microsoft.com/bharry/the-largest-git-repo-on-the-planet/
2•fisheuler•2h ago•0 comments