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?

The Download: inside OpenAI's Hugging Face hack, and a new EV takes on the US

https://www.technologyreview.com/2026/08/27/1143033/the-download-openai-hugging-face-hack-slate-t...
1•joozio•1m ago•0 comments

How LibreOffice Is Funded

https://blog.documentfoundation.org/blog/2026/08/28/how-libreoffice-is-funded/
1•mmarian•2m ago•0 comments

Show HN: SubSmith – Turn your own videos into language-learning material

https://subsmith.app
1•IbrahimF96•3m ago•0 comments

Are we just a couple steps away from a runaway AI?

https://andlukyane.com/blog/runaway-ai
2•Artgor•5m ago•0 comments

Pentagon's blacklisting of Anthropic was unlawful, US judge rules

https://www.theguardian.com/technology/2026/aug/28/us-court-rules-pentagon-anthropic-ban-illegal-...
1•chanux•6m ago•0 comments

Show HN: Jack the Snipper – Paste HTML or rich text, get clean plain text back

https://snipper.kreisvier.ch/
1•shipcraft•6m ago•0 comments

How Much of the Internet Is Written with AI?

https://www.pewresearch.org/data-labs/2026/08/20/how-much-of-the-internet-is-written-with-ai/
1•thehoff•9m ago•0 comments

Show HN: Tavi – A pet health tracker that works offline, with no account

https://tavi.pet/
1•abdghani•16m ago•0 comments

Panic passes Trump tariff refunds back to the Playdate customers who paid them

https://help.play.date/orders/tariffs/
1•huhtenberg•17m ago•0 comments

Show HN: Live football data. Clear patterns. Smart bets

https://valuestats.com/
1•not_wowinter14•17m ago•0 comments

LLM Cliché Highlighter

https://tools.simonwillison.net/llm-cliche-highlighter
2•rzk•17m ago•0 comments

Kojugate: Graph-native multiphysics simulation engine and digital twin

https://www.konjugate.com/
1•zenin•24m ago•1 comments

The Language of Headlines

https://daily.jstor.org/how-does-the-language-of-headlines-work-the-answer-may-surprise-you/
1•bookofjoe•25m ago•0 comments

One of east coast's largest datacenters accused of 'violating federal law'

https://www.theguardian.com/environment/2026/aug/27/new-jersey-vineland-datacenter-permits
1•sseagull•26m ago•0 comments

Scanning 170M lines of code: 44% of AI-found critical vulnerabilities were FP

https://corporate.comcast.com/stories/exploratory-vs-deterministic-assessments
1•officialhocc•26m ago•0 comments

Show HN: MCP server that drives the browser you are signed into

https://github.com/t3ratech/mcp-session-bridge
2•tkaviya•27m ago•0 comments

Assessly

https://assessly.app
1•manytduarte•28m ago•0 comments

LLMs are multi-layered user interfaces

https://www.gtothesquare.com/llms-the-multi-layered-user-interface
1•gtothesquare•33m ago•0 comments

Performing Digital Surgery to Fix MIDIs for My Hardware (My Post Was Wrong)

https://www.mistys-internet.website/blog/blog/2026/08/25/how-i-fixed-an-mt-32-midi-soundtrack-for...
2•robin_reala•39m ago•0 comments

Show HN: Public MCP for Greek price comparison (no API key)

https://www.bestprice.gr/mcp
1•phaistonian•40m ago•0 comments

Quest for eternal dock on Wayland – lambdock (C and GTK4 and Lisp Guile Scheme)

https://jointhefreeworld.org/blog/articles/gnu-linux/quest-for-eternal-dock/index.html
1•jjba23•44m ago•0 comments

Intel Linux Driver Orphaned for Limiting RF Exposure to Humans

https://www.phoronix.com/news/Intel-Linux-SAR-Driver-Orphaned
3•rbanffy•45m ago•0 comments

Making Your Data Ready for Agentic AI

https://martinfowler.com/articles/making-data-ready-for-agentic-ai.html
1•javaeeeee•46m ago•0 comments

AI and Cognitive Science Redefine Knowledge Retention

https://www.technology.org/2026/08/28/how-artificial-intelligence-and-cognitive-science-are-redef...
1•aledevv•48m ago•0 comments

Show HN: Less Paper – native iOS/iPadOS client for Paperless-ngx

https://github.com/plu/less-paper
1•jplunien•48m ago•0 comments

Visa USA Interchange Reimbursement Fees [pdf]

https://usa.visa.com/content/dam/VCOM/download/merchants/visa-usa-interchange-reimbursement-fees.pdf
2•simonebrunozzi•50m ago•0 comments

IBM's new Granite 4.2 models ride the wave of interest in local LLMs

https://arstechnica.com/ai/2026/08/ibms-new-granite-4-2-models-ride-the-wave-of-interest-in-local...
1•rbanffy•53m ago•0 comments

Gilad Bracha on managing dependencies in Smalltalk

https://twitter.com/Gilad_Bracha/status/2093106007618834451
1•tosh•54m ago•0 comments

Difference-in-Differences on a Censored Rating Scale Can Manufacture an Effect

https://arxiv.org/abs/2608.27309
2•sbulaev•55m ago•0 comments

"they are illegal labor practices" Harmeet K. Dhillon comments on H1B abuse

https://twitter.com/AAGDhillon/status/2093135087428878720
3•AnkitGuptaTruth•56m ago•0 comments