This small project (hopefully) demonstrates how running a particular query with the Query API multiple times ultimately slows down dramatically.
- Clone this project and go to the project's directory
- Run
mix do deps.get, ecto.create, ecto.migrate
- Seed the database (it may take over 5 minutes)
mix run priv/repo/seeds.exs
- Run the benchmarks with
mix run bench.exs
You should see the dsl
job slowing down at some point showing quite large deviation in the results, while
the sql
job has much more solid benchmark.