1 of 1 people found this helpful
It depends on numerous factors. Usually, from a maintainability perspective, I try to steer away from custom SQL. I would rather put the custom SQL in a view on the DB.
If you do a cross-database join, two separate queries are sent to each source, so keep that in mind. The more joins you have in Tableau, the bigger the possibility of deprecated performance becomes, but the best will be to test it in the environment you are working in. I prefer to do views in the DB, as this makes maintenance for me and the DB team easier.
You can also have a look at Create Efficient Joins and Blends
Hope this helps!