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

Age of Invention: Tudor Trade War

https://www.ageofinvention.xyz/p/age-of-invention-tudor-trade-war
1•Khaine•1m ago•0 comments

I have an idea I wanted to share with you all

1•prassamin•2m ago•0 comments

Show HN: Flash.nvim, but for Tmux Sort Of

https://github.com/Kristijan/flash-copy.tmux
1•KristijanM13•3m ago•0 comments

Newly discovered coffee compounds beat diabetes drug in lab tests

https://www.sciencedaily.com/releases/2026/01/260110211224.htm
1•ashishgupta2209•3m ago•0 comments

AI, Japanese chimpanzee who counted and painted dies at 49

https://www.bbc.com/news/articles/cj9r3zl2ywyo
1•reconnecting•4m ago•0 comments

Humans Have Accidentally Created a Barrier Around the Earth

https://www.iflscience.com/humans-have-accidentally-created-a-barrier-around-the-earth-81973
1•akg130522•5m ago•0 comments

NotebookLM Watermark Remover – Remove Watermark from PDF

https://geminiwatermarkremover.net/
1•AI_kid1412•5m ago•0 comments

Video Message from Federal Reserve Chair Jerome H. Powell

https://twitter.com/federalreserve/status/2010510130970849338
1•baxtr•6m ago•0 comments

The Simpler Things in Life [video]

https://www.youtube.com/watch?v=els71JSBIaY
1•genderdoog•7m ago•0 comments

Linux Market Share Remains Above 3% for 3 Months in a Row – January 2026 Report

https://itsfoss.com/linux-market-share/
2•mindracer•8m ago•0 comments

One Thousand Words

https://drewmayo.com/1000-words/index.html
1•todsacerdoti•12m ago•0 comments

iFixit The Worst Devices of CES 2026 [video]

https://www.youtube.com/watch?v=cxZgILm95BU
1•levanten•12m ago•0 comments

Anthropic brings Claude to healthcare with HIPAA-ready Enterprise tools

https://www.bleepingcomputer.com/news/artificial-intelligence/anthropic-brings-claude-to-healthca...
1•fleahunter•13m ago•0 comments

Select text and search with your preferred engine or AI, all in one click

https://chromewebstore.google.com/detail/onering-select-and-search/fjpigicmicdmlmhmkilknomjkkipgafk
1•nanxiaobei•21m ago•0 comments

Jerome Powell's being threatened [video]

https://www.youtube.com/watch?v=RFTGjDR72i4
1•chii•21m ago•0 comments

Why is it so hard to do the thing I claim to want?

https://seekingtrust.substack.com/p/why-is-it-so-hard-to-do-what-i-claim
1•FinnLobsien•24m ago•0 comments

A field guide to sandboxes for AI

https://www.luiscardoso.dev/blog/sandboxes-for-ai
1•saikatsg•32m ago•0 comments

Scope: Hierarchical planner beats LLMs, 55x faster, 1/160k size

https://skyfall.ai/blog/scope-hierarchical-planner-55x-faster-than-llms
1•GeorgeOldfield•34m ago•0 comments

Revit AI Render: Faster AI Rendering for Architects

https://vocus.cc/article/6964af54fd897800012db1b1
1•architech_willy•38m ago•0 comments

You Need to Yearn More

https://twitter.com/justalexoki/status/2010380526402900028
1•keepamovin•38m ago•0 comments

Show HN: Self-hosted micro-learning platform with Full featured (Django/SolidJS)

https://github.com/cobel1024/minima
1•pigon1002•39m ago•1 comments

What Accenture's acquisition of Faculty means for AI enablement services

https://www.aienablementinsider.com/p/what-accenture-s-acquisition-of-faculty-ai-means-for-ai-ena...
1•dylancollins•39m ago•0 comments

Ask HN: What business processes still waste time every week?

1•lzr_mihnea•43m ago•0 comments

Show HN: AIIM – platform to build AI agents with psychological depth

https://ai-im.tech
1•juliavvrn•44m ago•0 comments

AI industry insiders launch site to poison the data that feeds them

https://www.theregister.com/2026/01/11/industry_insiders_seek_to_poison/
3•50kIters•52m ago•0 comments

AGI Next Frontier Summit in Beijing (260110)

https://haebom.dev/archive?tl=en&post=d367nxm38w8xv2j98pv1
2•haebom•57m ago•0 comments

Writing a Program in Par [video]

https://www.youtube.com/watch?v=nU7Lt6k3lNQ
2•razodactyl•59m ago•0 comments

Show HN: GAM7 Companion – macOS app that automates Google Workspace admin

https://github.com/halcarrell/gamgui-releases
1•stormer72•1h ago•0 comments

Show HN: I built a keyword tool that finds terms traditional tools miss

https://brightkeyword.com/
1•nyku•1h ago•1 comments

UpgradeLink – An Open-Source All-in-One Cross-Platform App Upgrade System

1•toolsetlink•1h ago•0 comments