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

Show HN: Assay – Found 250 bugs in LiteLLM, LobeChat via AI code verification

https://github.com/gtsbahamas/hallucination-reversing-system
1•tywellshn•2m ago•1 comments

Chris Lattner evaluates the Claude C Compiler

https://www.modular.com/blog/the-claude-c-compiler-what-it-reveals-about-the-future-of-software
1•adas0693•4m ago•1 comments

FB – Clean My Feeds

https://greasyfork.org/en/scripts/431970-fb-clean-my-feeds-5-02
1•gslin•4m ago•0 comments

OpenAI had banned account of Tumbler Ridge, B.C., shooter; reached out to RCMP

https://www.cbc.ca/lite/story/9.7100497
1•colinprince•7m ago•0 comments

The RL Architecture Behind Minimax M2.5

https://twitter.com/neural_avb/status/2022715561390776524
1•gmays•9m ago•0 comments

Go devs: What should we do with CLs generated by AI?

https://groups.google.com/g/golang-dev/c/4Li4Ovd_ehE/m/8L9s_jq4BAAJ
2•nnx•11m ago•0 comments

GenAI for Systems: Recurring Challenges&Design Principles from SW to Silicon

https://arxiv.org/abs/2602.15241
1•matt_d•12m ago•0 comments

Excessive token usage in Claude Code

https://github.com/anthropics/claude-code/issues/16856
1•behnamoh•15m ago•0 comments

ThresholdIQ-Alert Simulator

https://thresholdiq.app/
1•vigneshj•17m ago•1 comments

Ask HN: Are a lot of the companies turning the screws?

2•ronbenton•19m ago•0 comments

Show HN: Single HTML opinionated Kanban board

https://github.com/harshhemani/flowboard
1•ulam2•21m ago•0 comments

They Do Mean the Effect on Jobs

https://thezvi.wordpress.com/2026/02/19/ai-156-part-1-they-do-mean-the-effect-on-jobs/
1•gmays•25m ago•0 comments

Asos co-founder dies in fall from 18-storey building in Thailand

https://www.theguardian.com/world/2026/feb/20/asos-cofounder-quentin-griffiths-killed-fall-apartm...
3•bookofjoe•26m ago•1 comments

Foetal alcohol syndrome: Why fathers need to watch what they drink too (2024)

https://www.bbc.com/future/article/20240801-fetal-alcohol-syndrome-the-overlooked-risk-of-fathers...
1•1659447091•27m ago•0 comments

They Think

https://ericsilberstein1.github.io/how-they-think-book/
1•whobre•36m ago•0 comments

Reggae the seal uses rubber ducks for daily enrichment training

https://apnews.com/article/reggae-seal-rubber-duck-boston-aquarium-training-b0c43808394cc73586368...
1•1659447091•41m ago•0 comments

Show HN: CRTX – AI code gen that tests and fixes its own output (OSS)

https://github.com/CRTXAI/CRTX
1•johnnycash926•45m ago•0 comments

US 500 Excluding Artificial Intelligence Enablers Price Return Index

https://www.google.com/finance/quote/SPXXAI:INDEXCME
3•mattas•49m ago•0 comments

Show HN: Check iOS Cert Status via our easy to use API

https://novadev.vip/api/
2•SuperGamer474•51m ago•0 comments

A war foretold:how the CIA and MI6 got hold of Putin's Ukraine plans and why

https://www.theguardian.com/world/ng-interactive/2026/feb/20/a-war-foretold-cia-mi6-putin-ukraine...
4•geoka9•54m ago•0 comments

The coding agent is dead

https://ampcode.com/news/the-coding-agent-is-dead
2•ElasticBottle•56m ago•1 comments

Klarna's shift to AI agents threatens traditional SaaS valuations

https://roundly.io/blog/klarna-ai-agents-replacing-saas
2•roundly_io•59m ago•1 comments

Show HN: YAML-schema-router – content-based schema routing for yaml ls

https://github.com/traiproject/yaml-schema-router
2•drLuca•1h ago•1 comments

Show HN: TypstMe – Build ATS-proof resumes using Typst and WASM

2•yoangilliand•1h ago•1 comments

Ask HN: Can RAG be used for recommendation system?

2•pinner•1h ago•0 comments

Ask HN: What happens to all the hardware when data centers upgrade?

4•givemeethekeys•1h ago•1 comments

CSLib: A Focused Effort on Formalizing Computer Science in Lean

https://www.cslib.io/
2•md224•1h ago•0 comments

Steve Webber on Multics

https://www.youtube.com/watch?v=0gzjrF9r6QA
2•twoodfin•1h ago•0 comments

Unlocking full-body human motor learning at scale

https://amathislab.github.io/mm-blog/
2•moatmoat•1h ago•0 comments

A Bollywood Spy Thriller Crosses the India-Pakistan Divide

https://www.bloomberg.com/news/articles/2026-02-20/bollywood-epic-dhurandhar-breaks-records-in-in...
2•petethomas•1h ago•0 comments