6 Replies Latest reply on Mar 23, 2016 2:38 PM by Dan Cory

    Is there a way to avoid Tableau from including unnecessary fields from query (Live Conn. Sql server)?

    Esben Michelsen



      This is my first question - but I would like to thank everyone contributing to this forum for all their work which has helped me a lot!


      I am working on a live connection to our data warehouser DB, which is SQL Server 2012. I have a simple viz (bar chart) and a parameter control where I can select one of tre different measures I want to display in the viz.


      The measure-field in the viz is calculated by a formula:

           case ParamMeasure

                when 1 then count(M1)

                when 2 then countd(m2)

                when 3 then countd(m3)



      My issue is that updating the worksheet is quite slow. I got the query from a performance recording and could see that it includes all of the three possible calculations that I want in my viz in one query (though I only need one of them). Because of a large number of rows in the table (millions) the execution plans warns me that it runs out of memory and has to spill to tempdb. Further testing shows that if I only include two of the measures (e.g. count(M1) and countd(m2)) in the query it performs much better (4 seconds compared to 80 seconds).


      So while I am of course speaking to my DBA about more memory, I am also wondering if there is a way to tell Tableau to stop including the "unnecessary" fields from the query? I am deeply impressed that it can parse the worksheet in a way that it understands it might be helpful to get all three measures so I get amazing performance when changing the parameter, but the first-load performance in this case is a problem.


      I am using Tableau Desktop 9.0.2 with a live connection to SQL Server 2012-based DW. Tables have relevant column-store indexes etc. :-)


      Thank you very much!