frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Ask HN: How can I load test PostgreSQL but avoid changing actual data?

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

Show HN: Makememe – a meme CLI for your Claude Code

https://github.com/dhruvmehra/makememe
1•dhruvme•1m ago•0 comments

A Dialog on APL (2015)

https://www.dyalog.com/blog/2015/05/a-dialog-on-apl/
1•tosh•2m ago•0 comments

Premature Optimization Is Fun Sometimes

https://invlpg.com/posts/2025-06-19-premature-optimization.html
1•throawayonthe•3m ago•0 comments

Blaise v0.10.0 (alpha) – Incremental compile, Native Back end and more

https://github.com/graemeg/blaise/releases/tag/v0.10.0
1•mariuz•3m ago•0 comments

OpenAI wants shopping in ChatGPT. Wassist raises $1.1M to keep it on WhatsApp

https://techfundingnews.com/openai-wants-shopping-in-chatgpt-wassist-raises-1-1m-to-keep-it-on-wh...
1•joshwarwick15•4m ago•0 comments

Becoming yourself is a social project

https://velvetnoise.substack.com/p/becoming-yourself-is-a-social-project
1•jger15•4m ago•0 comments

Show HN: Incremental RAG ingestion, only changed chunks get re-embedded

https://github.com/shamikhan005/chunks-sync
1•shamikhan005•6m ago•0 comments

Compiling APL to JavaScript (2014)

https://web.archive.org/web/20150114032647/https://archive.vector.org.uk/art10501160
1•tosh•10m ago•0 comments

Sendzap-One click to WhatsApp. No saved contacts required

https://apps.apple.com/in/app/sendzap/id6770007484
1•kauntech•10m ago•0 comments

Replies to comments on my "LLMs are eroding my career" post

https://human-in-the-loop.bearblog.dev/replies-to-comments-on-my-llms-are-eroding-my-career-post/
2•omblivion•12m ago•1 comments

Software for Converting the OST File to PST Format

https://apps.microsoft.com/detail/9p62fq9z8x7p?hl=en-US&gl=US
1•tieanderson•13m ago•0 comments

Seedream 5.0 Image and Video – create AI videos

https://seedream4.video/
1•zlonmask•13m ago•0 comments

Get old Google icons from 2020 and 2016 back with Ink for Google

https://chromewebstore.google.com/detail/ink-for-google/hmanckoiohnlgdommlcckcflkmllobgj
1•carlosj•15m ago•0 comments

Listable AI

https://www.listableai.com/
1•PaulinMartin•16m ago•0 comments

Use Neovim with Claude Code

https://github.com/NishantJoshi00/sidekick
1•cat-whisperer•19m ago•0 comments

Show HN: AI LinkedIn auto-apply that runs in your own browser session

https://jobeasyapply.com
1•Maazkhanxo•20m ago•0 comments

Pizx – zx and Pi AI = shell scripting with 15 AI agent patterns

https://github.com/topce/pizx
1•topce•20m ago•0 comments

NY lawmakers vote to ban 'surveillance pricing,' but digital price tags survive

https://gothamist.com/news/ny-lawmakers-vote-to-ban-surveillance-pricing-but-digital-price-tags-s...
2•pseudolus•21m ago•0 comments

Show HN: GermanWeekly, Weekly German Lessons

https://germanweekly.com/
1•smoqadam•21m ago•0 comments

SpaceX IPO: Nice Try Though

https://www.youtube.com/watch?v=IHD8BDFYyGI
1•doener•21m ago•0 comments

To end animal suffering, the most ethical choice is to kill wild predators

https://qz.com/497675/to-truly-end-animal-suffering-the-most-ethical-choice-is-to-kill-all-predat...
2•internet_points•22m ago•1 comments

I run an AI girlfriend company. Here's why you shouldn't use it every day

https://bae.ppl.studio/letter
1•zeshutmax•22m ago•1 comments

JNU, a Vibe Coded Operating System

1•annoymousperson•23m ago•0 comments

React Native, Hermes bytecode, and the Kindle homepage

https://sighery.com/posts/patching-kindle-homepage/
1•Sighery•24m ago•0 comments

Ask HN: What is the AI setup for an experienced dev starting on a new project?

3•postexitus•25m ago•1 comments

Silicon Valley including Meta has embraced MAGA politics, says Nick Clegg

https://www.theguardian.com/politics/2026/jun/08/silicon-valley-meta-maga-politics-nick-clegg
2•dkdbejwi383•27m ago•2 comments

Config Files That Run Code: Supply Chain Security Blindspot

https://safedep.io/config-files-that-run-code/
3•signa11•29m ago•0 comments

Tech firms must stop kids sending and receiving explicit images or face new laws

https://www.bbc.co.uk/news/live/cr5j43zp2rpt
3•ColinWright•29m ago•0 comments

Jumping spiders inspire ultra-efficient (less 1W) 3D camera

https://news.northwestern.edu/stories/2026/06/jumping-spiders-inspire-ultra-efficient-3d-camera
3•giuliomagnifico•31m ago•0 comments

Behind the <P812: academic major> Property

https://rtnf.substack.com/p/behind-the-p812-academic-major-property
1•altilunium•31m ago•0 comments