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

How you invent math: From counting to complex numbers

https://growingswe.com/blog/inventing-math
1•adityaathalye•5m ago•0 comments

Tesla must face lawsuit alleging anti-American bias in hiring, US judge rules

https://www.reuters.com/legal/government/tesla-must-face-lawsuit-alleging-anti-american-bias-hiri...
1•1659447091•7m ago•0 comments

Destroy My Startup

https://shipordie.club/roast/startup
1•alexlock•10m ago•0 comments

Glazyr Viz – A Hardened Chromium Fork for Sub-16ms Agentic Vision

https://glazyr.com/
1•mcpmessenger•12m ago•2 comments

RFC 406i - The Rejection of Artificially Generated Slop

https://406.fail/
1•pabs3•13m ago•0 comments

Ask HN: Do you measure non human traffic impact as a financial metric?

1•redwine13•19m ago•0 comments

The database that's 1000x faster – SpacetimeDB 2.0 [video]

https://www.youtube.com/watch?v=C7gJ_UxVnSk
1•agentifysh•19m ago•1 comments

Show HN: Factagora – AI agents compete on predictions, time proves who's right

https://factagora.com
3•randybaek•20m ago•2 comments

Apple removing "Foxconn" from photos of workers at new Houston plant

https://imgur.com/a/Vxd9Mtc
4•icwtyjj•20m ago•1 comments

GPT-OSS Optimizations on Nvidia Blackwell: Pushing the Pareto Frontier

https://blog.vllm.ai/2026/02/01/gpt-oss-optimizations.html
1•roody_wurlitzer•21m ago•0 comments

Show HN: Open-source temporary email service using haraka and node

https://www.freecustom.email/en
1•dishantsinghdev•21m ago•0 comments

Don't Post on Product Hunt

https://ziva.sh/blogs/dont-post-on-product-hunt
1•OsrsNeedsf2P•24m ago•0 comments

Submerged Canoes Offer New Insights into Ancestral Traditions Waterways (2025)

https://www.wisconsinhistory.org/Records/Article/CS17431
1•1659447091•25m ago•0 comments

Show HN: 1Password Replica (Security Challenge)

https://github.com/rajksarkar/vaultkeeper
1•davinci123•25m ago•0 comments

The war against PDFs is heating up

https://www.economist.com/business/2026/02/24/the-war-against-pdfs-is-heating-up
3•petethomas•27m ago•1 comments

Show HN: Add price tags to 50 product photos in minutes (no Canva/PS)

https://pricetaggenerator.com
1•oliveroll•28m ago•0 comments

Nvidia's Insane AI Found the Math of Reality [video]

https://www.youtube.com/watch?v=WNsSzX0L4Es
1•surprisetalk•31m ago•0 comments

Addition Under Pressure

https://twitter.com/DimitrisPapail/status/2024555561199480918
1•vismit2000•32m ago•0 comments

Show HN: Riverse – Local AI agent with memory that grows over time

https://github.com/wangjiake/JKRiver
1•collenjk•33m ago•0 comments

SaaS Is Dead. I Buried It in 15 Days. Here's the Proof

1•htuzel•33m ago•0 comments

The writing was always the cheap part

https://passo.uno/real-cost-of-documentation/
1•theletterf•34m ago•0 comments

Is LipoVive Legit? 2026 Reddit and Health Forum Roundup

https://www.morningstar.com/news/accesswire/1138075msn/lipovive-reviews-shocking-2026-report-what...
1•makugats•34m ago•1 comments

Agents of Chaos

https://arxiv.org/abs/2602.20021
1•nextos•35m ago•0 comments

Socialist Excellence in New York City

https://pluralistic.net/2026/02/24/mamdani-thought/
1•pabs3•40m ago•0 comments

Data center developers asked Trump for an exemption from pollution rules

https://grist.org/regulation/these-data-center-developers-asked-trump-for-an-exemption-from-pollu...
5•billybuckwheat•42m ago•0 comments

Fry's Food and Drug

https://en.wikipedia.org/wiki/Fry%27s_Food_and_Drug
1•pinkmuffinere•45m ago•0 comments

Show HN: AgentPass – Identity layer for AI agents (passports, email, trust)

https://github.com/kai-agent-free/AgentPass
1•kai_agent•48m ago•0 comments

Agent context management: ephemeral vs. durable classification

https://sparkco.ai/infra
1•sparkco123•48m ago•1 comments

AI_ATTRIBUTION.md: A Standard for Tracking Creative Control in Human-AI Coding

https://ismethandzic.com/blog/ai_attribution_md/
1•blueblahblue•49m ago•0 comments

vLLM WideEP and Large-Scale Serving Toward Maturity on Blackwell (Part I)

https://blog.vllm.ai/2026/02/03/dsr1-gb200-part1.html
1•roody_wurlitzer•51m ago•0 comments