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?

Roundtables: Can AI Learn to Understand the World?

https://www.technologyreview.com/2026/05/21/1137756/roundtables-can-ai-learn-to-understand-the-wo...
1•joozio•3m ago•0 comments

Are no-frills utility knives the underrated sweet spot for EDC?

https://www.paragon-knives.com/
1•bgzlsxaz•4m ago•0 comments

Technology Today Influence Us

https://negativestarinnovators.com/
1•pizzly•5m ago•1 comments

Pokélike

https://pokelike.xyz/
1•Areibman•8m ago•0 comments

The humiliation of finding secret Israeli bases in Iraq

https://responsiblestatecraft.org/israeli-bases-iraq/
1•KoftaBob•8m ago•0 comments

Report Alleges Chinese Influence Behind AI Data Center Pushback in the U.S.

https://dominotheory.com/report-alleges-chinese-influence-behind-the-ai-data-center-pushback-in-t...
2•ironyman•10m ago•0 comments

Picovoice Discointinues Free Tier

https://console.picovoice.ai/
1•vghaisas•11m ago•1 comments

Duster: Tor Service Attribution Based on Flow Watermarking with Track Hiding [pdf]

https://www.usenix.org/system/files/raid2019-iacovazzi.pdf
1•rbanffy•18m ago•0 comments

Can a Mouse Survive a Fall from a High-Rise?

https://johnmjennings.com/can-a-mouse-survive-a-fall-from-a-high-rise/
1•thunderbong•21m ago•0 comments

Attributing Northvolt's Bankruptcy

https://www.globaltimes.cn/page/202602/1354840.shtml
1•leonidasrup•22m ago•0 comments

Will Ever David Defeat Goliath? Epic vs. Apple

https://www.macrumors.com/2026/05/21/apple-supreme-court-epic-games-case/
1•enricotal•24m ago•0 comments

Pressure from Silicon Valley helped block Trump's expected order on AI

https://www.washingtonpost.com/politics/2026/05/22/last-minute-lobbying-by-tech-industry-official...
2•thm•25m ago•0 comments

POC for CVE-2026-46529 – RCE via PDF argv injection

https://github.com/N1et/CVE-2026-46529
1•zdkaster•28m ago•1 comments

AI may be inflationary before it becomes productive

https://www.axios.com/2026/04/23/ai-inflation-productivity-companies
1•latentframe•30m ago•0 comments

OMLX v0.3.9 Stable Merges Native MTP (Multi-Token Prediction)

https://github.com/jundot/omlx/releases/tag/v0.3.9
1•febed•31m ago•0 comments

QuantumAi Blockchain and Aethermind Update

https://qbc.network/blog/v121-four-validators-aether-on-gpu
1•BlockArtica•32m ago•1 comments

Should be illegal (but it's not)

https://zenodo.org/records/20338929
1•anasteciadunu•33m ago•0 comments

Sales and Dungeons: Thermal Printer Ttrpg Utility

https://sales-and-dungeons.app/
2•hyperific•36m ago•0 comments

Chinese authorities destroy villager's 10-storey Studio Ghibli-esque home

https://www.theguardian.com/world/2026/may/22/china-officials-destroy-ramshackle-10-storey-studio...
1•mykowebhn•36m ago•0 comments

Check DNS bind configuration with Sparrow and Python

https://sparky.sparrowhub.io/report/scc/29082#Report/
1•melezhik•41m ago•1 comments

A.I. Learns to Optimize Factorio Blueprints [video]

https://www.youtube.com/watch?v=mGOKKtIDNbk
1•bmn__•41m ago•0 comments

Preconditioning Vectors: Making Elasticsearch VectorDB BBQ Work for Every Vector

https://www.elastic.co/search-labs/blog/elasticsearch-bbq-preconditioning-vectors
1•eigenBasis•42m ago•0 comments

MathML

https://developer.mozilla.org/en-US/docs/Web/MathML
1•tosh•51m ago•1 comments

The cost of military deployments (and why Europe is running out of time)

https://vulpesetleo.substack.com/p/pulling-5000-troops-from-germany
1•hnsa•56m ago•0 comments

Fixing LLM Writing with Distribution Fine Tuning

https://rosmine.ai/2026/05/18/fixing-llm-writing-with-distribution-fine-tuning/
2•tosh•56m ago•0 comments

Samsung to distribute up to $26.6B to staff in AI-driven bonuses

https://www.tomshardware.com/tech-industry/big-tech/samsung-reportedly-set-to-distribute-up-to-us...
3•signa11•1h ago•2 comments

Repeated Header in a Next.js page using iframe and BBPress

1•Thompson_Li•1h ago•0 comments

Chapter House: A Complete Children's Library

https://chapter.house/
1•MrBuddyCasino•1h ago•0 comments

Full Stack Developer

2•shoaibcodes•1h ago•0 comments

Show HN: Sylph – the open-source company brain behind my YC startup

https://github.com/getnao/sylph
4•ClaireGz•1h ago•1 comments