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?

Explainer: Three Israelis considered for Nvidia CEO role

https://www.jpost.com/business-and-innovation/tech-and-start-ups/article-914815
1•10xDev•16s ago•0 comments

Turn Discord support threads into an FAQ for agents

https://cocoindex.io/blogs/discord-support-faq/
1•jerryrqu•1m ago•0 comments

Exact Gradients Through a BRep Kernel

https://muni.works/research/vcad
1•ecto•2m ago•0 comments

Emerging International Best Practices for AI Model Specs

https://saif.org/research/model-specs/
1•pretext•2m ago•0 comments

Jensen Huang's Resignation from Nvidia Worries the A.I. Startup World

https://www.nytimes.com/2026/11/13/technology/jensen-huang-silicon-valley-start-ups.html
2•cdrnsf•2m ago•0 comments

Ctrl+C, Ctrl+v, Ctrl+cve: Bypassing Android's Clipboard Read Security Measures

https://toninoble.com/post/ctrlc-ctrlv-ctrlcve
1•dethmasque•3m ago•0 comments

I measured what each agent-built pull request costs (~$2.15)

https://github.com/sebwilgosz/agent-executor
1•sebwilgosz•5m ago•0 comments

Acceleration of clean energy needed for global CO2 emissions to peak and decline

https://www.nature.com/articles/s41558-026-02821-8
1•toomuchtodo•5m ago•1 comments

Show HN: I simulated typewriters from 1926, 1970, and a 1980 IBM DisplayWriter

https://typewriter.foxipso.com
1•IAmNotACellist•6m ago•0 comments

Rogue AI Deployments Are Probably Coming [video]

https://www.youtube.com/shorts/Pnn5ZrQ7fFo
1•deepserket•7m ago•1 comments

It Takes 16 Clicks for a Student to Open a PowerPoint on an iPad

https://www.reddit.com/r/Teachers/comments/1xuup7a/technology_sucks_it_literally_takes_16_clicks_...
2•BobaFloutist•8m ago•0 comments

OpenAI launches ChatGPT Wallet, AI agents pay for purchases

https://www.reuters.com/technology/openai-launches-chatgpt-wallet-letting-ai-agents-pay-purchases...
4•NeuraCryption•9m ago•1 comments

Are we just going to ignore that books are destroyed for AI?

https://www.forbes.com/sites/maryroeloffs/2026/08/17/ai-companies-are-buying-and-destroying-antiq...
4•nyxtom•12m ago•4 comments

Anthropic sued for trademark infringement over 'Mythos' model

https://www.reuters.com/legal/legalindustry/anthropic-sued-trademark-infringement-over-mythos-mod...
1•giuliomagnifico•12m ago•0 comments

Forge is now in AWS marketplace

https://docs.trycontinuum.ai/forge/overview
1•continuum-agy•13m ago•0 comments

Show HN: CtxWise – Stop 8MB MCP crashes, schema bloat, and cache misses

https://github.com/FramY2/ctxwise
2•framy2•14m ago•0 comments

Platonic representations in the visual cortex: 4 gaps

https://www.neuroai.science/p/platonic-representations-in-visual
2•pminimax•14m ago•0 comments

The true fragility of the semiconductor supply chain

https://haddyalchaer.com/supply-chain
2•halcdev•14m ago•1 comments

Tell HN: Rachelbythebay.com Went Dark

https://rachelbythebay.com/
1•ucirello•14m ago•1 comments

Is it OK to write blog posts with AI yet?

https://rmoff.net/2026/11/13/is-it-ok-to-write-blog-posts-with-ai-yet/
1•speckx•16m ago•2 comments

Serve Robotics Opens Its Robot Delivery Network for Anyone to Build On

https://investors.serverobotics.com/news-releases/news-release-details/serve-robotics-opens-its-r...
2•skyya•16m ago•0 comments

Frontier AI takes only months to get 10 times cheaper

https://village.dev/blog/frontier-ai-used-to-take-over-a-year-to-get-10-times-cheaper-now-it-take...
1•kevin_hu•17m ago•1 comments

Cyber Insecurity: The Cost of Monopoly [pdf] [2003]

https://web.archive.org/web/20030926024100/https://ccianet.org/papers/cyberinsecurity.pdf
1•OhMeadhbh•17m ago•1 comments

LM Studio vs. Ollama on Linux: same model files, measured on an RTX 3090

https://homebrewserver.club/lm-studio-vs-ollama.html
2•aidotguru•18m ago•0 comments

Show HN: AI Juggler – Orchestrate your desktop Claude and Codex apps

https://github.com/figurehead-ai/AI-juggler
2•fbrbovic•20m ago•1 comments

Scientists Discover First New Penguin Species in More Than 100 Years

https://www.sciencedaily.com/releases/2026/09/260920222410.htm
1•karakoram•20m ago•0 comments

Creatine, Debunked [video]

https://www.youtube.com/watch?v=uK_1UiwTANw
1•luispa•23m ago•0 comments

OpenTelemetry for Balatro

https://svrnm.com/blog/balatro-otel/
2•svrnm•23m ago•0 comments

Soviet Disunion - Why Did The Communist Regime Collapse In The Soviet Union?

https://worksinprogress.co/issue/soviet-disunion/
2•karakoram•24m ago•0 comments

Show HN: Webpage of Hands

https://lasmanos.app/
1•willmeyers•25m ago•0 comments