Forum Discussion

ManuApo's avatar
ManuApo
Helper II
4 years ago

Importing data - Which method will refresh my data quicker??

Hello all,

 

I've got a doubt, probably the answer is simple but I'm not sure about it.

 

I am looking to load/refresh my data in the quickest way possible. I have written a large sript in SQL that combines around 10 different tables from my database and creates also different temporary tables and in the end pulls out 3 tables. Because in Power BI you can not extract 3 different tables from 1 script, I am thinking of 2 different options to import my data, and I obviously want to use the quickest way. 

-Import the 3 tables separetly, using the same script, getting 3 different queries. Each query will have at the end, .... FROM #Table1    ..... FROM #Table2 ..... FROM #Table3...

 

-Combine the 3 final tables on my SQL script (APPEND). Import only 1 final table and then separate into 3 different tables in Power Query.

 

I am guessing that the second option will be the quickest one because it will only have to query the script one time to the database, whereas the first option will do it 3 times..

Am I right? 

 

Thanks for your time,

Manu

3 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    ManuApo You want to use the method that preservers "native query" functionality. So, in the last step of your query if you can right-click that step in APPLIED STEPS and View Native Query is not greyed out, then that means that all of the processing is being pushed back to the SQL Server and thus should be the most efficient.

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    ManuApo The fastest way should be to use SQL to create a view and then just select that view in Power Query. But I'm confused as to when you have 1 table and when you have 3.

    • ManuApo's avatar
      ManuApo
      Helper II

      Lets say I dont want to start creating views yet. This script I have is actually a stored procedure that produces multiple tables. From those tables I am interested to extract into Power BI 3 of them.

       

      My question is if I should append these 3 tables into one table to just query the database one time and then separate the 3 tables in power query. Or query 3 times to the database using the same script except the last select statement which will extract each time one different table. 

       

      Hope that is more clear