logoalt Hacker News

tptacekyesterday at 5:21 PM7 repliesview on HN

"Idle cost is that one lightweight SELECT per millisecond per database — no page-cache pressure, no writer-lock contention, no kernel file watcher in the mix."

I think (respectfully) the LLM that probably wrote this overshot the mark here because busy-polling a select does not actually sound better to me than a "kernel file watcher".


Replies

felooboolooombayesterday at 5:41 PM

"one lightweight SELECT per millisecond"

This reminds me of the teenager who told her dad that she was just a tiny little bit pregnant.

russellthehippoyesterday at 9:47 PM

Respectfully (thanks haha) - yeah probably right. Original intent was to use inotify type thing but i avoided per-platform differences at the outset. this was definitely a for fun project that blew up unintentionally and am working to harden/improve.

Love Fly.

8noteyesterday at 8:41 PM

to me it sounds like they asked it to not make a kernel file watcher, and now it writes that into every comment everywhere, despite not even being in the implementation

show 1 reply
ncrucesyesterday at 5:52 PM

If you're not making any changes to the database, does the SELECT "kill" you?

And if you are making changes, don't you have to poll regardless after the file watcher wakes you?

For WAL mode, SQLite can probably satisfy this query just by inspecting some shared memory. But it is busy waiting, sure.

show 2 replies
d1lyesterday at 5:49 PM

Yeah, I had the same instinct - this feels very much like a "nice idea" but the execution falls short. I mean - busily banging on sqlite like this? Shit at that point just use Redis.

show 3 replies
paulddraperyesterday at 8:48 PM

> one lightweight SELECT per millisecond

For the low, low cost of $1 per minute, you can also lease a supercar.

djdillonyesterday at 5:46 PM

[flagged]