From 37cd17f761127b83c7c58e1a5848cdae7646514b Mon Sep 17 00:00:00 2001 From: Ben Wilson Date: Mon, 14 Aug 2023 12:51:54 -0400 Subject: [PATCH] don't lateral join just because we have order_bys --- lib/dataloader/ecto.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dataloader/ecto.ex b/lib/dataloader/ecto.ex index 0db0570..33406b6 100644 --- a/lib/dataloader/ecto.ex +++ b/lib/dataloader/ecto.ex @@ -695,7 +695,7 @@ if Code.ensure_loaded?(Ecto) do records = records |> Enum.map(&Map.put(&1, field, empty)) results = - if query.limit || query.offset || Enum.any?(query.order_bys) do + if query.limit || query.offset do records |> preload_lateral(field, query, source.repo, repo_opts) else