This suggestion might be going out on a limb… but have a look at this recent post:
Disable prepared statements for an individual query
I didn’t bother to research when prepared statements where introduced in ecto etc., but since this was such a large upgrade jump, maybe you’re being affected in a similar way and it’s adding up fast due to the shear volume of queries.
It’s a long shot, but the read and eventual outcome might prove educational either way