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?

Show HN: Sigilla – Spaced repetition for browser tabs (stop hoarding)

1•northerndev•2m ago•1 comments

Big Tech Companies Prepare to Skirt Trump's $100k H-1B Fee

https://www.wsj.com/business/big-tech-companies-prepare-to-skirt-trumps-100-000-h-1b-fee-7cbf1ebe
2•johntfella•5m ago•0 comments

Show HN: Windy – Place wind turbines on a map, see residential impact

https://windy-pi.vercel.app/
1•baqiwaqi•6m ago•0 comments

Show HN: Web Scraping Sandbox Website

https://scrapingsandbox.com/
1•vrathee•8m ago•0 comments

My OpenClaw Desperately Needs a DevOps Agent

https://reorx.com/blog/devops-agent-is-the-next-openclaw-moment/
1•novoreorx•10m ago•0 comments

Streeting/Mandelson WhatsApp

https://shetlandj.github.io/w_text/
1•djgrant•11m ago•0 comments

DeepComputing Announced Early Access for the DC-ROMA RISC-V Mainboard III

https://store.deepcomputing.io/products/dc-roma-risc-v-mainboard-iii-for-framework-laptop-13-earl...
1•YesterdayOK94•13m ago•0 comments

Programmers should hedge against AI

https://amaca.substack.com/p/programmers-should-hedge-against
1•amacasubstack•13m ago•0 comments

Cursor-agent-team: Single-conversation, multi-role AI collaboration framework

https://github.com/thiswind/cursor-agent-team
1•thiswind•17m ago•1 comments

I Built Free Legal Skills for AI Agents

https://www.skala.io/legal-skills
1•dariagurevich•17m ago•1 comments

Show HN: The Hidden Bit - A Game Based proof architecture for P vs. NP

https://vakofmaya.github.io/pnp.html
1•TheAuditor•19m ago•0 comments

LLVM: Concerns about low-quality PRs being merged into main

https://discourse.llvm.org/t/concerns-about-low-quality-prs-being-merged-into-main/89748
2•latexr•19m ago•0 comments

GroMach

https://gromach.com/
1•hushuting•24m ago•0 comments

Show HN: AI-Templates for Obsidian Templater

https://github.com/ady1981/obsidian-templater-core-kbt
1•ady1981•25m ago•0 comments

Why Jony Ive put buttons in the electric Ferrari

https://www.youtube.com/watch?v=6Wv1btxCjVE
1•enaaem•26m ago•0 comments

Show HN: Tigement – private timeline planner that recalculates when tasks change

https://tigement.com
1•sodomak•26m ago•0 comments

Allumeria receives false DMCA from Microsoft over infringement of Minecraft IP

https://old.reddit.com/r/PhoenixSC/comments/1r0utq6/allumeria_receives_false_dmca_from_microsoft_...
1•joelkoen•30m ago•0 comments

Ask HN: How do you trace your own mental loops?

1•schneak•30m ago•0 comments

Show HN: We let GPT OSS 120B write and run Python and ARC AGI 2 jumped 4x

https://github.com/gutfeeling/arc-agi-2-submission
1•steinsgate•31m ago•0 comments

Show HN: IntentCode

https://intentcode.dev
1•jasfi•31m ago•1 comments

Deferred Member Initialization in C++

https://www.sandordargo.com/blog/2026/02/11/deferred-map-initialization
1•jandeboevrie•33m ago•0 comments

New open source model achieves same score as GPT 5.2 High on AIME2026 I

https://matharena.ai/?view=problem&comp=aime--aime_2026
2•mh3467•41m ago•2 comments

US Gov borrowed $43.5B per week in Q1 2026

https://fortune.com/2026/02/10/government-borrowing-cbo-report-deicit-lending-interest/
1•chirau•42m ago•0 comments

FAA Halts All Flights at El Paso Airport for 10 Days

https://www.nytimes.com/2026/02/11/us/faa-el-paso-flight-restrictions.html
29•edward•43m ago•11 comments

How to Be Less Wrong in a Polycrisis

https://blog.dougbelshaw.com/polycrisis-ebook/
1•dajbelshaw•44m ago•1 comments

Web Tiles: composable docs and apps safe in any context

https://webtil.es/
1•cernocky•48m ago•0 comments

How to level up the Fediverse [video]

https://fosdem.org/2026/schedule/event/HVJRNV-how_to_level_up_the_fediverse/
1•todsacerdoti•48m ago•0 comments

Using YouTube as Cloud Storage

https://www.youtube.com/watch?v=l03Os5uwWmk
1•birdculture•50m ago•0 comments

Human Line Project – Protecting emotional well-being in the age of AI

https://www.thehumanlineproject.org/
1•leethargo•51m ago•0 comments

A curated list of excellent books to learn PostgreSQL

https://github.com/sara8086/PostgresBooks
1•dariubs•51m ago•0 comments