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

Possibility of US selling Australia nuclear submarines is increasingly remote

https://www.theguardian.com/world/2026/feb/05/aukus-nuclear-submarine-deal-us-australia
1•neamar•2m ago•0 comments

Claude Opus 4.6 on ARC-AGI

https://twitter.com/arcprize/status/2019483337400938580/photo/1
1•tosh•4m ago•0 comments

Shifting Left of CI

https://tuananh.net/2026/02/05/shifting-left-of-ci/
1•tuananh•5m ago•0 comments

OpenAI requires ID verification for cybersecurity related tasks

https://openai.com/index/trusted-access-for-cyber/
1•VortexLain•5m ago•0 comments

Thirteen Constants from Zero Free Parameters? What Did I Find?

https://quantummarmelade.substack.com/p/thirteen-constants-from-zero-free
1•obius_prime•6m ago•1 comments

Ask HN: Rust Crates Safety

1•throwaway2027•9m ago•0 comments

Show HN: Agent-smith – Auto-generate AGENTS.md for AI coding assistants

https://github.com/jpoindexter/agentsmith
1•micronink•9m ago•0 comments

The Mystery of the Mole Playing Rough [video]

https://www.youtube.com/watch?v=nwQmwT1ULMU
1•archagon•11m ago•0 comments

Privacy Pass: upgrading to the latest protocol version (2024)

https://blog.cloudflare.com/privacy-pass-standard/
1•walterbell•13m ago•0 comments

Pakistan to test students real-world skills before they graduate from IT degrees

https://www.theregister.com/2026/02/06/pakistan_it_national_skill_competency_test/
2•defrost•13m ago•0 comments

AI Development Company

1•sonniya•14m ago•0 comments

The methodology behind the LLM contamination paper getting sustained cloning

https://adversarialbaseline.substack.com/p/the-silence-is-the-signal
1•user1138•17m ago•0 comments

Culture Is What People Do When No One Is Watching

https://www.robpanico.com/articles/display/?entry_short=culture-is-what-people-do-when-no-one-is-...
2•retrocog•18m ago•0 comments

Show HN: LocaFlow – Localize Your App in 5 Minutes Instead of 8 Hours

https://locaflow.dev
1•nikolaitarasov•18m ago•0 comments

Trading Places (2023)

https://www.tabletmag.com/sections/news/articles/trading-places
1•like_any_other•18m ago•0 comments

Japan cherry blossom festival cancelled because of unruly tourist 'crisis'

https://www.theguardian.com/world/2026/feb/06/japan-cherry-blossom-festival-cancelled-tourists
1•dilawar•19m ago•0 comments

Alphabet could more than double its capex in 2026, unsettling investors

https://www.cnbc.com/2026/02/05/cnbc-daily-open-alphabet-could-more-than-double-its-capex-in-2026...
2•1vuio0pswjnm7•19m ago•0 comments

Show HN: Redtiger Dash Cam

https://redtigerdashcam.net/
1•wangmao•21m ago•0 comments

Explaining how a touchscreen works with a sausage (2025) [video]

https://www.bbc.com/reel/video/p0lv0hqk/explaining-how-a-touchscreen-works-with-a-sausage
1•pajtai•22m ago•0 comments

AI fears pummel software stocks

https://www.cnbc.com/2026/02/06/ai-anthropic-tools-saas-software-stocks-selloff.html
1•1vuio0pswjnm7•23m ago•0 comments

First Proof

https://arxiv.org/abs/2602.05192
1•amichail•23m ago•0 comments

Show HN: Copenhagen building-level metrics derived from airborne Lidar

https://github.com/greyscalar/copenhagen-building-lidar-metrics
1•greyscalar•25m ago•0 comments

The GitButler CLI – Butler's Log

https://blog.gitbutler.com/but-cli
1•samtrack2019•30m ago•0 comments

Deep Dive: How Claude Code's /Insights Command Works

https://www.zolkos.com/2026/02/04/deep-dive-how-claude-codes-insights-command-works.html
2•samename•31m ago•0 comments

Federal Rule Removes Civil Service Protections for High-Ranking Career Employees

https://natlawreview.com/article/new-federal-rule-removes-civil-service-protections-high-ranking-...
1•petethomas•32m ago•0 comments

PaperBanana – Generate publication-ready academic figures with AI

https://www.paperbanana.xyz/
1•RyanMu•33m ago•1 comments

Show HN: Dangerously-skip-permissions IFF it doesn't WRITE outside Sandbox

https://github.com/ContextFort-AI/Runtime-Controls
1•ashwinr2002•35m ago•0 comments

Greg Brockman: "Software development is undergoing a Renaissance"

https://twitter.com/gdb/status/2019566641491963946
1•vinhnx•36m ago•0 comments

Show HN: Hive Agent – Embed Claude Code-like AI agents in your app

2•anetrebskii•36m ago•0 comments

Ask HN: What's the job market like in Bay Area for those looking to relocate?

1•general_reveal•38m ago•1 comments