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

Mibooko – Personalized Storybooks for Kids

https://mibooko.com/
1•deravish•54s ago•1 comments

Long Live Systems of Record

https://cloudedjudgement.substack.com/p/clouded-judgement-121225-long-live
1•mooreds•59s ago•0 comments

Interlaced origami: compact storage and high-strength robotic deployment

https://techxplore.com/news/2025-11-interlaced-origami-enables-compact-storage.html
1•PaulHoule•2m ago•0 comments

Historic Shift Underway in China's Economy as Investment Slump Deepens

https://www.nytimes.com/2025/12/12/business/china-investment-economy.html
1•mooreds•2m ago•0 comments

Live Nation, Ticketmaster must face sprawling class action over prices

https://www.reuters.com/sustainability/boards-policy-regulation/live-nation-ticketmaster-must-fac...
1•defrost•3m ago•0 comments

Using the `vpternlogd` instruction for signed saturated arithmetic

https://wunkolo.github.io/post/2025/12/vpternlog-signed-saturation/
1•matt_d•3m ago•0 comments

LLM-Derived Knowledge Graphs

https://www.microsoft.com/en-us/research/project/graphrag/
1•mooreds•4m ago•0 comments

The next version of the web will be built for machines, not humans

https://www.economist.com/interactive/science-and-technology/2025/12/10/the-next-version-of-the-w...
1•pseudolus•6m ago•1 comments

In 1844, chess was already online

https://spectrum.ieee.org/telegraph-chess
2•geox•7m ago•0 comments

Can LLMs give us AGI if they are bad at arithmetic?

https://wesmckinney.com/blog/llms-arithmetic/
1•Terretta•12m ago•1 comments

The 7 Habits of Highly Ineffective Agents

https://tobyhede.com/blog/the-7-habits-of-highly-ineffective-agents/
3•tobyhede•23m ago•1 comments

Home humanoid: Google DeepMind shows Apptronik’s robot doing real-world tasks

https://www.forbes.com/sites/johnkoetsier/2025/12/10/home-humanoid-google-deepmind-shows-apptroni...
1•hhs•23m ago•0 comments

Think Tanker Altered Ukraine War Map Before Big Polymarket Payout

https://responsiblestatecraft.org/isw-polymarket-ukraine-war-map/
5•danso•28m ago•0 comments

Show HN: An ASCII table that doesn't hurt your eyes

https://asciify.dev/
1•dklepenko•29m ago•0 comments

Kids Rarely Read Whole Books Anymore. Even in English Class

https://www.nytimes.com/2025/12/12/us/high-school-english-teachers-assigning-books.html
2•johntfella•29m ago•0 comments

Pope criticizes US bid to 'break apart' US-Europe alliance

https://apnews.com/article/vatican-russia-ukraine-trump-pope-leo-60c898afe3241ff67552f417a06900b0
4•sipofwater•38m ago•2 comments

Discovery of Unstable Singularities (In 3D Navier-Stokes Équations)

https://arxiv.org/abs/2509.14185
1•kelseyfrog•40m ago•0 comments

US Coinage 2026 [Semiquincentennial]

https://www.usmint.gov/coins/coin-programs/semiquincentennial/
2•explosion-s•46m ago•0 comments

Question about stability differences between GoLogin and AdsPower

1•muthiti•46m ago•0 comments

Sourcedocs.ai – I got tired of writing READMEs, so I built an AI to do it

https://www.indiehackers.com/post/sourcedocs-ai-i-got-tired-of-writing-readmes-so-i-built-an-ai-t...
2•sourcedocsai•51m ago•0 comments

Is Jonathan Haidt right about smartphones?

https://www.tes.com/magazine/teaching-learning/general/jonathan-haidt-anxious-generation-right-ab...
2•hn_acker•53m ago•1 comments

'The History of Money’ review: What made the world go round

https://www.wsj.com/arts-culture/books/the-history-of-money-review-what-made-the-world-go-round-f...
1•hhs•54m ago•0 comments

LifeWiki | The Wiki for Conway's Game of Life

https://conwaylife.com/wiki/
1•frozenseven•1h ago•0 comments

The Nintendo Virtual Boy Is Now Available for Preorder

https://www.cnet.com/deals/nintendo-virtual-boy-preorders-now-available/
2•not4uffin•1h ago•0 comments

By the Waters of Babylon (1937) by Stephen Vincent Benét [video]

https://www.youtube.com/watch?v=40C2Ua5FYdU
1•ShrugLife•1h ago•0 comments

Why is manufacturing productivity growth so low?

https://www.nber.org/papers/w34264
2•hhs•1h ago•0 comments

Oils 0.37.0 – Alpine Linux, YSH, and mycpp

https://oils.pub/blog/2025/12/release-0.37.0.html
1•birdculture•1h ago•0 comments

Silicon Valley was consistently 10 years ahead of its time

https://old.reddit.com/r/funny/comments/1pl2ui3/bro_how_was_the_show_silicon_valley_so/
4•doener•1h ago•0 comments

A Webapp to Search Emails as an Unikernel

https://blog.robur.coop/articles/2025-04-12-ptt-search-webapp.html
2•TheWiggles•1h ago•0 comments

OpenAI are quietly adopting skills, now available in ChatGPT and Codex CLI

https://simonwillison.net/2025/Dec/12/openai-skills/
43•simonw•1h ago•16 comments