I also don’t think it’s a fair comparison. There’s nothing stopping me from loading the model into the memory of each Flask process (or some shmem), and getting the same performance or possibly better than the Postgres implementation, considering coroutines are being used in the Python case.
Calling this Postgres vs Flask is misleading at best. It’s more like “1 tier architecture vs 2 tier architecture”