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?

Tacit

https://www.stripe.press/tacit
1•herbertl•12s ago•0 comments

Show HN: MQTT Topic Lab – MQTT client with buttons using command variables

https://github.com/alsoftbv/topic-lab
1•altug•21s ago•0 comments

Is "Parsimony" in context engineering more than token efficiency?

https://blog.rezvov.com/principle-of-parsimony-in-context-engineering
1•alexrezvov•3m ago•1 comments

Show HN: Give anonymous, constructive feedback to colleagues on LinkedIn

https://feedbackok.com/
1•kgthegreat•5m ago•0 comments

We Asked ChatGPT for 10k Salary Benchmarks: Here's How Wrong It Was

https://figures.hr/post/chatgpt-salary-benchmarking
1•hunglee2•5m ago•0 comments

Library of Things – tools, technology, and equipment available to borrow

https://masslibraryofthings.netlify.app
1•dash2•6m ago•0 comments

The Astronaut's Lament

https://alexanderwales.com/the-astronauts-lament/
1•barry-cotter•7m ago•0 comments

Show HN: Iron-Wolf – Wolfenstein 3D source port in Rust

https://github.com/Ragnaroek/iron-wolf
1•ragnaroekX•7m ago•0 comments

The A.I. Disruption Has Arrived, and It Sure Is Fun

https://www.nytimes.com/2026/02/18/opinion/ai-software.html
1•edward•7m ago•0 comments

Show HN:Phloem–Local-first AI memory & causal graphs(MCP server, Zero network)

https://github.com/CanopyHQ/phloem
1•canopyhq•9m ago•0 comments

CacheOverflow – A shared MCP layer to reduce LLM coding hallucinations and costs

https://github.com/GetCacheOverflow/CacheOverflow
1•ilaikim•10m ago•1 comments

Bringing automated preview, review, and merge to Claude Code on desktop

https://claude.com/blog/preview-review-and-merge-with-claude-code
1•iBelieve•10m ago•0 comments

When Your Workouts Turn into a Work of Art (2024)

https://www.nytimes.com/2024/11/25/style/strava-art-animation-duncan-mccabe.html
1•thunderbong•11m ago•0 comments

A tiny menu bar todo app for macOS. single Swift file and open source

https://github.com/Liftof/littletodo
1•liftof•11m ago•0 comments

The 7 Levels of Software Engineering with AI

https://www.principalengineer.com/p/the-7-levels-of-software-engineering
1•wfaler78•14m ago•0 comments

US farmers are rejecting multimillion-dollar datacenter bids for their land

https://www.theguardian.com/technology/2026/feb/21/us-farmers-datacenters
2•cdrnsf•15m ago•0 comments

Show HN: ClaudeUsage – macOS menu bar app to track your Claude Pro usage limits

https://github.com/linuxlewis/claude-usage
1•linuxlewis•15m ago•0 comments

I Have Trust Issues with My AI. Canary Comments Help

https://www.dev-log.me/why_comments_drift_detection/
2•wazHFsRy•15m ago•0 comments

How to Avoid Fake Deals on Amazon During Prime Day

https://www.pricedropnotifications.com/prime_day.html
1•HNCATCH•19m ago•1 comments

Show HN: Quick 3D Typing "Game"

https://www.speedtesttyping.net/
1•karanveer•20m ago•0 comments

Show HN: Airut – Sandboxed Claude Code over Email and Slack

https://github.com/airutorg/airut
1•hardsnow•20m ago•0 comments

Show HN: Ipinsights.io – Free IP threat intelligence with API

https://www.ipinsights.io
2•PeterHedgehog•22m ago•0 comments

The Algebra of Resistance

https://www.profgalloway.com/the-algebra-of-resistance/
2•Brajeshwar•22m ago•0 comments

A Galaxy Composed Almost of Dark Matter Has Been Confirmed

https://www.wired.com/story/a-galaxy-composed-almost-entirely-of-dark-matter-has-been-confirmed/
2•Brajeshwar•22m ago•0 comments

Ancient bacteria strain discovered is resistant to some modern antibiotics

https://www.cnn.com/2026/02/20/science/romania-ice-cave-resistance-antibiotics
2•Brajeshwar•22m ago•0 comments

The Longevity Scam

https://www.theatlantic.com/health/2026/02/longevity-medicine-profit-oversold/686049/
3•XzetaU8•26m ago•1 comments

Payrolls to Prompts: Firm-Level Evidence on the Substitution of Labor for AI

https://arxiv.org/abs/2602.00139
2•talon8635•27m ago•1 comments

Show HN: InkSight – An open-source, LLM-powered e-ink display for "slow info"

https://github.com/datascale-ai/inksight
1•xx123122•28m ago•0 comments

Show HN: I stopped treating my local model as a tool and built it a life cycle

https://github.com/clanker-lover/eidolon-womb
1•clanker-lover•28m ago•0 comments

Canadian trans shooter's disturbing ChatGPT messages alarmed employees

https://nypost.com/2026/02/20/world-news/canadian-trans-shooter-jesse-van-rootselaars-disturbing-...
1•appreciatorBus•29m ago•0 comments