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?

Ask HN: What is your (AI) dev tech stack / workflow? (June 2026)

1•dv35z•1m ago•0 comments

The European Social Stack

https://european.social/
1•cheeaun•1m ago•0 comments

YouVersion Platform – Developer Platform for Bible-Based Experiences

https://www.youversion.com/platform
1•joelboersma•2m ago•0 comments

New IronWorm malware hits 36 packages in NPM supply-chain attack

https://www.bleepingcomputer.com/news/security/new-ironworm-malware-hits-36-packages-in-npm-suppl...
1•yogthos•2m ago•0 comments

Good Careers at Bad Companies

https://sharedphysics.com/good-careers-at-bad-companies/
1•goopthink•3m ago•0 comments

Gene flow from wild apples and selection shaped the domesticated Apple genome

https://www.sciencedirect.com/science/article/pii/S0960982226003684?via%3Dihub
1•PaulHoule•3m ago•0 comments

Watch crypto protocols exploited in real time

https://testmachine.ai
1•dannnyboi•3m ago•0 comments

Something is jamming GPS over Europe

https://www.youtube.com/watch?v=tz23G_UXCGA
1•fallinditch•4m ago•0 comments

PostgreSQL and the OOM Killer: Why We Use Strict Memory Overcommit

https://www.ubicloud.com/blog/postgresql-and-the-oom-killer-why-we-use-strict-memory-overcommit
2•levkk•4m ago•0 comments

Antares SMR goes zero power critical

https://twitter.com/AntaresNuclear/status/2062668414813126851
1•maxcan•6m ago•0 comments

Apple's Plan for AI Dominance Rests on Fixing Its Much-Maligned Chatbot

https://www.wsj.com/tech/ai/apples-plan-for-ai-dominance-rests-on-fixing-its-much-maligned-chatbo...
1•Zhenya•6m ago•0 comments

The British university is dying, and it seems that almost nobody cares

https://newleftreview.org/sidecar/posts/irreversible
2•theanonymousone•7m ago•0 comments

Introduce Loon: lake-native storage engine behind Milvus 3.0 for AI data

https://zilliz.com/blog/why-we-built-loon-a-storage-engine-for-ai-data-that-never-stops-changing
1•redskyluan•8m ago•0 comments

New method turns ocean water into drinking water, without waste

https://www.rochester.edu/newscenter/what-is-desalination-definition-ocean-water-704732/
2•speckx•11m ago•0 comments

We reduced tests from hours to just minutes using automatic GlassFish pools

https://balusc.omnifaces.org/2026/06/from-hours-to-minutes-glassfish-pool.html
1•henk53•11m ago•0 comments

Astronauts on ISS told to shelter as repairs under way to fix air leaks

https://www.bbc.com/news/live/c4g44ew3g1kt
31•janpot•14m ago•3 comments

Simulism · on Env

https://basecase.org/env/simulism
2•surprisetalk•14m ago•0 comments

I customized a MacBook Neo with colorful spare parts

https://www.theverge.com/tech/942839/macbook-neo-customization-color-mods-official-parts-frankenl...
1•droidjj•15m ago•0 comments

Building a zero-cloud, local semantic indexing engine for AI agents

https://entempsllc.github.io/nexus-waitlist/
1•Singhucla•16m ago•0 comments

VibeOS – Hallucinated Operating System [video]

https://www.youtube.com/watch?v=z3pV6FHvcgM
2•tapoxi•17m ago•0 comments

Valve says it's ready to launch the Steam Machine this summer

https://www.theverge.com/games/943657/valve-steam-machine-frame-summer-launch-verified
3•neilfrndes•17m ago•0 comments

Ethical and Moral Considerations in Proprietary Software Usage

https://sfconservancy.org/blog/2026/jun/02/ethical-use-proprietary-develop-free-software-foss/
2•hn_acker•17m ago•0 comments

AI-indecision is a recursive trap. Don't get stuck

https://www.joanwestenberg.com/ai-indecision-is-a-recursive-trap-dont-get-stuck/
2•spking•18m ago•0 comments

Show HN: One-Shot Program Generation Through Direct Memory Diffusion

https://github.com/MadlyFX/Direct-Memory-Diffusion
1•andyfilms1•20m ago•0 comments

Show HN: 0llm is a small app to help you spend time away from AI

https://0llm.tonyalicea.dev/
1•TonyAlicea10•20m ago•0 comments

Playing with Vision Embeddings

https://prestonbjensen.com/posts/playing-with-vision-embeddings
1•prestoj•20m ago•0 comments

Gain of Function, Loss of Control

https://tamingcomplexity.substack.com/p/gain-of-function-loss-of-control
2•namenumber•21m ago•0 comments

LLM agent performance is a distributed systems problem

https://fixbugs.ai/blog/high-performance-ai-agents-distributed-systems
2•kirtivr•21m ago•0 comments

Israel's tech paradox:$1.1B raised in a week as layoffs sweep industry

https://www.calcalistech.com/ctechnews/article/s1glpz1wge
3•myth_drannon•22m ago•0 comments

New York just passed a one-year temporary ban on data centers

https://scienceaim.com/new-york-just-passed-a-one-year-temporary-ban-on-data-centers/
13•binarymax•25m ago•9 comments