Each database interaction creates a separate database request if called from a Nanoflow in an online application. It is more efficient to do this from a microflow where possible in this case.
More details can be found in the Nanoflow documentation.
https://docs.mendix.com/refguide/nanoflows/#22-logic-where-no-connection-is-needed
I hope this helps.