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: Compare Prices with SupplyFLare AI

https://www.supplyflare.com/
1•invar1ant•1m ago•0 comments

New version of DOOM on SNES with the help of RP2350

https://www.raspberrypi.com/news/play-a-new-version-of-doom-on-snes-with-the-help-of-rp2350/
1•tosh•1m ago•0 comments

Repeating the prompt increases non-reasoning LLM Perf

https://twitter.com/aakashgupta/status/2023998053737541636
1•MrBuddyCasino•3m ago•0 comments

Show HN: InStudio – Free Instagram toolkit with 10 creator tools

https://instudio.artboards.in//
1•sidduex•7m ago•0 comments

We still don't know why curling stones move the way they do

https://www.bbc.com/future/article/20260213-the-unexplained-physics-of-curling
1•neversaydie•7m ago•0 comments

Ask HN: Are we missing a middleware layer between LLM agents and the web?

1•AS_YC•7m ago•0 comments

Show HN: PowerBasilisk: Open x64 PowerBASIC in Rust generates LLVM

https://github.com/benstopics/powerbasilisk
2•benstopics•11m ago•1 comments

Show HN: QuizBuds – weekly team trivia inside Slack (feedback wanted)

https://quizbuds.app
1•sanilnz•11m ago•0 comments

New nickel-iron battery charges in seconds, endures 12,000 cycles for decades

https://techlifehub.com/2026/02/17/new-nickel-iron-battery-charges-in-seconds-endures-12000-cycle...
1•elisson22•14m ago•0 comments

Police arresting 1000 paedophiles a month across the UK

https://www.theguardian.com/uk-news/2026/feb/17/police-arresting-1000-paedophile-suspects-a-month...
1•azalemeth•14m ago•0 comments

Making of RP2040 Doom

https://kilograham.github.io/rp2040-doom/
2•tosh•18m ago•0 comments

OpenAI Claims DeepSeek Distilled US Models to Gain an Edge

https://www.bloomberg.com/news/articles/2026-02-12/openai-accuses-deepseek-of-distilling-us-model...
1•nsoonhui•19m ago•0 comments

Russian woman carried Ukraine team placard at Winter Olympics opening ceremony

https://www.theguardian.com/sport/2026/feb/17/russian-woman-carried-ukraine-team-placard-at-winte...
2•prmph•22m ago•0 comments

Ask HN: How are indie AI app builders monetizing in 2026 without killing UX?

1•axrisi•22m ago•1 comments

China's dancing robots: how worried should we be?

https://www.theguardian.com/world/2026/feb/18/china-dancing-humanoid-robots-festival-show
1•prmph•23m ago•0 comments

Ineffable Intelligence (Founder David Silver, ex Deepmind) Raises $1B Seed

https://www.ft.com/content/dffe72d0-4064-4412-8ebc-50198a30d40e
1•aanet•24m ago•0 comments

Show HN: Limpio – New Crypto Market Data Engine in Go (Redis and Timescale)

https://docs.limpioterminal.pro
2•arturstankevicz•24m ago•0 comments

arXivisual – Transform research papers into 3blue1brown style Manim animations

https://github.com/rajshah6/arXivisual
1•helloplanets•28m ago•0 comments

Show HN: SentryRF – A private, local-first Android app to detect hidden trackers

https://sentryrf.com/
2•vidoluc•29m ago•0 comments

Shigeru Ban on building cathedrals and quake shelters with paper

https://www.theguardian.com/artanddesign/2026/feb/17/shigeru-ban-architect-cathedrals-quake-shelt...
1•seanhunter•29m ago•0 comments

Apple developer account takes up to weeks to enroll

https://developer.apple.com/forums/thread/815713
2•throwaway423342•30m ago•1 comments

Air pollution may directly contribute to Alzheimers

https://theconversation.com/air-pollution-may-directly-contribute-to-alzheimers-disease-new-study...
2•lonelyasacloud•30m ago•2 comments

Index, Count, Offset, Size

https://tigerbeetle.com/blog/2026-02-16-index-count-offset-size/
1•ingve•31m ago•0 comments

After a fierce competition OpenAI hired Peter Steineberger

https://www.wsj.com/tech/ai/this-viral-ai-project-went-from-side-hustle-to-coveted-prize-in-three...
1•pretext•34m ago•0 comments

Chunyun – the largest annual human migration [video]

https://aeon.co/videos/chinese-new-year-is-a-stunning-spectacle-of-human-migration-in-3-billion-j...
1•hunglee2•39m ago•0 comments

Climber on trial for leaving girlfriend to die on Austria's highest mountain

https://www.bbc.com/news/articles/c5yv9plyjgpo
1•Stevvo•40m ago•0 comments

Show HN: SideDisplay – Turn Tesla screen into a wireless second monitor for Mac

https://sidedisplay.co/
1•maccraft•41m ago•0 comments

MineBench: LLM benchmark using voxel art

https://old.reddit.com/r/ClaudeAI/comments/1r7lphz/difference_between_sonnet_45_and_sonnet_46_on_a/
1•odie5533•46m ago•2 comments

Supply Chain Necromancy: Reborn Namespaces in JitPack Coordinates

https://labs.itresit.es/2026/02/18/supply-chain-necromancy-reborn-namespaces-in-jitpack-coordinates/
1•Yippee-Ki-Yay•47m ago•0 comments

Making music with MIDI just got a real boost in Windows 11

https://blogs.windows.com/windowsexperience/2026/02/17/making-music-with-midi-just-got-a-real-boo...
3•ingve•48m ago•0 comments