When the joins are constructed in Tableau, then Tableau is able to do join culling in some situations, which can improve performance. Tableau will wrap custom SQL queries with additional SQL code, but it will never modify your custom SQL query. That being said, you can create and join several custom SQL queries in Tableau to get the best of both worlds.
In my experience, it is faster to write the filter into a WHERE clause rather than use Tableau filters. I am joining several custom SQL queries tho, so this essentially allows me to filter the data before Tableau attempts to join it. If you are comparing filtering one custom SQL query in the WHERE clause versus adding a data source filter in Tableau then there might not be much difference. A data source filter means that Tableau is adding a WHERE clause outside of your custom SQL query.
If you ever want to get really nitty-gritty with performance, you can see exactly what queries Tableau is sending to your database: Viewing Underlying SQL Queries | Tableau Software
Hope this helps!
Thanks for that - that's really helpful info and gives a very clear answer!
1 of 1 people found this helpful
Incidentally, one thing I have learnt is that if you are working with extracts, as opposed to live data, and you put the filter on the custom SQL statement then the size of the extract will be affected. If you get Tableau to do the filtering then it appears to extract all of the data and only apply the filter when you view the data - so the extract size is much larger.