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

Contextual web personalization and inspection engine on Fastly's edge stack

https://cheaply-joint-goshawk.edgecompute.app/
1•Fcuervo•1m ago•0 comments

The evolution of AI-assisted software engineering paradigms

https://pasqualepillitteri.it/en/news/182/evolution-ai-software-engineering-paradigms-agentic-loop
1•teleforce•1m ago•0 comments

Using AI to write better code more slowly

https://nolanlawson.com/2026/05/25/using-ai-to-write-better-code-more-slowly/
1•signa11•3m ago•0 comments

Garden Grove chemical tank cools, risk of catastrophic explosion eliminated

https://ktla.com/news/orange-county/garden-grove-chemical-tank-crack-explosion-risk/
2•Bender•5m ago•0 comments

I built an interactive job application that talks back

https://firstdeploy.ai/
1•AgentHive•6m ago•0 comments

Chatbot Has a Long Memory. That Isn't Always a Good Thing

https://www.wsj.com/tech/ai/ai-memory-cd1de7f4
3•lucaspauker•8m ago•0 comments

US's big bet on quantum computing may not be legal

https://arstechnica.com/tech-policy/2026/05/uss-big-bet-on-quantum-computing-may-not-be-entirely-...
1•Bender•9m ago•0 comments

Citing Gandalf, Pope Leo says we must "disarm" AI

https://arstechnica.com/tech-policy/2026/05/citing-gandalf-pope-leo-says-we-must-disarm-ai/
1•Bender•9m ago•0 comments

Offshore finance is thriving despite crackdowns

https://www.economist.com/finance-and-economics/2026/05/25/offshore-finance-is-thriving-despite-c...
1•petethomas•9m ago•0 comments

Cox Media fined after bragging it spied on users through their phones

https://www.theverge.com/policy/937027/cox-media-marketing-ai-powered-phone-spying-ads-ftc-fine
1•sbulaev•10m ago•0 comments

Solving the Board Game Quoridor

https://grantslatton.com/solving-quoridor
1•cjlm•11m ago•0 comments

EDR transparency study (Cisco, Kaspersky, Microsoft top the list)

https://av-comparatives.org/independent-study-highlights-transparency-and-data-practices-in-leadi...
1•AnnaKoro453•22m ago•0 comments

Builders Fallacy

https://davidgu.com/bf.html
2•benswerd•28m ago•1 comments

DAAF: Rigorous+responsible data analysis/research with Claude Code (open-source)

https://daaf.openaugments.org/
1•brhkim•28m ago•0 comments

Interview with Sam Conman

https://zhenyi.gibber.blog/interview-with-sam-conman
1•zhenyi•29m ago•0 comments

Mec builds first High-NA EUV-fabricated quantum dot qubit

https://www.tomshardware.com/tech-industry/semiconductors/imec-builds-worlds-first-high-na-euv-fa...
1•sbulaev•29m ago•0 comments

Type.lol

https://type.lol/
1•bookofjoe•30m ago•0 comments

Show HN: Nerve – self hosted runtime for AI agents

https://github.com/ClickHouse/nerve
2•animetyan•33m ago•2 comments

What Is a Direct Attach Copper (DAC) Cable

https://www.servethehome.com/what-is-a-direct-attach-copper-dac-cable/
1•teleforce•36m ago•0 comments

Every Frontier AI Is INTJ

https://zonted.com/posts/every-ai-is-intj/
1•bernardjhuang•37m ago•1 comments

PDFearn free $3 method daily pdf

https://pdfearn.blogspot.com/2026/05/free-pdf-earn-3-per-day-by.html
1•iLzKii•37m ago•1 comments

Canada losing top talent as workers head to the U.S.

https://www.bnnbloomberg.ca/investing/market-outlook/2026/05/25/market-outlook-canada-losing-top-...
21•leopoldj•37m ago•8 comments

Ask HN: Laptops with good Linux support and good build quality?

1•asxndu•39m ago•5 comments

Pope Leo's 'Magnifica humanitas': AI must serve humanity not concentrate power

https://www.vaticannews.va/en/pope/news/2026-05/pope-leo-xiv-encyclical-magnifica-humanitas-ai.html
2•SebastianSosa•40m ago•0 comments

How Shamir's Secret Sharing Works

https://ente.com/blog/how-shamirs-secret-sharing-works/
1•subract•42m ago•0 comments

Is 2027 the Next Year?

https://bsky.app/profile/davis.social/post/3mmpcff4cdc2r
2•hansmayer•43m ago•0 comments

Route 4: Reconstructing Execution Continuity in EVM Environments

https://blog.bridgexapi.io/route-4-reconstructing-execution-continuity-in-evm-environments
1•Bridgexapi•44m ago•0 comments

American journalist charged with serving as unregistered agent for China

https://www.politico.com/news/2026/05/25/american-journalist-unregistered-agent-china-00935518
1•cwwc•46m ago•0 comments

Agentic Patterns

https://veso.ai/research/agentic-patterns/
2•kinlan•47m ago•0 comments

The Virgin Unicorns

https://www.geekwire.com/2026/etzioni-on-ai-the-virgin-unicorns/
2•jkuria•49m ago•0 comments