frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Ask HN: How can I load test PostgreSQL but avoid changing actual data?

1•LawZiL•5h 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•4h 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•4h 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•4h 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•2h ago
Load test against a clone instead of a DB whose contents you care about?

Benchmarks lie. Vector databases deserve a real test

https://milvus.io/blog/benchmarks-lie-vector-dbs-deserve-a-real-test.md
1•redskyluan•1m ago•0 comments

Tesla has yet to start testing Austin robotaxi service weeks before launch

https://electrek.co/2025/05/14/tesla-yet-start-testing-robotaxi-service-without-driver-weeks-before-launch/
1•coloneltcb•2m ago•0 comments

MicroPython v1.25.0

https://github.com/micropython/micropython/releases/tag/v1.25.0
1•todsacerdoti•2m ago•0 comments

US Warns That Using Huawei AI Chip 'Anywhere' Breaks Its Rules

https://finance.yahoo.com/news/us-warns-using-huawei-ai-191718234.html
1•jonbaer•8m ago•0 comments

Section 174 changes: Tech firms facing tax bills are laying off workers

https://www.resourcefulfinancepro.com/news/irs-section-174-changes-tech-firms-face-huge-tax-bills-layoffs-are-surging/
1•walterbell•9m ago•0 comments

Tilt Gestures for Text Property Control in Mobile Interfaces

https://www.mdpi.com/2414-4088/9/5/41
1•PaulHoule•10m ago•0 comments

Former journalist Evan Solomon named Canada's first-ever federal AI minister

https://www.thecanadianpressnews.ca/science/former-journalist-evan-solomon-named-first-ever-federal-ai-minister/article_5421351e-2fd4-52c9-9553-964800b622b0.html
1•ChrisArchitect•13m ago•0 comments

US warns companies around the world to stay away from Huawei chips

https://arstechnica.com/gadgets/2025/05/us-warns-companies-around-the-world-to-stay-away-from-huawei-chips/
2•jonbaer•14m ago•0 comments

The Camel Principle

https://thepalindrome.org/p/the-camel-principle
1•gmays•17m ago•0 comments

The Pay by Bank Breakthrough

https://fintechtakes.com/articles/2025-03-25/the-pay-by-bank-breakthrough/
1•toomuchtodo•17m ago•0 comments

VACE – Multifunctional video creation and editing AI model

https://vace.studio/
1•zoudong376•17m ago•1 comments

Christie's – 21st Century Evening Sale – Wed May 14 25 [video]

https://www.youtube.com/watch?v=nyuXtHizDaI
1•handfuloflight•18m ago•0 comments

AI is like hyperprocessed foods for learning

https://blindsidenetworks.com/ai-is-like-hyperprocessed-food-for-learning/
2•ffdixon1•20m ago•1 comments

A metaverse based digital preservation of temple architecture and heritage

https://www.nature.com/articles/s41598-025-00039-w
1•gnabgib•21m ago•0 comments

Neom climate adviser warns futuristic city could alter weather patterns

https://www.ft.com/content/8bb45e6e-5a1b-4e93-ad40-8f0568e02274
1•bookofjoe•27m ago•1 comments

What a DMD chip looks like in operation – DLP projector teardown [video]

https://www.youtube.com/watch?v=f3g38g3H_aM
1•creer•27m ago•1 comments

Show HN: YapCards (iOS) – Voice-driven flashcards with AI feedback

5•DonEsquire•41m ago•3 comments

Pakistan Needs a Plan

https://www.noahpinion.blog/p/pakistan-needs-a-plan
1•JumpCrisscross•43m ago•0 comments

The China Pakistan economic corridor facing serious difficulties

https://www.geopolitica.info/china-pakistan-economic-corridor/
2•JumpCrisscross•43m ago•1 comments

Without high-performance computing plan, the U.S. could lose innovation lead

https://www.fastcompany.com/91334523/high-performance-computing-plan-us-innovation
4•doctaj•44m ago•0 comments

Why agency and cognition are fundamentally not computational

https://www.frontiersin.org/journals/psychology/articles/10.3389/fpsyg.2024.1362658/full
2•nativeit•44m ago•0 comments

Is it just me or it is kind of hard to find people to build something with?

2•klondono•49m ago•2 comments

Gardening can help you live better for longer

https://www.bbc.com/future/article/20250509-how-gardening-boosts-brain-health
1•1659447091•50m ago•0 comments

Show HN: 1,400 startup idea DB sourced from HN and Reddit

https://www.ideahunt.app/
1•westche2222•55m ago•0 comments

Why Gen X is the real loser generation

https://www.economist.com/finance-and-economics/2025/05/08/why-gen-x-is-the-real-loser-generation
6•Jimmc414•1h ago•1 comments

Grok chatbot repeatedly mentions 'white genocide' in unrelated chats

https://www.theguardian.com/technology/2025/may/14/elon-musk-grok-white-genocide
13•n1b0m•1h ago•1 comments

Wizards of OBS, LLC vs. ByteDance Ltd. et al.

https://dockets.justia.com/docket/california/cacdce/5:2025cv00636/961274
1•Sean-Der•1h ago•0 comments

Frozen water found in a young star system for the first time

https://english.elpais.com/science-tech/2025-05-14/frozen-water-found-in-a-young-star-system-for-the-first-time.html
1•geox•1h ago•0 comments

Show HN: Fusion – A PHP Package Manager

https://gitlab.com/valvoid/fusion/php/code
1•retlim•1h ago•0 comments

Less is more: language features (2015)

https://blog.ploeh.dk/2015/04/13/less-is-more-language-features/
1•magarnicle•1h ago•1 comments