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?

Hooked on Tuna

https://blue-continuum.com/hooked-on-tuna
2•dnetesn•6m ago•0 comments

Rooting Multiple ISPs with Hyperglass

https://hyperpwn.xyz/
2•csmantle•12m ago•0 comments

Brazil's Largest Port Hit by Major IT Outage; Suspected Ransomware Cyberattack

https://uknip.co.uk/news/uk/uk-news/brazils-largest-port-hit-by-major-it-outage-amid-suspected-ra...
1•dvaplima•15m ago•0 comments

Ask HN: Why doesn't Ramp AI Index include OpenRouter or other aggregators?

1•ddxv•16m ago•0 comments

Anthropic Software Engineer Salaries

https://www.levels.fyi/companies/anthropic/salaries/software-engineer
1•zuhayeer•19m ago•0 comments

The indie game community is in disarray over AI and Big Walk

https://www.theverge.com/games/1030994/big-walk-independent-games-festival-igf-ai
2•tasoeur•20m ago•0 comments

State of the tech job market: late 2026

https://www.lennysnewsletter.com/p/state-of-the-tech-job-market-late
1•flowerlad•22m ago•2 comments

Discontinuation of Google and Apple Accounts Linking to Nintendo Accounts

https://www.nintendo.com/en-gb/Support/Nintendo-Account/Discontinuation-of-Google-and-Apple-accou...
1•thunderbong•22m ago•0 comments

Show HN: A company running in an AI harness

https://restless.run/
2•yaoke259•22m ago•0 comments

GSD-LQ: Zero-calibration sub-4-bit compression and 7B in 3.78 GB VRAM

https://github.com/Phantom309-CED/GSD-LQ/tree/main/gsd_lq_v2
1•Phantom309-CED•23m ago•0 comments

Tokenizers

https://jechevarria.com/blog/2026/11/11/tokenizers/
1•j_echevarria•24m ago•0 comments

Toyota Sees a U.S. Future for Tiny Trucks with a Devoted Following (Kei Trucks)

https://www.nytimes.com/2026/11/10/business/toyota-kei-pickup-truck.html
1•rawgabbit•25m ago•0 comments

Microsoft employee price list from 1987

https://devblogs.microsoft.com/oldnewthing/20261110-00/?p=112843/
1•soheilpro•29m ago•0 comments

A great old-timey game-programming hack (2013)

https://blog.moertel.com/posts/2013-12-14-great-old-timey-game-programming-hack.html
11•palsecam•33m ago•0 comments

How to Be a Good Farrier: What the Car Teaches Us About AI and Your Job

https://www.sethserver.com/ai/how-to-be-a-good-farrier.html
1•sethito•36m ago•0 comments

E-means: outperforming k-means (in one-tenth the epochs)

https://arxiv.org/abs/2611.09501
1•Anon84•36m ago•0 comments

Reddit Reviews

https://redditinc.com/news/introducing-reddit-reviews
4•soheilpro•37m ago•2 comments

The Sicilian Citrus Family Tree

https://www.notesfromtheroad.com/europa/citrus-family-tree.html
1•wmchen•37m ago•0 comments

Vote the Page: a website rewritten every hour by its top-voted prompt

https://votethepage.com/
2•mark-glue•39m ago•0 comments

Claude usage limit reset is a gambler's rush

1•hoppp•40m ago•1 comments

Could AI's leading men become as powerful as Ford or Rockefeller?

https://www.economist.com/business/2026/04/16/could-ais-leading-men-become-as-powerful-as-ford-or...
2•gmays•41m ago•1 comments

Planetocopia (2002-2017)

http://www.worlddreambank.org/P/PLANETS.HTM
1•OgsyedIE•41m ago•0 comments

Show HN: HC – a HyperCard clone that runs original stacks on today's Macs

https://hc.labynet.fr/en.html
3•cleobuline•44m ago•0 comments

Try my daily game whosit

https://playwhosit.com/
1•phtdevelops•45m ago•0 comments

Claude Code is accidentally exposing secrets all over GitHub

https://arstechnica.com/ai/2026/11/claude-code-settings-files-expose-thousands-of-secrets-on-github/
3•Gaishan•49m ago•1 comments

A Schema Named Hash Sent Our Ruby SDK into Infinite Recursion

https://octri.dev/blog/schema-names-shadow-standard-library
2•khalidkhair•56m ago•0 comments

Show HN: Kotlean: write Android apps in Lean

https://github.com/kbr-/kotlean
1•kbr-•56m ago•0 comments

Silent degradation is back, Fable and Mythos 5.2 perform at level of Opus 5.5

https://twitter.com/sfxnz/status/2120058367825908031
4•espeed•56m ago•1 comments

Yahoo is betting the house on its new AI, from search to all its services

https://www.fastcompany.com/91637528/yahoo-scout-new-search-ux
1•mkmk•56m ago•0 comments

Getting Started with OpenIndiana

https://docs.openindiana.org/handbook/getting-started/
1•measurablefunc•57m ago•0 comments