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

Microsoft's 2026 Global ML Building Footprints

https://tech.marksblogg.com/ms-buildings-2026.html
1•marklit•30s ago•0 comments

Alert: Sicarii Ransomware Encryption Key Handling Defect

https://www.halcyon.ai/ransomware-alerts/alert-sicarii-ransomware-encryption-key-handling-defect
1•croes•4m ago•0 comments

Testing Agent Skills Systematically with Evals

https://developers.openai.com/blog/eval-skills/
1•tosh•5m ago•0 comments

The era of GenAI started. New short essay

http://codrutapoenaru.blogspot.com/2026/01/the-era-of-genai-started_29.html
1•pcodruta•7m ago•0 comments

Charlie Munger mental model ChatGPT Prompt

https://tools.eq4c.com/persona-prompts/chatgpt-prompt-the-munger-mind-multidisciplinary-decision-...
2•eq4c•10m ago•0 comments

Atlas Obscura Turns First Annual Profit in 16-Year History

https://www.adweek.com/media/atlas-obscura-first-annual-profit/
1•giuliomagnifico•11m ago•0 comments

Bull Is Back

https://www.bull.com/en/bull-press-releases/brand-launch
1•rdg42•12m ago•0 comments

How the NoteGPT AI Essay Writer Transforms Your Academic Workflow

https://notegpt.io/ai-essay-writer
1•Gumenchong•13m ago•1 comments

Semantic Chaining: A New Image Jailbreak Attack

https://neuraltrust.ai/blog/semantic-chaining
1•Joan_Vendrell•24m ago•1 comments

Show HN: Lutum Veritas – open-source deep research engine

https://github.com/IamLumae/Project-Lutum-Veritas
1•LutumVeritas•25m ago•0 comments

Show HN: Indx.sh – Directory of AI coding rules, MCP servers, and tool

https://indx.sh
1•micronink•26m ago•0 comments

Ezs3.net to share S3 access in your team

https://ezs3.net/
1•weddpros•27m ago•0 comments

The PDF Library TypeScript Deserves

https://documenso.com/blog/introducing-libpdf-the-pdf-library-typescript-deserves
1•cmpit•37m ago•0 comments

Show HN: ShiftPlus – Save and restore your macOS workspace in one click

https://shiftplus.app/
1•nghialuong•37m ago•0 comments

Show HN: PadlessBox – Party Games Using Phones as Controllers

https://padlessbox.com/
1•b4rtaz__•38m ago•1 comments

FFmpeg is not happy with AI generated patches sent by AMD

https://twitter.com/FFmpeg/status/2016981960015437994
6•itvision•39m ago•1 comments

Ask HN: AI progress feels unusually fast- where do you think this is heading?

1•learningnotes•41m ago•0 comments

Show HN: Find the Thing on the Web

https://www.xelochat.com
1•jozinko•41m ago•0 comments

LoudCull – Agentless multi-cloud GPU zombie killer (Python/Terraform)

https://github.com/daretechie/CommitVigil
1•dhrey112•42m ago•1 comments

RAG Gone Wrong: The 7 Most Common Mistakes (and How to Avoid Them)

https://www.kapa.ai/blog/rag-gone-wrong-the-7-most-common-mistakes-and-how-to-avoid-them
1•taubek•42m ago•0 comments

Building Modern Databases with the FDAP Stack

https://gotopia.tech/articles/412/building-modern-databases-with-the-fdap-stack
1•mpweiher•44m ago•0 comments

Logical Intelligence (Yann LeCun linked startup, piloting an Energy Based Model)

https://logicalintelligence.com/
1•helloplanets•45m ago•0 comments

InfronAI

https://infron.ai/
1•Evan233•46m ago•0 comments

Mark Papermaster, AMD CTO / Ian Interviews #47 [video]

https://www.youtube.com/watch?v=yUBzu7oTTDo
1•mariuz•48m ago•0 comments

Scottrade – Fortune Favors the Brave

https://scottrade.net/
1•reieicucv•50m ago•0 comments

Show HN: Trending-in-Artificial-Intelligence

https://github.com/legendaryabhi/Trending-in-Artificial-Intelligence
1•abhinav77777•51m ago•0 comments

Supporting the Foundations: Announcing the 2025 Quansight OSS Fund Recipients

https://labs.quansight.org/blog/oss-fund-2025
1•lumpa•52m ago•0 comments

The Connection Machine CM-1 "Feynman" T-shirt

https://tamikothiel.com/cm/cm-tshirt.html
1•tosh•53m ago•0 comments

AI-generated news should carry 'nutrition' labels, thinktank says

https://www.theguardian.com/technology/2026/jan/30/ai-generated-news-should-carry-nutrition-label...
1•chrisjj•54m ago•0 comments

I built an MCP server to explore Epstein's emails. Here's what I learned

https://github.com/Gioppix/epstein-email-explorer-mcp/blob/main/REVIEW.md
1•Gioppix•58m ago•0 comments