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?

GrapheneOS accuses Google of gatekeeping Android 17 features and security fixes

https://www.androidauthority.com/grapheneos-android-17-qpr1-security-patches-comments-3712218/
1•vilasa•1m ago•0 comments

Apprentice: A Slim, Extensible Coding Harness (Written in Common Lisp)

https://github.com/skarnati20/apprentice
1•skarnati20•2m ago•1 comments

Getting Outbound Email to Work on DigitalOcean

https://mailfully.com/blog/digitalocean-blocks-smtp-ports-ses-2587
1•mailfully•3m ago•0 comments

Anthropic says Claude now leads a quarter of work building its next AI models

https://www.businesstimes.com.sg/companies-markets/telcos-media-tech/anthropic-says-claude-now-le...
1•dr_scully•4m ago•0 comments

Mini-Jev – typesafe's Jev implemented on top of an LLM locally

https://github.com/r-ms/mini-jev
1•phyrex•5m ago•0 comments

Inside Microsoft and OpenAI, Worry About Damaging the Publishing Industry

https://www.nytimes.com/2026/09/17/technology/microsoft-openai-publishing-industry.html
1•0in•8m ago•0 comments

Richard Feynman – The World from another point of view [video]

https://www.youtube.com/watch?v=GNhlNSLQAFE
1•binyu•10m ago•0 comments

Talk to JEV

https://jev-grug-chat.mkotlikov.chatgpt.site
2•mkotlikov•10m ago•0 comments

Muse for macOS

https://ai.meta.com/muse/download/
2•mfiguiere•10m ago•0 comments

Show HN: Cactus Needle 3: 8-29MB automation models can match DeepSeek V4 Flash

https://cactuscompute.com/needle
2•HenryNdubuaku•15m ago•0 comments

Where Awareness Is Not the Problem

https://medium.com/@gurvinder372/article-20-where-awareness-is-not-the-problem-5b9d03c925f2
1•gps372•15m ago•0 comments

Microsoft exec called AI scraping 'the largest theft of labor in human

https://techcrunch.com/2026/09/17/microsoft-exec-called-ai-scraping-the-largest-theft-of-labor-in...
3•sbulaev•20m ago•1 comments

NASA satellite discovers a new crater on the moon bigger than the Colosseum

https://www.cbc.ca/news/science/new-crater-moon-9.7348242
1•BiraIgnacio•25m ago•0 comments

Forget doomsday: The AI hacking crisis is here

https://www.axios.com/2026/09/17/ai-cyber-doomsday-hacking-threats
1•1vuio0pswjnm7•26m ago•1 comments

Base's B20 Bet Is Growing – Could the Next Billion-Dollar Project Be Built Here?

https://predx-article.fika.bar/base-s-b20-bet-is-getting-bigger-could-the-next-billion-do-01M2PW9...
1•joeymabia1•33m ago•0 comments

The FAA's plan to fix air traffic? $875M worth of AI

https://techcrunch.com/2026/09/17/the-faas-plan-to-fix-air-traffic-875-million-worth-of-ai/
4•danso•37m ago•0 comments

Red and Blue America Have Found Something to Agree On: Flock Cameras Must Go

https://www.wsj.com/us-news/red-and-blue-america-have-found-something-to-agree-on-flock-cameras-m...
5•johncole•37m ago•0 comments

LawConnect

https://lawconnect.com/en-au
1•oliviajameslaw•43m ago•1 comments

Email marketing from Grok Bot official integration

https://twitter.com/Migma_AI/status/2100617616704295197
1•AdamMigma•45m ago•0 comments

OSU's Bag Man - What was his bag, man?

https://oregonstater.org/osus-bag-man/
1•pseudolus•46m ago•0 comments

Mistral Hacked

https://frenchbreaches.com/blog/mistral-ai-de-nouveau-piratee-un-hacker-revendique-la-totalite-de...
3•orixilus•47m ago•0 comments

Dear developers, we are open‑sourcing our dictation app, Blurt

https://www.assemblyai.com/blurt
1•iharnoor•50m ago•0 comments

Can an AI chatbot save lives by answering texts about pregnancy?

https://www.npr.org/2026/09/17/nx-s1-5962840/artificial-intelligence-ai-chatbot-pregnancy-materna...
2•robglick•50m ago•0 comments

Publishers block the robots.txt path their own affiliate redirects live on

https://disclosed.info/the-index/
1•nchzingo•52m ago•0 comments

Productivity Effects Across Generations of AI Coding Tools

https://papers.ssrn.com/sol3/papers.cfm?abstract_id=6843118
1•fzliu•52m ago•1 comments

Talk to JEV

https://github.com/mkotlikov/jev-grug
1•mkotlikov•53m ago•0 comments

Typing Python, Gradually [video]

https://www.youtube.com/watch?v=eZbLUgy522s
1•matt_d•59m ago•0 comments

PPPlayer – An open-source music player built with Flutter

https://ppplayer.com
1•lucasveneno•1h ago•0 comments

We Need to Rewild the Internet (2024)

https://www.noemamag.com/we-need-to-rewild-the-internet/
2•jcbhmr•1h ago•0 comments

Egglog and Equality Saturation in a Production Tensor Compiler

https://egraphs.org/meeting/2026-09-17-luminal
1•matt_d•1h ago•0 comments