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?

From kinetic gases to an exponentially expanding universe

https://iopscience.iop.org/https:/validate.perfdrive.com/fb803c746e9148689b3984a31fccd902?ssa=8a7...
1•diwank•20s ago•0 comments

Beebo Wave Simulator

https://git.sr.ht/~willowf/beebo/
2•anon25783•3m ago•0 comments

AI Dance Video Generator Online Free

https://www.aidancegenerator.org/
1•wsm123456•4m ago•0 comments

Show HN: Apps posted here classified by LLM

https://github.com/johndimm/show-hn-classified
1•johndimm•6m ago•1 comments

Personal Taste Is the Moat

https://wangcong.org/2026-01-13-personal-taste-is-the-moat.html
1•gpi•9m ago•0 comments

Pixel 6 and 7 Updates Are Missing: Here's What Is Happening with Your Pixel

https://www.droid-life.com/2026/01/12/pixel-6-pixel-7-updates-schedule-missing/
2•keithoffer•9m ago•0 comments

Claude Code CVE-2025-66032: Why Allowlists Aren't Enough

https://niyikiza.com/posts/cve-2025-66032/
1•niyikiza•10m ago•0 comments

CES 2026:A thumb-sized computer with hardware-isolated OS over USB

https://plugos.net/news/2026/01/08/plugos-at-ces.html
1•TrustKernel•11m ago•0 comments

CIA and Chinese PLA joined hands in Cold War op to snoop on Soviet nukes • 2022

https://theprint.in/world/how-cia-chinese-pla-joined-hands-in-secret-cold-war-op-to-snoop-on-sovi...
1•richardatlarge•13m ago•0 comments

Mao Card Game

https://en.wikipedia.org/wiki/Mao_(card_game)
1•marysminefnuf•13m ago•0 comments

Developer writes script to throw AI out of Windows

https://www.theregister.com/2026/01/13/script_removes_ai_from_windows/
1•Brajeshwar•15m ago•1 comments

Uber Airport Demand Forecasting

https://www.uber.com/blog/forecasting-models-to-improve-availability-at-airports/
1•brettcvz•19m ago•0 comments

China's Hottest New App Is 'Are You Dead Yet'

https://www.wired.com/story/china-are-you-dead-yet-app/
1•Kholin•20m ago•0 comments

Why India's plan to make AI companies pay for training data should go global

https://restofworld.org/2026/india-ai-data-license-fee/
2•Brajeshwar•25m ago•0 comments

Google please stop blocking my parody website

https://ivanca.github.io/censorship/2026/01/13/google-stop-blocking-my-parody-website/
1•AmbroseBierce•32m ago•0 comments

FateTell – Chinese I Ching and BaZi AI with physics-based interaction

https://fatetell.com/
2•Farigh4•32m ago•1 comments

Artificial StupidIntelligence and Airport Sinks

https://www.deobald.ca/essays/2026-01-13-artificial-stupidintelligence-and-airport-sinks/
1•deobald•33m ago•0 comments

The Jock Programming Language

https://jock.org
2•Antibabelic•34m ago•1 comments

Leash by StrongDM

https://leash.strongdm.ai/
2•handfuloflight•37m ago•0 comments

GLM-Image: High-Fidelity Image Generation

https://glmimage.com
2•sarkory•41m ago•1 comments

Why do so many students have ADHD?

https://unherd.com/2026/01/why-do-so-many-students-have-adhd/
3•jnord•44m ago•0 comments

Show HN: Soulcaster – Cluster feedback, spin up an agent to fix it

https://www.soulcaster.dev/
1•codecracker3001•50m ago•0 comments

What Will Work (and Won't) in SaaS in 2026:- Lessons from Building 100 Tools

https://digiwares.xyz/blog/saas-2026-predictions
3•digi_wares•55m ago•1 comments

Locksport Network Directory

https://locksport.net/
2•memoriesofsmell•55m ago•1 comments

Warmer climate, spicier food. But which country is the spiciest?

https://bigthink.com/strange-maps/temperature-spiciness-spectrum/
2•thunderbong•57m ago•0 comments

My Conversation with Stacey Abrams

https://snyder.substack.com/p/live-with-professor-timothy-snyder
1•hkhn•59m ago•0 comments

China may crack down on "Singapore-washed" tech companies

https://www.axios.com/2026/01/13/china-meta-manus-singapore
2•doppp•1h ago•0 comments

Ancient Rome meets modern technology

https://apnews.com/article/italy-palatine-hill-livestream-tours-emperor-frescoes-e63327f43424e125...
1•frm88•1h ago•1 comments

New Physics Paper: Resolving the Hubble Tension [pdf]

https://github.com/localtimeacceleration/LTA/blob/main/lta_paper.pdf
1•localtimeaccel•1h ago•1 comments

Apple Creator Studio

https://www.apple.com/apple-creator-studio/
1•aenean•1h ago•1 comments