This type of performance issue (where chained SQL services take too long) is usually a result of contention at the JDBC connection layer.
By default the Database connector you're using for your custom queries has a default of 5 connections. Each statement you're executing uses one of these connections. The delay is usually caused by the last statement having to wait for a connection to the DB while the other ones are active.
You can check the number of available connections in the Configuration section for your DB thing. For context, the platform uses 100 connections to the DB and we typically set our JDBC connectors to 100 as well if this is going to be a high-volume operation (and this will be since it runs from mashups)

This is configuration issue is not always the case, but it's definitely something to rule out first. If the issue is not a bottleneck at the connection layer we'll need additional diagnostics. Specifically, you may want to install the SupportTools extension and capture thread dumps while stressing this mashup (i.e. launch 10-20 mashups in parallel). The tool is available here and you can post any resulting stacktrace files in this thread (zipped) or open a case so I can have a look at them: https://marketplace.ptc.com/apps/196419/support-tools-for-tw-66#!overview