Hello,
yes, we created indexes and they're very useful when you run the query on Mongodb... Running queries from Sql Server have no benefit at all.
I think the point is what Sql seems to do every time we run a query: uses the swap directory to download the dataset to be queried...
If I check the sys.external_data_sources table, we defined correctly the pushdown parameter (= ON), so the query activity should be beared by the Mongo dataserver ...
...I just found on the Microsoft manuals that pushdown vs Mongodb community dataserver is not active in many situations:
If the join can be done at the external data source, this reduces the amount of data movement and improves the query's performance. Without join pushdown, the data from the tables to be joined must be brought locally into tempdb, then joined.
Maybe this could be the answer...
Luca