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

Mattermost restricted access to old messages after 10000 limit is reached

https://github.com/mattermost/mattermost/issues/34271
1•xvilka•7m ago•0 comments

Package managers keep using Git as a database, it never works out

https://nesbitt.io/2025/12/24/package-managers-keep-using-git-as-a-database.html
1•WhyNotHugo•8m ago•0 comments

I managed to get that lost UNIX v4 tape running on my Android tablet

https://old.reddit.com/r/termux/comments/1pv7si4/i_managed_to_get_that_lost_unix_v4_tape_running/
1•sipofwater•9m ago•0 comments

GitHub – rcarmo/feed-summarizer: The feed summarizer that powers feeds.carmo.io

https://github.com/rcarmo/feed-summarizer
1•janandonly•9m ago•0 comments

Show HN: VideoReview – Collaborative video review for games and animation

https://github.com/KirisameMarisa/video-review
1•KirisameMarisa•12m ago•0 comments

Ask HN: Payload in Amazon "Shipped" Emails

1•krautburglar•13m ago•0 comments

Show HN: Mandate – treating AI agents like economic actors, not scripts

https://github.com/kashaf12/mandate
1•kashaf12•14m ago•0 comments

I don't trust NPM install, so I built dev

https://github.com/f0i/dev
2•f0i•19m ago•1 comments

Agent Skills

https://github.com/skillmatic-ai/awesome-agent-skills
4•dergalem•23m ago•0 comments

Waymo Is Working on a Gemini AI Assistant. Here's the System Prompt

https://wongmjane.com/blog/waymo-gemini
1•kerim-ca•24m ago•0 comments

Ask HN: Share your favorite Christmas gimmicks

2•jFriedensreich•25m ago•0 comments

Exposing Honey's Evil Business Model [video]

https://www.youtube.com/watch?v=wwB3FmbcC88
1•echan00•25m ago•0 comments

Show HN: One AI API for word-accurate transcription, translation, and export

https://www.transcripthq.io/
1•ssreenithin•25m ago•0 comments

Show HN: Quintel, a Rule-Discovery Game

https://eternaldawn.itch.io/quintel
1•MageOfTheEast•25m ago•0 comments

How to Help Santa Claus Concurrently

https://wyounas.github.io/puzzles/concurrency/2025/12/23/how-to-help-santa-claus-concurrently/
2•simplegeek•27m ago•0 comments

Line scan camera image processing

https://daniel.lawrence.lu/blog/2025-09-21-line-scan-camera-image-processing/
1•vasco•29m ago•0 comments

How we solved for Cloudflare and Azure outages

https://thesidedish.flipdish.com/flipdish-shipping-forecast-multiple-clouds-with-a-chance-of-seve...
2•flibble•29m ago•0 comments

Ingestr: CLI tool to copy data between any databases with a single command

https://github.com/bruin-data/ingestr
2•saikatsg•32m ago•0 comments

We invited a man into our home at Christmas and he stayed with us for 45 years

https://www.bbc.co.uk/news/articles/cdxwllqz1l0o
39•rajeshrajappan•36m ago•2 comments

Agent-Skills-for-Context-Engineering

https://github.com/muratcankoylan/Agent-Skills-for-Context-Engineering
3•kim0•37m ago•0 comments

Good Morning to Those at Work

3•sandworm101•45m ago•0 comments

Extreme Ironing

https://en.wikipedia.org/wiki/Extreme_ironing
2•m4khno•46m ago•0 comments

Reflections on building internal tools after AI changed the workflow

1•kinj28•49m ago•0 comments

Indian rocket launches record-breaking BlueBird 6 smartphone satellite to orbit

https://www.space.com/space-exploration/launches-spacecraft/indian-rocket-launch-bluebird-6-satel...
1•saikatsg•53m ago•0 comments

Download Python Today

https://files.catbox.moe/taze7f.jpg
1•lihaciudaniel2•56m ago•0 comments

Contributing to Debezium: Fixing Logical Replication at Scale

https://engineering.zalando.com/posts/2025/12/contributing-to-debezium.html
2•saikatsg•58m ago•0 comments

Best practices for long-run LED strip installs (20–50M) to avoid flicker?

1•emmasuntech•1h ago•0 comments

Gluetun v3.41.0 Release – The Ranting Section

https://www.youtube.com/watch?v=SSkGpys40ck
1•FeelingGood•1h ago•0 comments

Prompts.chat: the social platform for AI prompts

https://prompts.chat
1•fka•1h ago•0 comments

Cursor UI is built with SolidJS

https://old.reddit.com/r/solidjs/comments/1puoifc/cursor_ui_is_built_with_solidjs/
2•itayadler•1h ago•0 comments