0 Replies Latest reply: Oct 27, 2013 12:14 PM by Bruce Tedder RSS

    Optimising SQL Load and Indexing

    Bruce Tedder

      Hi All

       

      I have a massive problem. Our DB will not let me query our DB, especially this one table QT.

      I would like to extract data every 2 hours. An optimized SQL Query would be as follows:

      SELECT *

      FROM QT (NOLOCK)

      WHERE QT_NUMBER between A and B.

       

      The problem is I need to collect all records where the QT_EDIT_DATE is >= "last load".

      I would then concatenate load from a QT.QVD where Not Exits (ID). 

       

      How do I load just the edited records since last load, when I need to be loading QT_NUMBER between A and B otherwise the query is not optimised?

       

      Any ideas?