1 Reply Latest reply: Feb 6, 2013 2:23 AM by Or Shoham RSS

    Extreme slowness on a very basic load statement

    Or Shoham

      I've got the following SQL query, repeated three times (to get results from three different databases):


      SELECT "vchPlatform_Serial_Number", "datCreate_Date", intPlatform_Status_ID

      FROM "myDataBase".dbo."Platform_Ta";


      This runs without any problems and gets roughly 10k rows from each database, taking under a second to run.


      However, when I place the following load:

      LOAD "vchPlatform_Serial_Number", DayName("datCreate_Date") as Pallet_Create_Date, intPlatform_Status_ID ;


      it takes about 30 seconds each to run, and eats up the entire server's CPU resources during that time span, with the same result if I load from all three tables first, and then run that load on the resident table.


      Here's the quirky part - if I change that load statement at all, it runs quickly and correctly (again under one second), e.g.

      LOAD "vchPlatform_Serial_Number", '1' as myField, DayName("datCreate_Date") as Pallet_Create_Date, intPlatform_Status_ID

      This is an acceptable workaround, but I was wondering if anyone could venture a guess as to why QV is hanging up on the original load statement.


      Thanks in advance.


      [edited to add]

      Curiously, if I put the new field at the end of the load statement, it doesn't help any - it only seems to work if it's placed before the date column.