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?

Category Theory Illustrated: From Sets to Categories

https://abuseofnotation.github.io/category-theory-illustrated/02_category/
1•boris_m•2m ago•0 comments

The Inflation Gamble

https://papers.ssrn.com/sol3/papers.cfm?abstract_id=5039068
1•toomuchtodo•4m ago•0 comments

The Backlash over Delivery Robots

https://www.bbc.com/news/articles/c0rygp005wjo
1•1659447091•6m ago•0 comments

GenDB – LLM-Powered Generative Query Engine

https://solidlao.github.io/GenDB/
1•matt_d•7m ago•0 comments

Electrocaloric effect

https://en.wikipedia.org/wiki/Electrocaloric_effect
1•teleforce•9m ago•0 comments

Scaling opencomputer from 1 VM to 1 million sandboxes

https://opencomputer.dev/blog/scaling-one-vm-to-million-sandboxes/
1•iacguy•10m ago•0 comments

[x86] AI Compute Extensions (ACE) Specification

https://x86ecosystem.org/resource/ai-compute-extensions-ace-specification/
2•matt_d•11m ago•0 comments

Your Definition of Done Is Wrong

https://fullscale.io/blog/definition-of-done/
1•spo81rty•13m ago•0 comments

FileZilla is still after 24 years

https://pauljacobson.me/2026/06/17/filezilla-is-still-awesome-after-24-years/
1•busymom0•16m ago•1 comments

BrandScreen Launch – Screen brand before build

https://www.brandscreen.ai/
1•emoney21•16m ago•1 comments

Three reasons fungi are not plants

https://asm.org/articles/2021/january/three-reasons-fungi-are-not-plants
2•teleforce•19m ago•1 comments

Six Numbers from Running 1,500 AI Agents Simultaneously

https://amitlimaye1.substack.com/p/six-numbers-from-running-1500-ai
2•amitlimaye•20m ago•0 comments

DuckDuckGo Collaborations

https://duckduckgo.com/collaborations
1•hmokiguess•21m ago•0 comments

Show HN: Ubercookie – A live demonstration of how websites can track you

https://ubercookie.xyz/
1•elpy1•22m ago•0 comments

VNX+: Self-contained RF payload for hosting AI/ML applications out of the box

https://epiqsolutions.com/products/sdr/vnx-development-platform
2•teleforce•29m ago•2 comments

Show HN: Gptbased – LLM leaderboard that emails you when to switch

https://gptbased.com
1•gptbased•33m ago•0 comments

Midjourney Full Body Ultrasonic CT Scanner

https://www.midjourney.com/medical/blogpost
62•lnyan•34m ago•16 comments

Learning VPP: Filtering Packets at 100GbE Line Rate

https://haryachyy.wordpress.com/2026/06/17/vpp-packet-filtering-100gbe-line-rate/
2•tanelpoder•34m ago•0 comments

Midjourney Medical

https://www.midjourney.com/medical
75•ricochet11•43m ago•65 comments

Next-Latent Prediction Transformers Learn Compact World Models - MS Research

https://jaydenteoh.github.io/blog/2026/nextlat
1•sorenjan•44m ago•0 comments

Show HN: Local personal data redaction for any AI tools

https://github.com/sophia486/pii-gui
3•unusual_typo•50m ago•0 comments

Manhattan's fastest bike messenger (1985) [video]

https://www.youtube.com/watch?v=xMvJ83XpGoI
2•droidjj•50m ago•0 comments

Show HN: Draft, Open Source Agent Context Sync/Collaboration

https://github.com/idodekerobo/draft
1•idodekerobo•51m ago•0 comments

Vevey – AI game dev for kids to build games, together

https://www.vevey.ai/
1•dvdhutch•51m ago•0 comments

Code Intelligence MCP Server

https://github.com/DeusData/codebase-memory-mcp
3•vantareed•51m ago•0 comments

Show HN: Rank scratch tickets in your state by expected value

https://scratchstats.ai
1•nlenn618•56m ago•0 comments

Former Tesla Exec Is Building the Home Heat Pump Musk Promised

https://www.notateslaapp.com/news/4313/former-tesla-exec-is-building-the-home-heat-pump-musk-prom...
2•voisin•59m ago•1 comments

Miuse: Agents for Guidance with Physical Tasks

https://miuse.tech/
1•pratt3000•59m ago•1 comments

Show HN: A world cup app built by football lovers

https://testflight.apple.com/join/f4gKRZwr
1•bootsybus•1h ago•0 comments

Show HN: I built a smart screen recording macOS

https://screeen.co
1•vinzdg•1h ago•0 comments