Skip to main content

Considering the performance, is it better to have a single custom sql or to split the single query into 2 and join them? The real time data would run into more than a million. Unfortunately, we have access to very few data in lower environments, so unable to find any difference with the present data.

3 answers
  1. Nov 14, 2017, 1:47 PM

    Hello Navya,

     

    In this scenario I didn't found any difference in performance.

     

    Below result will help you -

     

    Case 1

    Custom 1 - SQL

    select A, B, C FROM TABLE1 JOIN TABLE2 ON TABLE1.A=TABLE2.D

     

    Custom 2 - SQL

    select A, B, C FROM TABLE1

    INNER JOIN (Condition A=D)

    SELECT D,E,F FROM TABLE2

     

    Worksheet - A, Sum(B)

    In above scenario  tableau will execute below query on database.

     

    Case 1

    SELECT A, SUM(B) FROM

    (select A, B, C FROM TABLE1 JOIN TABLE2 ON TABLE1.A=TABLE2.D)

     

    Case 2

    SELECT A,SUM(B) FROM

    (

    select A, B, C FROM TABLE1

    INNER JOIN

    SELECT D,E,F FROM TABLE2

    ON TABLE1.A=TABLE2.D)

     

    However you can check with your data with help of Tableau Performance recording.

     

    validate your generated query in case 1 and case 2 if both queries are same then no impact on performance vice versa.

     

    Regards,

    Ravindra

0/9000