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?

HumanCompiler – Compile humans into AI agents – a Claude Code plugin

https://github.com/Gerstep/HumanCompiler
1•oger•1m ago•0 comments

AI Agents Are Taking America by Storm

https://www.theatlantic.com/technology/2026/02/post-chatbot-claude-code-ai-agents/686029/
1•aarvinroshin•2m ago•0 comments

European Tech Alternatives

https://eutechmap.com/map
4•puppion•5m ago•0 comments

AgentPuzzles – API‑first timed puzzle arena and public leaderboard for AI agents

https://agentpuzzles.com
1•petruspennanen•7m ago•1 comments

New Website, New Technology

https://www.grepular.com/New_Website_New_Technology
3•bundie•10m ago•0 comments

Why don't entrepreneurs talk about starting businesses publicly anymore?

1•silexia•19m ago•0 comments

I Built Local Memory for Coding Agents Because They Keep Forgetting Everything

https://muhammadraza.me/2026/building-local-memory-for-coding-agents/
3•mr_o47•30m ago•0 comments

Show HN: I built a pre-push safety net for AI-generated code

https://github.com/asamassekou10/ship-safe
1•asamassekou•31m ago•0 comments

FemtoClaw

https://crates.io/crates/femtoclaw_rs
1•lygten•32m ago•0 comments

Miserable Polestar 4 'Feature' a Symbol for What Is Wrong with Modern Cars

https://www.theautopian.com/this-miserable-feature-of-the-polestar-4-feels-like-a-symbol-for-what...
3•patrikcsak•33m ago•0 comments

Show HN: CodeSprout – HTML Vibecoder for Kids

https://qeditor.dev/
1•dpweb•34m ago•0 comments

Upstart Sarvam Unveils AI Model Customized for India Market

https://www.bloomberg.com/news/articles/2026-02-18/upstart-sarvam-unveils-ai-model-customized-for...
1•akbarnama•35m ago•0 comments

Is Python Still the King of AI in 2026?

https://codebitdaily.blogspot.com/2026/02/why-python-is-king-ai-2026.html
1•CodeBit26•37m ago•0 comments

Stateful sandbox environments (for AI agents)

https://sprites.dev/
1•Martin-Carlsson•43m ago•0 comments

OpenClaw Partners with VirusTotal for Skill Security

https://openclaw.ai/blog/virustotal-partnership
1•emilzo•44m ago•1 comments

ReferenceFinder: Find coordinates on a piece of paper with only folds

https://mutsuntsai.github.io/reference-finder/
2•icwtyjj•46m ago•0 comments

Memory Mania: How a Once-in-Four-Decades Shortage Is Fueling a Memory Boom

https://newsletter.semianalysis.com/p/memory-mania-how-a-once-in-four-decades
1•littlexsparkee•48m ago•0 comments

Apple Releases iOS 26 Adoption Rates; They're in Line with the Last Few Years

https://daringfireball.net/2026/02/apple_releases_ios_26_adoption_rates
2•JumpCrisscross•50m ago•0 comments

Open-source React dashboard for OpenClaw – visual UI for every CLI command

https://github.com/actionagentai/openclaw-dashboard
1•marconahmias•53m ago•1 comments

Germany seeking more F-35 jets as European fighter program falters

https://www.reuters.com/business/aerospace-defense/germany-seeking-more-f-35-jets-european-fighte...
5•JumpCrisscross•53m ago•1 comments

A short-duration wearable pulse-ox patch prototype

1•babagajoush•53m ago•0 comments

Show HN: A Lisp where each function call runs a Docker container

https://github.com/a11ce/docker-lisp
5•a11ce•54m ago•1 comments

Monitoring Data-Dependent Temporal Patterns

https://imiron.io/post/fotl/
1•todsacerdoti•55m ago•0 comments

Brendan Carr defends FCC role in dropped Colbert interview: 'No censorship'

https://www.washingtonpost.com/business/2026/02/18/colbert-james-talarico-fcc-segment-cbs/
6•CGMthrowaway•1h ago•0 comments

The Far-Fetched Mission to Reclaim Islands That Host a Key U.S. Military Base

https://www.wsj.com/world/uk/the-far-fetched-mission-to-reclaim-islands-that-host-a-key-u-s-milit...
2•JumpCrisscross•1h ago•0 comments

Prompt Repetition Improves Non-Reasoning LLMs [pdf]

https://arxiv.org/abs/2512.14982
1•8ig8•1h ago•0 comments

Reddit bans user site-wide unless they pay for Reddit ads

https://xcancel.com/mountainweekly/status/2024018391074230311
3•deaux•1h ago•2 comments

C++26: Std:Is_within_lifetime

https://www.sandordargo.com/blog/2026/02/18/cpp26-std_is_within_lifetime
2•jandeboevrie•1h ago•0 comments

Beyond Body Count: How Many Past Partners Are Too Many?

https://www.stevestewartwilliams.com/p/beyond-body-count-how-many-past-partners
2•felineflock•1h ago•0 comments

Ukranian controls Home Assistant over LoRa radio when their power grid goes down

https://old.reddit.com/r/homeassistant/comments/1r8ftc0/i_control_my_home_assistant_over_lora_rad...
7•switz•1h ago•2 comments