7 Replies Latest reply: Dec 10, 2016 6:46 AM by Clever Anjos RSS

    QlikView Script - Run multiple queries at the same time

    Josh Abbott

      I have run into an issue with the amount of time it takes to pull data in.  I'm querying an oracle db server, using a simple select statement:

       

      select

          -- The 10 columns I need for my query

      from

        table_name

       

       

      Most of the columns are number fields with a couple nvarchar(20) fields, so not much wide data, and only 10 columns. The problem is there are 144 million rows in this table.  It takes 14.5 hours to run, and my tasks aren't allowed to take over 30 minutes to run on our QlikView server.  This table is not a slowly changing dimension table, so I must do a full load each run, no incremental loading.  One suggestion I was given was to run 18 different queries at the same time using a mod on the primary key:

       

      select

        -- The 10 columns I need for my query

      from

        table_name

      where

        mod(primarykey,18) = 0


      and

      select

        -- The 10 columns I need for my query

      from

        table_name

      where

        mod(primarykey,18) = 1




      etc up to 17.  The DB server can supposedly handle running these 18 queries against it at the same time.  The problem I'm seeing from this approach, is I'll need 18 different qvw's on my QlikView server to run these queries at the same time.  Is there a way in 1 qvw document I can run all 18 queries at once, and have it load into a qvd file when it is done?  Does anyone have any other creative suggestions on how I might be able to handle this?  I know this is a strange one, and I surely don't want to go the 18 qvw's route to solve this, seems like way too much of a hack job.

       

      Thank you for your help!