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?

Hiring

https://teachingmadefun.com/
1•TMFkids•1m ago•1 comments

NYC Bans Hidden Hotel Fees Ahead of World Cup Tourist Influx

https://www.bloomberg.com/news/articles/2026-01-21/nyc-bans-hidden-hotel-fees-ahead-of-world-cup-...
1•toomuchtodo•1m ago•0 comments

Show HN: Infinate –O(k)constant-time spatial attention for unlimited LLM context

https://github.com/ch1pu/infinate
1•ch1pu•2m ago•0 comments

ChatGPT needs a persistent workspace layer

2•LostBeacon•3m ago•0 comments

Show HN: PFAS Reporting 2026 – Triage tool for the EPA's 2011–2026 lookback rule

https://pfasreporting2026.com
1•todaycompanies•4m ago•1 comments

NexPhone: Android, Linux, and Windows 11 in a single device

https://nexphone.com/
1•gessha•4m ago•0 comments

Show HN: Find what you should play next

https://gamebrain.co
1•dsky•5m ago•0 comments

The Truth About Toilet Swirl

https://www.smartereveryday.com/toiletswirl
1•ColinWright•5m ago•0 comments

Get Closer So I Can Hear the Birds

https://terratauri.com/blog/get-closer-so-i-can-hear-the-birds/
2•terramauthe•6m ago•0 comments

Show HN: Ably AI Transport - a transport layer for agentic apps

https://ably.com/docs/ai-transport
1•mchristensen•8m ago•0 comments

Face Shape Detector

https://whatismyfaceshape.net/
1•adilblati3•9m ago•1 comments

Show HN: Tandem – open-source cross-platform AI coworker (Tauri)

1•frumu•13m ago•1 comments

Show HN: TerabyteDeals – Compare storage prices by $/TB

https://terabytedeals.com
1•vektor888•13m ago•0 comments

Oldest Cave Art Discovered in Indonesia

https://www.barrons.com/news/world-s-oldest-cave-art-discovered-in-indonesia-3ddd2a48
1•wjb3•13m ago•0 comments

Typeframe PS-85 – portable inspired by Alien

https://www.typeframe.net/docs/ps-85
2•vpribish•14m ago•1 comments

Show HN: An Ishihara (colorblindness) test generator

https://connorboyle.io/ishihara/
1•connorboyle•15m ago•0 comments

What if AI is both good and not that disruptive?

https://deadneurons.substack.com/p/what-if-ai-is-both-really-good-and
1•nr378•15m ago•0 comments

Grok exposes detailed account suppression information

https://twitter.com/realstewpeters/status/2013848860771144075
3•gravisultra•16m ago•1 comments

TV Screen Type Explained [video]

https://www.youtube.com/watch?v=8x1imoz5nrs
1•debesyla•17m ago•0 comments

Yes, code review is the bottleneck, no you're not doing it right

https://cognition.ai/blog/devin-review
1•agtestdvn•17m ago•1 comments

eBay Explicitly Bans AI "Buy for Me" Agents in User Agreement Update

https://www.valueaddedresource.net/ebay-bans-ai-agents-updates-arbitration-user-agreement-feb-2026/
3•bdcravens•19m ago•0 comments

My First Product Launch

https://veloblanco.global/
1•TBaronG•19m ago•1 comments

NeurIPS accepted research papers with 100 AI-hallucinated citations

https://fortune.com/2026/01/21/neurips-ai-conferences-research-papers-hallucinations/
1•Jimmc414•19m ago•0 comments

Spain's rail network under scrutiny after second deadly crash in three days

https://www.theguardian.com/world/2026/jan/21/spain-rail-network-scrutiny-after-second-train-crash
1•geox•21m ago•0 comments

I Built a Localhost Tunneling Tool in TypeScript – Here's What Surprised Me

https://softwareengineeringstandard.com/2026/01/20/i-built-a-localhost-tunnel-in-typescript-and-h...
1•aussieguy1234•25m ago•0 comments

Stevey's Birthday Blog

https://steve-yegge.medium.com/steveys-birthday-blog-34f437139cb5
2•squirrel•26m ago•0 comments

Beam Bots – Resilient Robotics

https://beambots.dev/
3•lawik•27m ago•0 comments

High-Availability Feature Flagging at Databricks

https://www.databricks.com/blog/high-availability-feature-flagging-databricks
3•bcongdon•28m ago•0 comments

Safety, Efficiency, and Workload of Predictive Display in Simulated Teledriving

https://www.mdpi.com/1424-8220/26/1/221
1•PaulHoule•32m ago•0 comments

Comparing 15 AI video models side-by-side using identical prompts

https://lmarena.ai/?chat-modality=video
2•leanvector•33m ago•2 comments