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•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?

Continuous Modeling, or What Happens to the Model on Tuesday?

https://docs.eventsourcingdb.io/blog/2026/05/18/continuous-modeling-or-what-happens-to-the-model-...
1•goloroden•32s ago•0 comments

Why Crouching Tiger, Hidden Dragon Is a Masterpiece

https://yusufaytas.com/why-crouching-tiger-hidden-dragon-is-a-masterpiece
1•yusufaytas•38s ago•0 comments

Trapped in the dark web – a crisis growing in the shadows

https://apps.bostonglobe.com/2026/05/business/trapped-dark-web/child-exploitation-exploding-online/
1•abawany•1m ago•1 comments

Classic 7 is Windows 10 LTSC cosplaying as Windows 7

https://www.theregister.com/oses/2026/05/17/classic-7-is-windows-10-ltsc-cosplaying-as-windows-7/...
1•Bender•1m ago•0 comments

Pause App

https://pauseapp.space
1•coldcosmas•2m ago•0 comments

AI-generated code is 'pain waiting to happen'

https://www.theregister.com/ai-ml/2026/05/16/ai-generated-code-is-pain-waiting-to-happen/5241574
2•Bender•3m ago•0 comments

Temperate super-Earth found orbiting nearby red dwarf Ross 318

https://www.stellarcatalog.com/news/ross-318-temperate-super-earth-found
1•speckx•4m ago•0 comments

How to Start Investing with $100

https://comuniq.xyz/post?t=1095
1•01-_-•6m ago•0 comments

Microsoft is 1.84 Peters, Google is 0.66. What's the Peter unit?

https://github.com/zozo123/peter-gt-your-org
2•zozo123OR0x90•7m ago•0 comments

OpenSparrow – Open-source admin panel builder with zero dependencies

https://opensparrow.org/
1•tomaszwrobel•8m ago•0 comments

Rolling Shutter Demo

https://chiuhans111.github.io/spin/
1•Eduard•10m ago•1 comments

Journey to King Edward VIII Falls, Tallest Waterfall in Guyana

https://twitter.com/bronzebust/status/2056038216994529329
1•telotortium•10m ago•0 comments

Subscription Bombing: Email Under Attack

https://cacm.acm.org/practice/subscription-bombing-email-under-attack/
1•birdculture•11m ago•0 comments

Memo from Orson Welles on Touch of Evil (1957)

https://wellesnet.com/touch_memo1.htm
2•cocacola1•11m ago•0 comments

CHERI 2026 Conference videos playlist

https://www.youtube.com/playlist?list=PLTe5zG6binjnK0Ax2vvLBnb0ioojcaiVi
1•pjmlp•14m ago•0 comments

A Beginner's Guide to Irrational Behavior

https://danariely.com/coursera/
1•sebg•15m ago•0 comments

AI Needs Better Metaphors

https://metedata.substack.com/p/011-ai-needs-better-metaphors
3•young_mete•20m ago•0 comments

Here Comes (Forward Deployed) Everybody

https://worksonmymachine.ai/p/here-comes-forward-deployed-everybody
1•mooreds•20m ago•0 comments

Show HN: MailMark – Cold email tool where you own your domain and mailboxes

1•debasishbarai•20m ago•0 comments

Microsoft Mdash Beats a Key Mythos Benchmark

https://www.forbes.com/sites/timkeary/2026/05/15/microsoft-mdash-beats-a-key-mythos-benchmark-her...
1•dimastopel•20m ago•0 comments

Language Registries Are Unstable by Default – Andrew Nesbitt

https://nesbitt.io/2026/05/15/language-registries-are-unstable-by-default.html
1•abdelhousni•22m ago•0 comments

The Anti-Scroll Experiment

https://magifenta.com
1•magifenta•22m ago•0 comments

Towards approachable observability with wide events

https://marending.dev/notes/wide-events/
1•beingflo•22m ago•0 comments

Scientists "bottle the sun" with a liquid battery that stores solar energy

https://www.sciencedaily.com/releases/2026/05/260513221821.htm
5•ndr42•23m ago•0 comments

Ask HN: How are you maintaining codebases and managing AI context for them?

1•shambu2k•24m ago•0 comments

Software engineers are obsolete for now

https://idiallo.com/blog/everyone-is-better-than-you
1•firefoxd•26m ago•0 comments

University of Arizona students boo Eric Schmidt's AI cheerleading

https://www.theverge.com/ai-artificial-intelligence/932203/university-of-arizona-students-boo-eri...
2•latexr•27m ago•0 comments

Plasticity: A Modern NURBS Modeler

https://www.plasticity.xyz/
1•dtj1123•28m ago•0 comments

The AI water issue is fake

https://blog.andymasley.com/p/the-ai-water-issue-is-fake
63•shepherdjerred•30m ago•37 comments

Coal pollution is cutting solar power output, study finds

https://www.ox.ac.uk/news/2026-05-14-coal-pollution-is-cutting-solar-power-output-study-finds
1•geox•34m ago•0 comments