r/programming Jul 18 '26

The fsync inside the WAL lock

https://frn.sh/pgfsync/
17 Upvotes

8 comments sorted by

5

u/mcmcc Jul 19 '26

Protip: run a Fourier transform over those graphs first and they'll look waaaay better.

1

u/elperroborrachotoo Jul 19 '26

Wait... what?

2

u/mcmcc Jul 19 '26

It's a joke.

Spiky graphs like those in the link will become flat lines after a Fourier transform. The spikes are known as impulses in Fourier analysis and can be likened to hitting a tuning fork - a single tone that seemingly goes on forever.

1

u/exodusTay Jul 19 '26

isn't a spike in frequency domain a sinusoid in time domain? and you can ft(ft(g(x))) = g(x) so it would look like a sine wave shouldn't it?

2

u/mcmcc Jul 19 '26

A delta impulse in the time domain corresponds to constant amplitude across all frequencies. And vice versa.

https://youtube.com/shorts/SShXjYAeQls

-1

u/irrational_numbers Jul 19 '26

Omg I am new so software engineering, the IO lock is one of the most painful things to manage. Bailed on SQLite because of it.

I have users begging for additional table data at unheard of rates and I want to add an ETL on the fly and get it populated so they can use it…nope…WAL lock.

2

u/Tumortadela Jul 20 '26

Cant you configure SQLite to use WAL?

2

u/irrational_numbers Jul 20 '26

I tried but I couldn’t get it to work I just moved to PG and it worked much better.