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?

Zahada – most challenging riddles online

https://www.mcgov.co.uk/zahada.html
1•xkcd1963•1m ago•0 comments

Brotli on Nginx thread pools: ngx_mbrotli vs. ngx_brotli

https://m-compressors.github.io/2026/ngx-mbrotli-thread-pool-benchmarks/
1•Mnwa•5m ago•0 comments

Evaluating Memory Systems for AI Agents Is Harder Than It Looks

https://x.com/AgentMemoryL
1•IreneAI•5m ago•0 comments

A Non-Local, Retarded Extension of the Schrödinger Equation: QPM

https://figshare.com/articles/preprint/_p_dir_ltr_Quantum_Phase_Memory_and_Self-Coupled_Dynamics_...
1•kisnorbert•6m ago•0 comments

Show HN: Continue a ChatGPT/Claude/Gemini chat in another free AI at the limit

https://aifreetoday.com/us/transfer-chat/
1•kiterentev•11m ago•0 comments

Don't Yell at Your Agents

https://www.youtube.com/watch?v=VcIlkaI0mUk
1•claudiacsf•14m ago•0 comments

Information for Python users regarding eMudhra / emSign CA certificate security

https://discuss.python.org/t/information-for-python-users-regarding-emudhra-emsign-ca-certificate...
1•tosh•15m ago•0 comments

Palantir says it cannot shut off NATO AI systems

https://www.reuters.com/business/media-telecom/palantir-says-it-cannot-shut-off-nato-ai-system-eu...
1•doener•15m ago•1 comments

Tell HN: I unknowingly broke the PHP RCE embargo. I am sorry.

4•petecooper•16m ago•0 comments

The economics of all-you-can-eat buffets (2024)

https://thehustle.co/the-economics-of-all-you-can-eat-buffets
1•theanonymousone•16m ago•0 comments

I wrote a Windows runtime from scratch to run PC VR games on Apple Silicon

https://github.com/Ag3497120/VeRantyx
2•kofuudai•16m ago•0 comments

I Built an Interactive Sandbox to Learn Distributed Systems

https://shardcraft.dev/
1•galibi•19m ago•0 comments

What type of apartments are available at Rosemont Residency?

1•cemaljustime•22m ago•0 comments

Booking.com faces EU investigation over scams and hidden ads

https://www.courthousenews.com/booking-com-faces-eu-investigation-over-scams-and-hidden-ads/
1•hggh•24m ago•0 comments

AI-Assisted Product Discovery: How to Succeed and How to Fail

https://www.youtube.com/watch?v=gJ-rYxlkVPg
2•swolpers•25m ago•0 comments

Meta strikes deal with Zuckerberg to keep him in Calif. over billionaire tax

https://www.sfgate.com/tech/article/zuckerberg-billionaire-tax-22488181.php
1•doener•26m ago•0 comments

SketchUp Step Importer

https://github.com/eugenyh/SketchUp-Step-Importer
1•EugenyH•27m ago•0 comments

Show HN: ExplAIn, a free directory of compliance scores for AI tools

https://www.explain-ai.com
1•ezrabuenk•27m ago•1 comments

A smart patch that can measure your pulse without electronics

https://norwegianscitechnews.com/2026/10/a-smart-patch-that-can-measure-your-pulse-without-electr...
2•giuliomagnifico•29m ago•0 comments

Rules of Machine Learning (2017) [pdf]

http://martin.zinkevich.org/rules_of_ml/rules_of_ml.pdf
1•BenoitP•29m ago•0 comments

Vitest Dev Server Secret Leak (CVE-2026-112948)

https://github.com/advisories/GHSA-p458-7748-mcp3
2•mumairrana007•29m ago•0 comments

We built a document AI that reads but doesn't write

https://www.nutrient.io/blog/decision-model-for-documents/
1•marakiii•34m ago•0 comments

Manual guideline to download Office 365 mailbox to PST, EML, MSG and MBOX format

https://www.mailsdaddy.com/blogs/how-to-backup-office-365-mailbox-for-free/
1•somit0•35m ago•0 comments

Why does this chart just go down? 0 once again marks the spot

https://lapcatsoftware.com/articles/2026/10/7.html
1•latexr•35m ago•0 comments

RecursiveSI/Flint

https://huggingface.co/RecursiveSI/flint
1•mpweiher•36m ago•0 comments

AI vs. human therapist feedback in CBT: Randomized trial with deception design

https://doi.org/10.1016/j.invent.2026.101012
1•tobr•36m ago•1 comments

Ask HN: Who owns the copyright to code generated by an AI LLM?

2•roschdal•39m ago•0 comments

Arithmetic is an underrated world-modeling technology

https://www.lesswrong.com/posts/r2LojHBs3kriafZWi/arithmetic-is-an-underrated-world-modeling-tech...
1•amanverasia•40m ago•0 comments

Series of programming puzzles, designed to teach you about internationalization

https://i18n-puzzles.com/
1•amanverasia•41m ago•0 comments

Show HN: A ClubElo-style Elo dataset for MLS, 1996–present

https://github.com/philo92/mls-elo
1•PhiloPark•44m ago•0 comments