News for hackers. Stuff that matters.
Re:Understanding N + 1 queries problem by drowsspa on Monday January 02, 2023 @03:21PM (#34223121)
You're still trading O(1) by O(N)... SQLite still has to read from the disk, it's still multiple orders of magnitude more expensive than a memory lookup.
Re:Understanding N + 1 queries problem by hinkley on Monday January 02, 2023 @04:29PM (#34223925)
On the one hand the individual reads will result in less blocking of write operations. On the other the read consistency behavior of the system changes by interlacing writes into the middle of your query.
Re:Understanding N + 1 queries problem by hgsgm on Monday January 02, 2023 @06:52PM (#34225452)
You can cache the database or part of it in memory.
Re:Understanding N + 1 queries problem by drowsspa on Monday January 02, 2023 @08:01PM (#34226115)
Honestly, these workarounds to avoid doing a better architecture or to mask algorithmic complexity just come back around you to byte you.
Re:Understanding N + 1 queries problem by ilyt on Tuesday January 03, 2023 @09:53AM (#34232074)
The key method here is not being in the project when the consequences arrive