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

Show HN: Blotter, a live map of LAPD radio activity

https://blotter.fm
1•s_e__a___n•5m ago•1 comments

Show HN: Multi Kanban Task Board and MCP Server

https://github.com/dizlexic/moo-tasks
1•dizlexic•6m ago•0 comments

Show HN: AgentSwift – open-source iOS builder agent

https://github.com/hpennington/agentswift
1•hpen•6m ago•0 comments

Apple WWDC 2014 scrapped opening video

https://archive.org/details/apple-scrapped-wwdc-14-video
1•igregoryca•8m ago•0 comments

Why isn't AMD's MI300X competitive?

https://newsletter.semianalysis.com/p/mi300x-vs-h100-vs-h200-benchmark-part-1-training
1•colonCapitalDee•9m ago•0 comments

CertHound – open-source SSL/TLS certificate discovery and auto-renewal agent

https://github.com/deadbolthq/certhound-agent
1•keelw•10m ago•1 comments

Fidenae

https://en.wikipedia.org/wiki/Fidenae
1•pinkmuffinere•13m ago•1 comments

Microsoft TRELLIS.2: An Open-Source, 4B-Parameter, Image-to-3D Model [pdf]

https://arxiv.org/abs/2512.14692
1•thunderbong•16m ago•0 comments

Anthropic's pre-IPO valuation has officially hit $1T

https://xcancel.com/i/status/2048793675606659309
3•simonpure•17m ago•0 comments

Bettertrumpet: The volume mixer Windows never built

https://bettertrumpet.hiii.boo/
2•xammen•21m ago•1 comments

Turkey's underground city of 20k people (2022)

https://www.bbc.com/travel/article/20220810-derinkuyu-turkeys-underground-city-of-20000-people
4•thunderbong•29m ago•0 comments

The moderately easy problem of consciousness

https://www.noahpinion.blog/p/the-moderately-easy-problem-of-consciousness
2•nradclif•34m ago•0 comments

Anthropic's definition of safety is too narrow

https://jonathannen.com/anthropic-safety-too-narrow/
5•jwilliams•43m ago•0 comments

Engineering the Fashion Catalog of Summer 2026

https://rapidkt.com/pages/blog/engineering_the_fashion_catalog_of_summer_2026
3•greenpau•44m ago•1 comments

Show HN: 49Agents – Infinite canvas IDE for AI agents

https://github.com/49Agents/49Agents
3•alpadurza•44m ago•0 comments

The Man Behind AlphaGo Thinks AI Is Taking the Wrong Path

https://www.wired.com/story/david-silver-ai-ineffable-intelligence-reinforcement-learning/
1•fmihaila•45m ago•0 comments

Using native Rails rate-limits in production

https://amzcartshare.com/native-rails-rate-limits
1•hbroadbent•46m ago•0 comments

Agents can't choose between structure and flexibility

https://frontierai.substack.com/p/agents-cant-choose-between-structure
1•gmays•48m ago•0 comments

Ted Nyman – High Performance Git

https://gitperf.com/
2•gnabgib•49m ago•0 comments

FAA to begin collecting user fees for commercial launches

https://spacenews.com/faa-to-begin-collecting-user-fees-for-commercial-launches-and-reentries/
1•polalavik•57m ago•0 comments

Xiaomi MiMo-v2.5-Pro Open-Sourced: 1T Parameter Model

https://huggingface.co/XiaomiMiMo/MiMo-V2.5-Pro
3•gainsurier•1h ago•0 comments

Unreal Struggles with Renaming Stuff (and how to fix it)

https://larstofus.com/2026/04/26/how-unreal-struggles-with-with-renaming-stuff-and-how-to-fix-it/
2•caminanteblanco•1h ago•0 comments

portless – named .localhost URLs for Development

https://portless.sh/
2•bpierre•1h ago•0 comments

Google staff urge chief executive to block US Military AI use

https://www.ft.com/content/9270ce04-558c-44e8-816f-a40219cd5007
6•propagandist•1h ago•0 comments

Generative AI Vegetarianism

https://sboots.ca/2026/03/11/generative-ai-vegetarianism/
18•marvinborner•1h ago•17 comments

Google Staff Urge Pichai to Refuse Classified Military AI Work

https://www.bloomberg.com/news/articles/2026-04-27/google-staff-urge-pichai-to-refuse-classified-...
4•johnshades•1h ago•0 comments

People Using AI to Represent Themselves in Court Are Clogging the System

https://www.404media.co/people-using-ai-to-represent-themselves-in-court-are-clogging-the-system/
6•pavel_lishin•1h ago•0 comments

Professors Disturbed to Find Their Lectures Chopped Up and Turned into AI Slop

https://www.404media.co/asu-atomic-ai-modules-arizona-state-university/
4•pavel_lishin•1h ago•0 comments

AI App Builders vs. Traditional Development: Which Is Right for You?

https://aiappbuild-cb8b4jpw.manus.space/
1•nexus-build•1h ago•0 comments

To my students

http://ozark.hendrix.edu/~yorgey/forest/00FD/index.xml
226•marvinborner•1h ago•104 comments