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•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?

I built a Discord status for Claude Code

https://www.npmjs.com/package/vibecoder-discord-presence
2•yunexx•2m ago•0 comments

1982 World Championship Double Decker Bus Racing (1982) [video]

https://www.youtube.com/watch?v=7QFhuunZH2E
1•austinallegro•3m ago•0 comments

Try out my version of 1M checkboxes

https://joeheyming.github.io/checkboxes/
1•joeheyming•3m ago•1 comments

Agentic AI solved coding and exposed every other problem in SE

https://venturebeat.com/technology/agentic-ai-solved-coding-and-exposed-every-other-problem-in-so...
1•msolujic•4m ago•0 comments

China has approved the first invasive brain-computer chip

https://www.technologyreview.com/2026/06/01/1138133/china-world-first-brain-chip/
1•sudo_cowsay•7m ago•0 comments

We May Be Entering a Second Axial Age

https://www.noemamag.com/we-may-be-entering-a-second-axial-age/
1•simonebrunozzi•9m ago•0 comments

AI friends too cheap to meter

https://jasmi.news/p/ai-friends
1•simonebrunozzi•13m ago•0 comments

Oxford Uni student data pwned yet again, this time via career platform breach

https://www.theregister.com/security/2026/06/06/oxford-university-data-pwned-again-by-career-plat...
3•Bender•16m ago•0 comments

Show HN: A List of AI Neolabs

https://neolabs-7o2.pages.dev/
2•warthog•16m ago•0 comments

Ask HN: I made an image watermarking tool. What are the issues open-sourcing it?

1•minimaxir•16m ago•0 comments

UK exam watchdog frets over smart specs turning GCSEs into Google searches

https://www.theregister.com/personal-tech/2026/06/07/uk-exam-watchdog-frets-over-smart-specs-turn...
1•Bender•17m ago•0 comments

Stronger Search Architectures Can Substitute for Larger LLMs

https://ttanv.github.io/levi/
1•ttanv•17m ago•0 comments

Do GLP-1 pills work as well as injections? Here's what studies show

https://ktla.com/news/nationworld/do-glp-1-pills-work-as-well-as-injections-heres-what-studies-sh...
1•Bender•18m ago•0 comments

It doesn't always have to be Linux [video]

https://media.ccc.de/v/gpn24-611-it-doesn-t-always-have-to-be-linux-an-intro-to-freebsd
2•birdculture•19m ago•0 comments

Should we ditch the idea of three meals a day?

https://www.theguardian.com/books/2026/jun/07/should-we-ditch-the-idea-of-three-meals-a-day
1•homarp•19m ago•1 comments

Ask HN: Debugging failure in large interconnected back end systems

1•Ifedayo_s•23m ago•0 comments

Quantum Information as Everything

https://vlatkovedral.substack.com/p/quantum-information-as-everything
1•ljosifov•25m ago•0 comments

Programmable artificial RNA condensates in mammalian cells

https://www.nature.com/articles/s41565-026-02164-7
1•PaulHoule•26m ago•0 comments

Why I care so much about energy per token

https://ziraph.com/blog/energy-per-token-vanity-sanity-reality
1•ABS•27m ago•0 comments

The Read Model Zoo: Projections Beyond Tables

https://docs.eventsourcingdb.io/blog/2026/06/08/the-read-model-zoo-projections-beyond-tables/
1•goloroden•27m ago•0 comments

Ideogram 4.0 Technical Details: Open model at the forefront of design

https://ideogram.ai/blog/ideogram-4.0/
1•simonpure•27m ago•0 comments

No Model Will Save Us: Pope Leo, the Miserostat, and AI's Woke Coders

https://www.wmbriggs.com/post/61049/
2•B1FF_PSUVM•29m ago•0 comments

Billions spent and hypothetical returns: the AI boom explained with six charts

https://www.theguardian.com/technology/2026/jun/07/billions-spent-hypothetical-returns-the-ai-boo...
5•billybuckwheat•29m ago•0 comments

ChatGPT app hits 1B monthly active users in record time

https://www.reuters.com/technology/chatgpt-app-hits-1-billion-monthly-active-users-record-time-da...
1•geox•32m ago•0 comments

Why isn't the U.S. better at soccer?

https://www.natesilver.net/p/why-isnt-the-us-better-at-soccer
17•7777777phil•36m ago•10 comments

Show HN: CodeSage Pro – an AI copilot that reads the problem on the page

https://chromewebstore.google.com/detail/codesage-pro-—-universal/cbkkghdedpjamcicmnfpihehmgjemmhi
1•rsingh867•37m ago•0 comments

When robots take over jobs, who decides what they do?

https://lorenzopieri.com/robotic_commons/
2•lorepieri•38m ago•0 comments

Ask HN: What is happening with the Meta Ads dashboard?

1•ramon156•40m ago•0 comments

Iran says staff blocked from entering US after players given World Cup visas

https://www.bbc.com/news/articles/cy8286nqz87o
2•root-parent•41m ago•0 comments

After empty promises, string theory finds new uses

https://www.science.org/content/article/after-empty-promises-string-theory-finds-new-uses
2•tcp_handshaker•43m ago•0 comments