Comments don't matter as they will be ignored / not passed into Teradata.
In terms of what is faster, I usually opt for the db view option and the reason why has to do with db optimizer access. When using custom SQL, the SQL is nested inside a wrapper such as select * from (select a,b,c from Table) TableauSQL and it doesn't have as much likelihood of being optimized by either Tableau or the database itself because the core SQL is nested. The one exception to why you may want to use custom sql is if you are passing parameters in from your dashboard to the sql, then sometimes custom sql is an option. The best option though is if you can draw the joins within the Tableau data dialog window, this provides the most flexibility and usually the best performance.
Interesting and do you have any information on volatile tables as well ?
What do you mean by volatile tables?
For Teradata, we create a temporary table by using CREATE VOLATILE TABLE [Temp Table Name]:
CREATE VOLATILE TABLE ctedemo AS (WITH RECURSIVE OrganizationChart (Id, Name, Level, ManagerID) AS (
Id, Name, 0 as Level, ManagerID
ManagerID IS NULL
emp.ID, emp.Name, Level + 1, emp.ManagerID
FROM TEST.Employees emp
INNER JOIN OrganizationChart d ON
emp.ManagerID = d.Id
) SELECT Id, Name, Level, ManagerID from OrganizationChart) WITH DATA NO PRIMARY INDEX
ON COMMIT PRESERVE ROWS
I am using them as initial sql on the binding option. I want to know if that helps with improving tableau server refresh time.
oh. I don't know, I haven't done the creation of temp tables with initial sql, but I like the concept. I will try it out.
Yeah I just found about about this feature, but I do not know if this would be faster than adding a view on the db.