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?

SoundCloud will let artists sell music directly, without fees

https://dataconomy.com/2026/08/27/soundcloud-will-let-artists-sell-music-directly/
1•giuliomagnifico•1m ago•0 comments

Futurism Is Always Extreme

https://borretti.me/article/futurism-is-always-extreme
1•varjag•5m ago•0 comments

Mind sharing Google Colab pro or a VM?

1•mzubairtahir•5m ago•0 comments

Show HN: A 67-point scorer for engineers considering Canada

https://fswcalculator.com/
1•Sherry9695•6m ago•0 comments

How to Use DuckDB for Local Data Analysis

https://visualeaf.com/blog/how-to-use-duckdb-for-local-data-analysis/
2•kyle_mongo•6m ago•0 comments

Qwen3.8-Flash-Next Intelligence, Performance and Price Analysis

https://artificialanalysis.ai/models/qwen3-8-flash-next
2•theanonymousone•8m ago•0 comments

I computed 4M real compatibility connections between 2,886 AI tools

https://www.gateonai.com/
1•gateonai•8m ago•0 comments

Twitter: The square is back. And this time, it's yours

https://twitter.now/
3•akyuu•10m ago•0 comments

Vigorish is a classic item of current American slang

https://www.worldwidewords.org/qa-vig1.html
1•Bluestein•11m ago•0 comments

Planet Crisis Response – Bhote Koshi-Trishuli Outburst Flood, Nepal (2026)

https://source.coop/planet/disasterdata/nepal-flash-flood-2026-08-26
1•marklit•11m ago•0 comments

The load-bearing vocabulary of Claude

https://louisabraham.github.io/load-bearing/
3•Labo333•15m ago•0 comments

Ask HN: What happens to code review process when using LLMs?

1•ethanr2000•16m ago•0 comments

Show HN: Reconstruct distributed LLM training traces

https://trace.vladsavinov.com/
1•vsavinov•16m ago•0 comments

Show HN: I built one interface for generating video with multiple AI models

https://imgveo.com
1•Jasonleo•19m ago•0 comments

Prisma rebranded, with big changes for Prisma ORM users

https://www.prisma.io/blog/building-the-stack-for-the-next-million-products
4•ankur_007•20m ago•0 comments

Show HN: I built an interactive astrocartography map from birth chart data

https://astrochart.co
1•Jasonleo•20m ago•0 comments

Dev snapshot: Godot 4.8 dev 4

https://godotengine.org/article/dev-snapshot-godot-4-8-dev-4/
1•__natty__•22m ago•0 comments

AI Feels Like the Pandemic All over Again

https://bejofo.com/blog/ai-feels-like-the-pandemic
2•YannickR•24m ago•0 comments

Changes to Sourcehut's terms of service regarding LLMs

https://sourcehut.org/blog/2026-08-27-tos-changes-and-llms/
4•progval•30m ago•0 comments

Spice-ts: a TypeScript-native SPICE circuit simulator

https://github.com/mfiumara/spice-ts
1•j0selit0•30m ago•0 comments

Cowanomics – A fun stock trading party game that uses web sockets

https://cowanomics.com/
1•etoxin•31m ago•0 comments

300mg of morning caffeine didn't improve mood or cognitive measures in males

https://www.mdpi.com/2072-6643/18/17/2771
1•giuliomagnifico•34m ago•0 comments

PrepIQ – AI kitchen intelligence for Hospitality prep planning

https://prepiq.net
1•HilqiaKM•35m ago•0 comments

Show HN: It's always been about size contests

https://epenis.lol/
1•MajorBaguette•35m ago•0 comments

Remove Hardcoded Subtitles. Keep Videos Clean

https://subtitleremover.com/
1•horanv•36m ago•0 comments

I don't worry about cost of AI models and you shouldn't too

https://davletd.medium.com/cost-of-ai-models-is-not-what-you-shoud-be-worried-about-e6439498bae7
2•davletdz•43m ago•0 comments

The Dutch are filling gas wells with cement

https://www.siliconcontinent.com/p/the-dutch-are-filling-gas-wells-with
2•Gijs4g•46m ago•0 comments

Troubleshooting and Preventing Task Deadlocks in Apache DolphinScheduler

https://medium.com/https://medium.com/@ApacheDolphinScheduler/when-workflows-get-stuck-troublesho...
1•DSOfficial•48m ago•1 comments

Show HN: I built an agent-first productivity bridge for all your agents

https://www.taskshell.app/
1•Frederick_22xAI•50m ago•0 comments

Show HN: TCP vs. UDP speed test – real transports, no simulation

https://tcp-vs-udp.com/
1•ilyassanida•52m ago•0 comments