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

Show HN: AgentCash – access 280 paid APIs with no API keys

https://agentcash.dev
1•OG_BME•53s ago•0 comments

Expo Agent (Beta) [video]

https://www.youtube.com/watch?v=3yyy32R0s2k
1•zwilderrr•1m ago•0 comments

From Braun T3 to Apple's iPod

https://drams.framer.website/journal/from-braun-t3-to-apples-ipod
1•corpano•1m ago•0 comments

AI boosts cancer detection rates by 10% and cuts healthcare workload by 30%

https://www.abdn.ac.uk/news/25244/
1•giuliomagnifico•2m ago•0 comments

I built a programming language using Claude Code

https://ankursethi.com/blog/programming-language-claude-code/
2•GeneralMaximus•2m ago•0 comments

The Physics of Squeaking Sneakers

https://arstechnica.com/science/2026/02/the-physics-of-squeaking-sneakers/
2•PaulHoule•3m ago•0 comments

Smarter, Faster, Personal: The New Google Workspace

https://workspace.google.com/blog/product-announcements/reimagining-content-creation
1•alokDT•3m ago•0 comments

Ideology, not science, drove the global prohibition of psychedelics

https://www.psypost.org/new-analysis-shows-ideology-not-science-drove-the-global-prohibition-of-p...
1•robtherobber•4m ago•0 comments

10x Is the New Floor

https://writing.nikunjk.com/p/10x-is-the-new-floor
1•vinhnx•4m ago•0 comments

White men will have 'fewer board seats' in future, says UK diversity chair

https://www.ft.com/content/2ef678ea-843c-45a1-abec-f81f48e7b8d2
1•pretext•4m ago•0 comments

Teaching LLMs to reason like Bayesians

https://research.google/blog/teaching-llms-to-reason-like-bayesians/
1•vinhnx•4m ago•0 comments

Studio Display XDR: Technology Overview [pdf]

https://www.apple.com/studio-display-xdr/pdf/Studio_Display_XDR_Technology_Overview_White_Paper.pdf
1•tosh•4m ago•0 comments

IDs+ Protocol: Solving the CJK Tokenization 'Byte-Premium' in LLMs

https://github.com/oruc001/IDS-Plus-Protocol
1•oruc001•4m ago•0 comments

How are you using local LLMs for code? (esp. security/IP protection)

1•antipaul•5m ago•0 comments

The Movie Buffs Who Track Film Profits as If They Work in Hollywood

https://www.wsj.com/arts-culture/film/fans-tracking-box-office-results-numbers-a18e12ef
1•sonabinu•6m ago•0 comments

Mira Murati's Thinking Machines strikes multibillion chip deal with Nvidia

https://www.ft.com/content/a8853057-c0a3-46f6-817f-7a23e79ea4e2
1•pretext•6m ago•0 comments

Abusing .arpa, the TLD that isn't supposed to host anything

https://www.infoblox.com/blog/threat-intelligence/abusing-arpa-the-tld-that-isnt-supposed-to-host...
1•birdculture•7m ago•0 comments

Are AI Tools Ready to Answer Patients' Questions About Their Medical Care?

https://jamanetwork.com/journals/jama/fullarticle/2846269
1•geox•8m ago•0 comments

Show HN: StateSurface – server-owned state and NDJSON streaming for MPA pages

https://github.com/superlucky84/state-surface
1•superlucky84•9m ago•1 comments

IronDiff – Network Config Backup and Analysis

2•MattRos•10m ago•0 comments

Ruby Users Forum February–March Update

https://www.rubyforum.org/t/monthly-update-february-wrap-up-march-preview/177
1•todsacerdoti•11m ago•0 comments

Amazon Wins Court Order Blocking Perplexity AI Shopping Bots

https://www.bloomberg.com/news/articles/2026-03-10/amazon-wins-court-order-blocking-perplexity-s-...
1•juokaz•12m ago•0 comments

Fooling AI Agents: Web-Based Indirect Prompt Injection Observed in the Wild

https://unit42.paloaltonetworks.com/ai-agent-prompt-injection/
3•tcbrah•12m ago•0 comments

Precision Learning Has the Potential to Do What Personalized Learning Could Not

https://www.the74million.org/article/precision-learning-has-the-potential-to-do-what-personalized...
1•jyunwai•12m ago•0 comments

Towards "Let's Encrypt" for Document Signing

https://documenso.com/blog/building-documenso-part-3---aes-qes-qtsp
1•ElTimuro•13m ago•1 comments

Amazon asks senior engineers to address issues created by 'AI assisted changes'

https://www.tomshardware.com/tech-industry/artificial-intelligence/amazon-calls-engineers-to-addr...
3•cdrnsf•13m ago•1 comments

Tesla FSD drives through railroad crossing barriers in viral video

https://electrek.co/2026/03/09/tesla-fsd-drives-through-railroad-crossing-barriers-viral-video/
1•nixass•13m ago•0 comments

Why on-device agentic AI can't keep up

https://martinalderson.com/posts/why-on-device-agentic-ai-cant-keep-up/
1•devy•14m ago•0 comments

Rust Coreutils 0.7 Released with Many Performance Optimizations

https://www.phoronix.com/news/Rust-Coreutils-uutils-0.7
1•Bender•14m ago•0 comments

$3 ChromeOS Flex stick will revive old and outdated computers

https://9to5google.com/2026/03/10/this-3-chromeos-stick-will-revive-old-and-outdated-computers/
2•pentagrama•15m ago•0 comments