It seems that Repo.stream will not actually stream the query results. Instead the full resultset is returned and only then transformed into a stream.
For example the following code will give a timeout error:
defquerydoimportEcto.Queryquery=fromrinTable,select: rRepo.transactionfn->Repo.stream(query)|>Stream.map(&IO.inspect/1)|>Stream.run()endend
Running the same code against a Postgresql database will immediately start printing results as expected.
It seems that
Repo.streamwill not actually stream the query results. Instead the full resultset is returned and only then transformed into a stream.For example the following code will give a timeout error:
Running the same code against a Postgresql database will immediately start printing results as expected.