Forum Discussion

robarivas's avatar
robarivas
Post Patron
9 years ago

Why no Query Folding?

In Power BI Desktop I am connected to an IBM DB2 database for the first time and when I run a simple filter on a date column in the table I do not get any Query Folding. So the filter takes an indefinite amount of time to run, especially because the table is very large--over 800 million rows. Any ideas as to why such a simple filter would not be folded?

 

When I connect to the database I have a choice of using two different drivers: IBM or Microsoft. I can only connect with the Microsoft option.

4 Replies

    • robarivas's avatar
      robarivas
      Post Patron

      Hello Anonymous. I confirmed that Query Folding occurs when filtering most fields, which is good. However, it is specifically with Date and Date/Time fields that the Query Folding stops. And even with Date & Date/Time fields it will work if I choose (checkmark) particular dates. But if I filter for a range of dates (using After, Between, Before, etc.) then the Query Folding stops working.

       

      Oh and by the way I (so far) have only noticed this on one of my largest tables in my database (i.e., my "sales" table). On other tables (so far) date filtering does not shut down query folding.  Very strange.

      • Anonymous's avatar
        Anonymous
        Not applicable

        robarivas,

        I suspect the issue is caused by that there is large amount of data in your table. Could you please filter your data by writing specific statement during the connection and check if the issue persists?



        Regards,
        Lydia Zhang