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

Anyone switch accounts for Claude Code, did you lose everything?

1•dpark2026•27s ago•0 comments

¡Haciendo Historia Celebrating PyCon US's First-Ever Spanish-Language Keynote

https://pycon.blogspot.com/2026/04/haciendo-historia-celebrating-pycon-uss.html
2•lumpa•14m ago•0 comments

Auralo: An nice new Radio App check it out

https://testflight.apple.com/join/mEtdrzZ5
1•marc0janssen•19m ago•2 comments

Trump fires Pam Bondi as US Attorney General

https://www.reuters.com/world/trump-fires-pam-bondi-us-attorney-general-cnn-fox-2026-04-02/
2•mgh2•23m ago•3 comments

AgentShift–One command migrates your OpenClaw agents to NemoClaw

https://agentshift.sh/
1•ogkranthi•31m ago•0 comments

Uber engineer alleges hostile 'boys club' culture, firing after cancer leave

https://archive.org/details/10127280
3•nickvec•34m ago•0 comments

Spath and Splan

https://sumato.ai/posts/2026-04-04-spath-and-splan.html
1•jasonmoo•35m ago•0 comments

Ask HN: Interactive Car Mechanics Guide?

1•id00•39m ago•0 comments

Scientists are working on "everything vaccines"

https://economist.com/science-and-technology/2026/04/01/scientists-are-working-on-everything-vacc...
5•andsoitis•39m ago•1 comments

Donald Knuth: Open Letter to Condoleezza Rice (2002)

https://www-cs-faculty.stanford.edu/~knuth/rice.html
3•car•40m ago•1 comments

100 Years of the Iron Ring

https://engineerscanada.ca/news-and-events/news/100-years-of-the-iron-ring-a-symbol-of-an-enginee...
1•jruohonen•46m ago•0 comments

Vibe coded a design tool for a client handover as a non-technical founder

https://www.ugh.design
2•jayantrao94•51m ago•1 comments

Video Friday: Digit Learns to Dance

https://spectrum.ieee.org/video-humanoid-dancing
2•jruohonen•53m ago•0 comments

AdGuard ad trackers What ad-based surveillance does to your traffic

https://adguard.com/en/blog/adguard-ad-tracker-report-2025.html
2•XzetaU8•55m ago•0 comments

Pale Blue Dot

https://en.wikipedia.org/wiki/Pale_Blue_Dot
3•thunderbong•56m ago•1 comments

EU cyber agency attributes major data breach to TeamPCP hacking group

https://therecord.media/european-commission-cyberattack-teampcp
4•jruohonen•1h ago•1 comments

Show HN: AI Dev Board – Job Board for AI Developers with a Full REST API

https://aidevboard.com/
2•8bitconcepts•1h ago•0 comments

Ask HN: Why still embed heavy 3rd-party iFrames for simple social proof?

2•LordKode•1h ago•0 comments

Show HN: HyprMac – I missed Hyprland after switching to Mac, so I built it

https://github.com/zacharytgray/HyprMac
2•zachtgray•1h ago•0 comments

Thoughts on AI and Research [pdf]

https://economics.mit.edu/sites/default/files/2026-04/IA%20AI%20note_1.pdf
2•jxmorris12•1h ago•0 comments

Jungle old school drum and bass radio

https://radio.aklein.studio/public/lounge24_radio
3•misterthp•1h ago•0 comments

It's open season for refusing AI

https://www.bloodinthemachine.com/p/its-open-season-for-refusing-ai
7•HotGarbage•1h ago•2 comments

No luck for Broadcom as Netflix and Quinn Emanuel succeed in nullity claim

https://www.juve-patent.com/cases/no-luck-for-broadcom-as-netflix-and-quinn-emanuel-succeed-in-an...
2•breve•1h ago•0 comments

How to Evaluate Claude Skill Output Quality for Prompt-to-SQL Scenarios

https://dekart.xyz/blog/how-to-evaluate-claude-skill-output-quality-for-prompt-to-sql-scenarios/
2•delfrrr•1h ago•0 comments

Mcpx: a Rust proxy that catches MCP schema changes and tool poisoning at runtime

https://github.com/MeghP89/mcpx
2•meghp89•1h ago•0 comments

Naming rights to street auctioned in San Francisco

https://paintastreet.com/auction
3•18nleung•1h ago•0 comments

Show HN: Clangine-de-Poitrine

https://github.com/jerpint/clangine-de-poitrine
1•jerpint•1h ago•0 comments

New Wave of Privacy Litigation Under 2005 Colorado Telemarketing Fraud Act

https://web.archive.org/web/20260212222452/https://www.troutman.com/insights/new-wave-of-privacy-...
2•1vuio0pswjnm7•1h ago•1 comments

Auto-harness: Self improving agentic systems with auto-evals (open-sourced)

https://twitter.com/gauri__gupta/status/2040251170099524025
2•gauri1902•1h ago•2 comments

A Big Alignment Loophole of Current Froniter LLMs

https://github.com/wuyoscar/ISC-Bench
3•pythonsen•1h ago•1 comments