Dealing with large SQL Views in Daily Load

Hi, looking for advice/best practice on how we can improve our daily load.

Currently we have a couple of sql/datareader updates in our daily load which individually consume up to 10 minutes each. In total our daily load needs more than an hour, which is too long.

 

Most of our reports in Board are based on monthly figures, our setup for these datareaders at the moment is that we reload historical data (2015-2019) for reportings everyday. Is it somehow possible to load the historical data once and after that somehow define that only the last 3 months are updated daily. If so can I do it in Board or does it need to be done in the SQL server.

 

What kind of setups are you using for daily updates?

 

Thanks

 

Mathias

Answers

  • Unknown
    Unknown Active Partner

    Hi Mathias,

     

    You could try "Use current Selection" when launching the Data Reader

     

    image

     

    More info here: Data Read

     

    However, I am honestly a bigger fan of applying the restrictions in my dataset load directly in the SQL query defined.

    All the best,
    Jonathan

  • Björn Reuber
    Björn Reuber Employee, Community Captain
    500 Likes Fourth Anniversary 100 Comments 5 Answers

    Hi,

     

    as Jonathan had said, the best way is to limit the SQL Query, cause otherwise you'll have the whole traffic in SQL, cause the current selection is only applied on board side.

    Furthermore I allways suggest to load "whole" Month (so allways starting from 1.x.) instead having a window of the last 90 days (also this is easier to implement)

     

    Regards

    Björn

  • Hi Mathias,

     

    in addition to what Björn said you should also have a look at this How to: Optimize Datareader performance. 

     

    Regards

    Dietmar

  • Thanks everyone.

     

    I have one more question to the setup in the SQL server. I am not an expert here and not the person in charge to create the tables and views so excuse me if this question is silly.

    How do your views in the Server look like to be optimal for Board.

    Assuming we have the following view in the server (of course with tons of more data and a longer history):

    DateCustomerProductSales
    2018-10Aa100
    2018-10Ba300
    2018-10Cb200
    2018-11Ac100
    2018-11Bd200
    2018-12Aa300
    2018-12Bb100
    2018-12Da50
    2019-01Ac600
    2019-01Bc800
    2019-01Cc900
    2019-02Bb150
    2019-02Db250

    Now I want to only update the most recent month in Board. What is the best way to define this already in the server?

    Any tips of sources/manuals I can read to get more knowledge on this topic? 

     

    Thanks so much.

  • Hi Mathias,

     

    as you can see in the link of my previous post the order of customer and product depends on the max item no of these entities.

    If you have a date in your sql-view you can check it versus getdate() - gives you the current date and time. You can convert this into YYYYMMDD with the following code: convert(varchar,getdate(),112).

     

    You can have a look here: SQL time functions