Forum Discussion

masplin's avatar
masplin
Impactful Individual
6 years ago
Solved

Referencing vs duplicating queries speed affect

Hi

 

I have a fialy complex query pulling in form multiple sql tables (one for each client) then a whole bunch of formatting and cleaning tasks.  This generates Table1.  The table contains 3 different dates (submitted, assigned and actioned) and my model needs 3 different tables so I can relate either of these dates to my date table. So i need to create 3 subset tables of this main table with each of the subsets only needing some subset of the columns.

 

I see I have 2 choices

1. start each subquery with Source=Table1 then remove the columns not required

2. for each subquery use reference to Table 1 

 

The question is in option 1 does each query get rerun in full whereas in reference only Table1 needs ot be run because then data already avaible to the other 3 i.e. is reference faster?  I understand the limitations of using reference later in the model but al lmy measures wil lbe independent. 

 

Thanks

Mike

  • Hi masplin 

     

    I would suggest using the second way.

     

    As for the first way, you have to import this source four times totally even if you removed unnecessary columns. It is inefficient. If your source contains amount of data, it will take some time whether it is importing or refreshing.

     

5 Replies