Ecto high database time with Cloud SQL

If you show us the explain plan it would help seeing what’s happening at the db level. You can do so using this function:

Using the anlayze: true opt would provide the best info.