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: AccessiGuard – Web accessibility scanner with AI fix suggestions

https://accessiguard.app
1•PrimeStark•1m ago•0 comments

VC-backed unicorns are losing their horns

https://www.axios.com/2026/02/13/vc-unicorn-companies
1•toomuchtodo•6m ago•1 comments

ArsTechnica seemingly using AI to write an article about AI impersonation

https://arstechnica.com/ai/2026/02/after-a-routine-code-rejection-an-ai-agent-published-a-hit-pie...
2•AdmiralAsshat•8m ago•0 comments

How Nintendo Became the Most Fun Video Game Company

https://www.nytimes.com/2026/02/06/books/review/podcast-keza-macdonald-nintendo.html
2•CharlesW•10m ago•0 comments

Txtbrd

https://txtbrd.com
2•1o1o1o1o1•10m ago•0 comments

Perfect Squares and Pythagorean Triples on the Ulam Spiral

https://www.youtube.com/watch?v=x4ooQSrdz6g
1•nyc111•13m ago•0 comments

Possible identification of the Luna 9 Moon landing site using machine learning

https://www.nature.com/articles/s44453-025-00020-x
1•geox•14m ago•0 comments

We allowed remote code execution (but safely)

https://tumuchdata.club/post/coding-challenge-infrastructure/
1•todsacerdoti•14m ago•0 comments

Sovereign Code from the Heart of Suffering: Injecting Logic into AI

Https://paragraph.com/@0x4fd3729a4fedf54a74b73d93f7f775a1ef520cec/sovereign-logic-injection-how-t...
1•suffering•14m ago•1 comments

Resurrected nitrogenases recapitulate N-isotope biosignatures over 2B years

https://pmc.ncbi.nlm.nih.gov/articles/PMC9755046/
1•PaulHoule•14m ago•1 comments

Where will China get its compute in 2026?

https://www.the-substrate.net/p/where-will-china-get-its-compute
1•erwald•15m ago•0 comments

Show HN: Superposition, open source access to Claude Code or Codex from anywhere

https://github.com/trezm/superposition
1•trezm•16m ago•0 comments

The EU moves to kill infinite scrolling

https://www.politico.eu/article/tiktok-meta-facebook-instagram-brussels-kill-infinite-scrolling/
18•danso•17m ago•15 comments

No Here on Slack

https://noathere.org/
2•jcmuller•18m ago•0 comments

Humans as Constancy Anchors: A Response to 'Something Big Is Happening'

2•mrev2•20m ago•1 comments

Show HN: ARA-Engine – Modeling the Alberta power grid transition in Python

https://github.com/ada33934/ARA-Engine
1•ada33934•21m ago•0 comments

The AI hater's guide to code with LLMs

https://aredridel.dinhe.net/2026/02/12/the-ai-haters-guide-to-code-with-llms/
3•speckx•23m ago•0 comments

Show HN: An MCP server that gives AI assistants a live Mermaid diagram canvas

https://github.com/iishyfishyy/mermaid-live-mcp
1•ishyfishyy•24m ago•0 comments

Ask HN: Are there examples of 3D printing data onto physical surfaces?

1•catapart•25m ago•0 comments

Fair Weather

https://fair-weather.query-farm.services
2•rustyconover•26m ago•1 comments

OpenAI GPT-5.3-Codex-Spark Now Running at 1K Tokens per Second on Cerebras Chips

https://www.servethehome.com/openai-gpt-5-3-codex-spark-now-running-at-1k-tokens-per-secondon-big...
1•rbanffy•27m ago•0 comments

Mars and Life

https://twitter.com/nasamars/status/2022001374154854471
1•paulpauper•27m ago•0 comments

Oracle vs. PostgreSQL – Row level and Column level security

https://hexacluster.ai/blog/row-level-and-column-level-security-oracle-vs-postgresql
1•avivallssa•27m ago•0 comments

Apple faces new tensions with Trump administration

https://www.ft.com/content/0c25de53-4668-4ddf-9e28-f8c4fc34940e
2•ksec•28m ago•1 comments

Japan's National Chip Startup Races to 2nm Mass Production

https://www.ai-supremacy.com/p/japans-national-chip-startup-races-2nm-rapidus
1•rbanffy•28m ago•0 comments

Show HN: Moatifi – Free Buffett-style moat analysis for stocks

https://moatifi.com
1•lldougl•28m ago•1 comments

What Happened with Bio Anchors?

https://www.astralcodexten.com/p/what-happened-with-bio-anchors
2•paulpauper•28m ago•0 comments

Strawmen and Worldview Solipsism

https://cognitivewonderland.substack.com/p/strawmen-and-worldview-solipsism
1•paulpauper•29m ago•0 comments

Generalized On-Policy Distillation with Reward Extrapolation

https://arxiv.org/abs/2602.12125
1•fzliu•30m ago•0 comments

NIMBYs Complained About Me to the State Bar. The State Bar Told Them to Get Lost

https://inpractice.yimbyaction.org/p/nimbys-complained-about-me-to-the
1•luckyducky99•30m ago•0 comments