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

Arbitrage

https://grokipedia.com/page/Arbitrage
1•BruceEel•51s ago•0 comments

Brazilian Internet Forum (FIB16) in Belém, Pará: A Visual Tour

https://manualdousuario.net/en/brazilian-internet-forum-fib16-belem-pictures/
1•rpgbr•1m ago•1 comments

Claude Talk Small. Code Still Big

https://spatie.be/blog/claude-talk-small-code-still-big
1•speckx•1m ago•0 comments

The MQ-28 Ghost Bat Is Now Flying in the U.S.

https://theaviationist.com/2026/05/28/the-mq-28-ghost-bat-is-now-flying-in-the-u-s/
1•big_toast•3m ago•0 comments

// The hope is that Claude Code will be unusable on this repository

https://codeberg.org/forgejo-contrib/forgejo-cli/src/branch/main/src/main.rs#L88-L91
1•themgt•5m ago•0 comments

Teaching tmux to babysit my Claude Code agents

https://blog.angeloff.name/post/2026/05/29/teaching-tmux-to-babysit-my-claude-code-agents/
1•StanAngeloff•5m ago•0 comments

The mechanism behind how capsaicin tolerance develops

https://old.reddit.com/r/askscience/comments/hqiut/comment/c1xlzlb/
1•abr0ahm•5m ago•0 comments

Kalshi launches perpetual futures in America

https://news.kalshi.com/p/kalshi-launches-perpetual-futures-america
1•durron•6m ago•0 comments

European startup and scaleup scoreboard: Country reports

https://research-and-innovation.ec.europa.eu/knowledge-publications-tools-and-data/publications/a...
1•jruohonen•6m ago•0 comments

MIT EECS/CSAIL Agentic Coding in Practice Seminar Series

https://people.csail.mit.edu/saman/acpss/
1•matt_d•8m ago•0 comments

The Load-Balance Problem Behind Hybrid Parallelism

https://hecate0821.github.io/blogs/hybrid-parallel-post-training/
1•matt_d•8m ago•0 comments

Deadly fungal storms are sweeping US and spreading disease few doctors recognize

https://www.sciencefocus.com/planet-earth/dust-storms-us-blood-rain
1•ck2•11m ago•1 comments

"I somehow managed to import 1.8M books to calibre"

https://old.reddit.com/r/DataHoarder/comments/1tr37eb/i_somehow_managed_to_import_18m_books_to_ca...
2•r721•12m ago•0 comments

Show HN: I launched a micro-gig marketplace and used it to buy my own GTM plan

1•alanhalley•15m ago•0 comments

Auto-review mode is now available in Cursor

https://cursor.com/changelog/auto-review
2•davidgomes•16m ago•0 comments

Delayed Tensor Parallelism for Faster Transformer Inference

https://blog.kog.ai/delayed-tensor-parallelism-for-faster-transformer-inference/
1•matt_d•16m ago•0 comments

Aliens.gov

https://www.whitehouse.gov/aliens/
3•saikatsg•17m ago•2 comments

The Compose Key and –/.XCompose

https://blog.gavide.dev/blog/compose-key-linux
2•gavide•17m ago•0 comments

The Machine God Wants to Talk to You

https://twitter.com/olvrgln/status/2060419489351754049
1•OliverGilan•20m ago•0 comments

SQLite is all you need for durable workflows

https://obeli.sk/blog/sqlite-is-all-you-need-for-durable-workflows/
15•tomasol•20m ago•5 comments

A call for secure coding standards across the Canada government

https://bsky.app/profile/shehackspurple.bsky.social/post/3mmz25aplk52a
1•mooreds•20m ago•0 comments

Nvidia Twitter Post Teasing: A New Era of PC

https://twitter.com/nvidia/status/2060390710797328574
1•HeyMeco•22m ago•2 comments

Multiplayer Harness for Agents and Humans

https://thruwire.ai
1•noashavit•22m ago•0 comments

The Greatest Show on Earth: The Evidence for Evolution

https://en.wikipedia.org/wiki/The_Greatest_Show_on_Earth:_The_Evidence_for_Evolution
2•chistev•23m ago•0 comments

Tesla's AI trainers don't trust its self-driving tech – or its safety stats

https://www.reuters.com/investigations/why-teslas-ai-trainers-dont-trust-its-self-driving-tech-or...
4•grassfedgeek•24m ago•2 comments

What if remote working, not AI, is to blame for weak junior hiring?

https://www.ft.com/content/2205e2d0-50dc-4e80-9bf7-78d0272276c0
3•uxhacker•25m ago•1 comments

Google DeepMind's AlphaProof Nexus solves decades-old math problems

https://the-decoder.com/google-deepminds-alphaproof-nexus-solves-decades-old-math-problems-for-a-...
1•gmays•28m ago•0 comments

Robinhood now lets your AI agents trade stocks

https://techcrunch.com/2026/05/27/robinhood-now-lets-your-ai-agents-trade-stocks/
31•wapasta•28m ago•34 comments

Sample Music with Chrome

https://www.tabsampler.com/
1•asolis0105•29m ago•2 comments

Mosquitoes seem to be getting over insect repellent

https://www.economist.com/science-and-technology/2026/05/28/mosquitoes-seem-to-be-getting-over-in...
1•Brajeshwar•29m ago•1 comments