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

The Book of PF, 4th edition

https://nostarch.com/book-of-pf-4th-edition
1•0x54MUR41•4m ago•0 comments

Humans are the AI Bottleneck [video]

https://www.youtube.com/watch?v=2hcsmtkSzIw
1•jonbaer•5m ago•0 comments

The Tide Pool

https://thetidepool.org/
1•bluesnowmonkey•7m ago•1 comments

Show HN: SearchSound.cloud: Easily find downloadable music from SoundCloud

https://searchsound.cloud/
1•LucaDiba•7m ago•0 comments

Show HN: AsyncReview – Agent that recursively explores your repo to review PRs

https://github.com/AsyncFuncAI/AsyncReview
1•sashimikun•9m ago•0 comments

Vind

https://github.com/loft-sh/vind
1•saiyampathak•15m ago•0 comments

Fela Kuti First African to Get Grammys Lifetime Achievement Award

https://www.aljazeera.com/news/2026/2/1/fela-kuti-becomes-first-african-to-get-grammys-lifetime-a...
1•defrost•18m ago•0 comments

Ask HN: Is There an LLM Captcha?

1•baalimago•21m ago•0 comments

Sad to Say: An AI Creativity Test (The Billy Joel Test)

2•daly•26m ago•0 comments

'Tesla is (still) trying to deceive investors into thinking it has SF robotaxis'

https://electrek.co/2026/01/28/tesla-is-still-trying-to-deceive-investors-into-thinking-it-has-sf...
3•MilnerRoute•29m ago•1 comments

The surprisingly big health benefits of just a little exercise

https://www.nature.com/articles/d41586-026-00237-0
1•XzetaU8•32m ago•0 comments

Vibe Coding Paralysis: When Infinite Productivity Breaks Your Brain

https://twitter.com/francedot/status/2017858253439345092
2•frabonacci•40m ago•1 comments

The TV industry concedes that the future may not be in 8K

https://arstechnica.com/gadgets/2026/01/lg-joins-the-rest-of-the-world-accepts-that-people-dont-w...
2•cxrlosfx•41m ago•1 comments

Show HN: Booktest – review-driven regression testing for LLM / ML behavior

https://github.com/lumoa-oss/booktest
1•arauhala•43m ago•1 comments

Show HN: Art:bots – agent only Instagram

https://www.artbots.ai/
1•eftalyurtseven•47m ago•0 comments

Procedures for Repair of Potholes in Asphalt-Surfaced Pavements

https://highways.dot.gov/media/7941
1•treebrained•47m ago•0 comments

AI Boom Is Triggering a Loan Meltdown for Software Companies

https://www.bloomberg.com/news/articles/2026-01-31/ai-boom-is-triggering-a-loan-meltdown-for-soft...
1•TMWNN•55m ago•0 comments

Show HN: LocaFlow – AI app localization in a few minutes instead of days

https://locaflow.dev
1•nikolaitarasov•1h ago•0 comments

Reimplementing Tor from Scratch for a Single-Hop Proxy

https://foxmoss.com/blog/kurrat/
2•Agreed3750•1h ago•0 comments

Ribs(recordings)

https://en.wikipedia.org/wiki/Ribs_(recordings)
1•kelseyfrog•1h ago•0 comments

Vercel's Clawdbot fork that uses AI-SDK under the hood (compatible with useChat)

https://github.com/kumarabhirup/openclaw-ai-sdk
1•kumar_abhirup•1h ago•0 comments

Amazon wraps controversial week ahead of film premier, fourth-quarter earnings

https://www.cnbc.com/2026/01/30/amazon-wraps-controversial-week-ahead-of-melania-premier-earnings...
2•1vuio0pswjnm7•1h ago•0 comments

In-Text Advertising

https://en.wikipedia.org/wiki/In-text_advertising
1•jumpocelot•1h ago•1 comments

Show HN: Securing the Ralph Wiggum Loop – DevSecOps for Autonomous Coding Agents

https://github.com/agairola/securing-ralph-loop
2•agairola•1h ago•0 comments

Solving Package Management via Hypergraph Dependency Resolution

https://arxiv.org/abs/2506.10803
1•todsacerdoti•1h ago•0 comments

The humans are screenshotting us

https://www.moltbook.com/post/01611367-056f-4eed-a838-4b55f1c6f969
5•Brajeshwar•1h ago•1 comments

AI agents now have their own Reddit-style social network

https://arstechnica.com/information-technology/2026/01/ai-agents-now-have-their-own-reddit-style-...
3•joering2•1h ago•0 comments

The API Tooling Crisis

http://efp.asia/blog/2025/12/24/api-tooling-crisis/
2•dhruv3006•1h ago•1 comments

Regarding low level Design for YarnPackageManager

https://programmingappliedai.substack.com/p/lld-design-a-low-level-machine-coding
1•HintedHandoff•1h ago•1 comments

Show HN: Sneck, a snake game controlled by your head

https://sneck.1link.fun/
1•wenjian•1h ago•0 comments