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

Mhm AGI on a Docker Compose?

1•Kushvinth•57s ago•0 comments

That's a Skill Issue

https://blog.jim-nielsen.com/2026/skill-issue/
1•mc-serious•2m ago•0 comments

Gen Z fearful AI will take their job they're sabotaging company's AI rollout

https://fortune.com/2026/04/08/gen-z-workers-sabotage-ai-rollout-backlash/
1•alberto_yaakov•2m ago•1 comments

India's Navigation System Faces Operational Challenge After Atomic Clock Failure

https://swarajyamag.com/tech/indias-regional-navigation-system-navic-faces-operational-challenge-...
1•KitN•3m ago•0 comments

Tracking down a 25 percent LLVM RISC-V regression

https://blog.kaving.me/blog/tracking-down-a-25-regression-on-llvm-risc-v/
1•fork-bomber•4m ago•0 comments

Constellations

https://www.technologyreview.com/2026/04/10/1135106/jeff-vandermeer-constellations-science-fiction/
1•Kaibeezy•6m ago•0 comments

Show HN: Amber, a capability-based runtime/compiler for agent benchmarks

https://github.com/RDI-Foundation/amber/
1•_nhynes•10m ago•0 comments

SQL Has Problems. We Can Fix Them: Pipe Syntax in SQL (2024)

https://research.google/pubs/sql-has-problems-we-can-fix-them-pipe-syntax-in-sql/
1•mpweiher•12m ago•0 comments

Show HN: GitBalance – a GitHub-style graph to balance work and health

https://gitbalance.com
1•windystockholm•15m ago•0 comments

A Terminal UI (TUI) Alternative to GHelper for Asus ROG / TUF Laptops on Linux

https://github.com/Ichihiroy/ghelper-for-linux
1•ichihiroy•20m ago•0 comments

The pros and cons of stretch goals

https://www.economist.com/business/2026/04/09/the-pros-and-cons-of-stretch-goals
2•andsoitis•24m ago•0 comments

Pix: How Brazil Built the Perfect Payment System [video]

https://www.youtube.com/watch?v=F_5EADTwsis
1•rzk•28m ago•0 comments

Oracle gave its new CFO $26M in stock after firing up to 30k workers

https://moneywise.com/news/top-stories/oracle-gave-its-new-cfo-26m-in-stock-after-firing-up-to-30...
2•robtherobber•31m ago•0 comments

Data breach at European fitness chain Basic-Fit [pdf]

https://corporate.basic-fit.com/docs/Basic-Fit%20informs%20members%20of%20an%20unauthorised%20dat...
2•lode•36m ago•0 comments

Hybrid search (BM25/vectors/RRF) barely improved over pure semantic

1•pjmalandrino•36m ago•0 comments

NavIC's Clock Crisis, and the Indian Clocks That Could Fix It

https://swarajyamag.com/technology/navics-clock-crisis-and-the-indian-clocks-that-could-fix-it
1•robertlangdon•36m ago•0 comments

Show HN: Show HN:CryptographicTimestamps4 human testimony(2HTMLfiles,noserver)

https://github.com/Bardockthegreat/thomas-more-witness-protocol-
1•Bardockthegreat•40m ago•0 comments

Tell HN: AI is bringing back waterfall, here's what I've found

1•keepamovin•44m ago•1 comments

A Git helper tool that breaks large merges into parallelizable tasks

https://github.com/mwallner/mergetopus
2•schusterfredl•45m ago•1 comments

If You're Only Running One Claude Code Session, You're Not Going Fast Enough

https://www.scape.work/blog/you-are-not-going-fast-enough
1•bgnm2000•48m ago•0 comments

We built a Green Screen Remover tool to automate batch green screen removal

https://ugcmaker.io/green-screen-remover
1•MiaTaylor•49m ago•0 comments

Ask HN: How are you handling runtime security for your AI agents?

2•saranshrana•50m ago•0 comments

Site ranks #1 on Google. ChatGPT has never heard of you

https://www.spotlight.cx/blog/keywords-are-dead
2•soorajsanker•54m ago•1 comments

LLMs don't know how to think

https://tictacguy.github.io/Meta-Reasoning/
2•tomolomolo•56m ago•0 comments

Digital Experience Consulting Company – ViitorCloud

https://viitorcloud.com/capabilities/digital-experiences/
1•Olivia_Watson•56m ago•0 comments

Hypotheses for Why Models Fail on Long Tasks

https://www.lesswrong.com/posts/jLZwydRtwRguCjEnd/5-hypotheses-for-why-models-fail-on-long-tasks
1•joozio•57m ago•0 comments

Show HN: Mantyx – Automate and accelerate your Software Operations

https://mantyx.io/software-operations
1•mantyx•57m ago•0 comments

Combining Rate and Instructions to Create Beautiful Madness

https://biggieblog.com/combining-rate-and-instructions-to-create-beautiful-madness/
1•panic•59m ago•0 comments

"Cursor Agent Is a Rebranded Claude Code"

https://twitter.com/jasonkneen/status/2043435856849940818
1•nreece•1h ago•0 comments

Community pushback on GitLab issues overhaul

https://gitlab.com/gitlab-org/gitlab/-/work_items/590689
2•jplunien•1h ago•0 comments