frontpage.
newsnewestaskshowjobs

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?

An Empirical Study of Harness Design for Coding Agents

https://arxiv.org/abs/2609.20804
2•wek•1m ago•0 comments

The Trap of "Phantom TAM"

https://marketinvestigation.beehiiv.com/p/the-hidden-trap-of-phantom-tam-why-ad-dependent-platfor...
1•mapendembet•2m ago•0 comments

I Tried to Leave the Terminal Eight Times. The Ninth Stuck

https://thoughts.jock.pl/p/terminal-to-agentic-ide-bb-journey-2026
1•joozio•3m ago•0 comments

Germany turns on Brussels as Chinese car sales on track to exceed 1M in 2026

https://www.euronews.com/my-europe/2026/09/17/germany-turns-on-brussels-as-chinese-car-sales-on-t...
1•Markoff•4m ago•1 comments

Vulkan Documentation Project

https://docs.vulkan.org/spec/latest/index.html
1•ibobev•5m ago•0 comments

Gabor Fields: Orientation-Selective Level-of-Detail for Volume Rendering

https://arcanous98.github.io/projectPages/gaborVolumes.html
1•ibobev•5m ago•0 comments

12-Factor Agents – Principles for building reliable LLM applications

https://github.com/humanlayer/12-factor-agents
2•beepdyboop•5m ago•0 comments

Handling 100M time series with Arrow, Parquet, and object storage

https://www.parseable.com/blog/how-parseable-handles-100-million-time-series
1•yashdotrv•5m ago•0 comments

TLDR; what the heck is Jev?

https://www.jrzs.dev/blog/what-the-heck-is-jev/
1•jrhey•6m ago•0 comments

C++26: Trivial infinite loops are no longer undefined behaviour

https://www.sandordargo.com/blog/2026/09/16/cpp26-trivial-infinite-loops
1•ibobev•6m ago•0 comments

DJ Shadow looks back at "Entroducing" and other early work

https://www.msn.com/en-us/news/other/dj-shadow-spent-decades-digging-for-records-now-hes-digging-...
1•ilamont•8m ago•0 comments

When the Debugger Lies

https://danielmangum.com/posts/when-the-debugger-lies/
1•hasheddan•10m ago•0 comments

Putin envoy and far-right AfD prepare talks to get Russian gas back for Germany

https://www.reuters.com/world/putin-envoy-far-right-afd-prepare-talks-get-russian-gas-back-german...
2•alephnerd•11m ago•0 comments

Maker's Schedule, Manager's Schedule

https://www.paulgraham.com/makersschedule.html
1•tosh•13m ago•0 comments

Clocky: Alarm clock on wheels that runs away from you

https://clocky.com/pages/about-us
1•Bluestein•13m ago•0 comments

Show HN: Bastionskill – scan an AI agent skill for malicious code

1•Rinkia•14m ago•0 comments

The Return of the Utah Teapot – Siggraph 2026 [video]

https://www.youtube.com/watch?v=k-23LgrFcvs
1•justin66•15m ago•0 comments

AI eyes in the sky: New satellites and AI transforming wildfire detection

https://www.theguardian.com/us-news/2026/aug/17/satellites-ai-wildfire-detection
1•bookofjoe•15m ago•0 comments

Sales calculation tool for Excel price lists

1•Marten42•16m ago•0 comments

Qbix Server – PHP 100× faster than Nginx and PHP-fpm

https://github.com/Qbix/webserver
1•theHocineSaad•16m ago•0 comments

The Input Layer

https://mg-crea.com/blog/the-input-layer/
1•olouv•18m ago•0 comments

Show HN: Explore 2D semantic space with the Jev model

https://semanticspace.dev/
1•holdswarm•19m ago•0 comments

King Charles has hesitations about AI

https://techcrunch.com/2026/09/17/even-the-king-of-england-has-his-hesitations-about-ai/
1•soltanov•20m ago•0 comments

The Harms of Modern Lighting and the Fight to Bring Back Incandescent Bulbs

https://www.midwesterndoctor.com/p/the-hidden-harms-of-modern-lighting
1•bilsbie•21m ago•0 comments

Show HN: Using a diffusion model to write docs quickly

https://www.cortee.ai
1•nandorb1•24m ago•0 comments

Making a game for the GBA and PC from the same codebase

https://mattgreer.dev/blog/making-a-game-for-gba-and-pc/
2•birdculture•25m ago•0 comments

lonely 20 questions, a game for people with no friends

https://20questions.foxmoss.com/
2•foxmoss•25m ago•0 comments

Don't Trust the Super-App: A Case Study of Russia's Max

https://arxiv.org/abs/2609.11814
2•pchr8•26m ago•0 comments

Does this mean it's fine to use Claude subscriptions with third party harnesses?

2•jakemanger•27m ago•1 comments

New cat species identified for the first time in a century

https://www.cbc.ca/news/science/tilcayo-tiger-cat-new-species-9.7349140
4•rdmuser•31m ago•1 comments