![]() ![]() (ecto) lib/ecto/repo/queryable. (ecto_sql) lib/ecto/adapters/myxql/connection.ex:28: .execute/4 (db_connection) lib/db_connection.ex:591: DBConnection.execute/4 (db_connection) lib/db_connection.ex:1161: DBConnection.maybe_encode/4 You could also do an SQL count query beforehand and have a progress % while you’re deleting the records in batches.** (ArgumentError) parameters must be of length 3 for query %MyXQL.Query Thus, use Stream as intended and chew through work at your own pace. big binaries might stick around and render garbage collecting ineffective while still having a BEAM VM OS process taking a huge amount of RAM. If you suspect anything more than 5_000 records, usually it’s not at all recommended to try and get them into memory because e.g. You are right to be worried that Enum.to_list might crash the VM. Taking the latter part of your “Stream way” snippet and modifying it: ansaction(fn ->Įnd, timeout: :infinity) # or something like two hours? While I completely support recommendation and I feel the same – that PG should be able to handle a humongous DELETE command – I’ll still give you an alternative if you truly feel you want an iterable solution in Elixir. (EDIT: Sorry, just now saw you actually know about this.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |