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

Comparison: Different AI systems structure decisions under real-world scenarios

https://zenodo.org/records/19443285
1•zobian_ai•20s ago•0 comments

MPA Renews Push for U.S. Site-Blocking Legislation, Citing Live Sports Piracy

https://torrentfreak.com/mpa-renews-push-for-u-s-site-blocking-legislation-citing-live-sports-pir...
1•gslin•31s ago•0 comments

Show HN: Apple's Sharp Running in the Browser via ONNX Runtime Web

https://github.com/bring-shrubbery/ml-sharp-web
1•bring-shrubbery•34s ago•0 comments

Awesome Vintage LLMs

https://github.com/entanglr/awesome-vintage-llms
1•whythismatters•53s ago•0 comments

Technology helps observers understand how iconic artworks were created

https://www.psu.edu/news/information-sciences-and-technology/story/technology-helps-observers-und...
1•saikatsg•2m ago•0 comments

Packages release more often than ever. Or do they?

https://www.viblo.se/posts/oss-releases-ai/
1•viblo•7m ago•1 comments

Enable password input feedback for sudo

https://wiki.archlinux.org/title/Sudo#Enable_password_input_feedback
1•seansh•9m ago•0 comments

Leeds Town Hall Organ Renewal

https://www.leedstownhall.co.uk/support-us/organ-renewal-project/
1•Lio•10m ago•0 comments

Startup request: MCP household appliances

1•dontoni•15m ago•0 comments

Dear Richard Dawkins

https://dearricharddawkins.com/
1•thinkingemote•16m ago•0 comments

Researchers print structural colour with an inkjet printer

https://physicsworld.com/a/researchers-print-structural-colour-with-an-inkjet-printer/
1•zeristor•16m ago•0 comments

Clawback – rehearse OpenClaw upgrades before touching your live install

https://github.com/haishmg/Clawback
1•princeharry86•18m ago•0 comments

Wire-level context pruner for Claude Code

https://github.com/pathakmukul/claude-code-context-pruner
1•mukulpathak•19m ago•0 comments

NIST's CAISI Evaluation of DeepSeek V4 Pro finds it to be on par with GPT-5

https://www.nist.gov/news-events/news/2026/05/caisi-evaluation-deepseek-v4-pro
1•maxloh•21m ago•0 comments

OpenAI: Auto-review of agent actions without synchronous human oversight

https://alignment.openai.com/auto-review/
1•tosh•23m ago•0 comments

Definable Real Number

https://en.wikipedia.org/wiki/Definable_real_number
1•nill0•32m ago•0 comments

When Microsoft saved Apple (2017)

https://www.cnbc.com/2017/08/29/steve-jobs-and-bill-gates-what-happened-when-microsoft-saved-appl...
1•thunderbong•32m ago•0 comments

A Lisa Inside an FPGA

https://lisalist2.com/index.php?topic=694.0
1•uyjulian•35m ago•0 comments

Performance of a large language model on the reasoning tasks of a physician

https://www.science.org/doi/10.1126/science.adz4433
1•voisin•37m ago•0 comments

You Have No Idea How Much You Still Use BlackBerry

https://www.wsj.com/tech/blackberry-qnx-software-cars-bf2a2280
2•voisin•40m ago•0 comments

How the suffering system works in Hollow

https://ninjahawk.github.io/blog/posts/suffering-system.html
1•ninjahawk1•46m ago•0 comments

Show HN: BoxLite – the micro-VM runtime for embedded, local dev, and cloud prod

https://github.com/boxlite-ai/boxlite
1•dorianzheng•46m ago•0 comments

NASA's Nancy Grace Roman telescope will offer an 'atlas of the universe'

https://www.msn.com/en-us/news/technology/nasas-incredible-new-telescope-will-offer-an-atlas-of-t...
1•slow_typist•47m ago•0 comments

Git Rev News Edition 134 (April 30th, 2026)

https://git.github.io/rev_news/2026/04/30/edition-134/
1•chmaynard•52m ago•0 comments

Improved testing logic in od.nvim, added a serializers module to ocote

1•Okerew•56m ago•0 comments

Deepfakes Are Coming for Your Bank Account

https://www.theatlantic.com/technology/2026/05/chatgpt-images-deepfakes-fraud/687023/
2•JumpCrisscross•57m ago•0 comments

Free Mercurial Hg Hosting at Hglab.io

https://www.hglab.io/
1•harrisonerd•1h ago•1 comments

Show HN: Editor, Browser, Terminal, Mail, Agents. AI Sharing Context

https://github.com/raiyanyahya/kit
2•RaiyanYahya•1h ago•2 comments

PocketOS AI Fiasco – Lesson in Automation Access

https://onlytech.boo/incident/pocketos-ai-fiasco-lesson-in-automation-access-mokdojol
1•vednig•1h ago•1 comments

How to Test AI Agents When They Never Give the Same Answer Twice

https://adlrocha.substack.com/p/adlrocha-the-eval-problem-how-to
1•adlrocha•1h ago•0 comments