Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

QlikView Hangs After Cancelling Large Script

Does anyone else have this problem? My copy of QlikView (v10, Win x64) consistently hangs (locks up) if I cancel a long-running LOAD SQL script. The script executes a stored procedure which typically takes several minutes to run.

I've tried leaving it in this state for several minutes, and it hasn't resumed. Maybe it will resume when the stored procedure finishes executing, but if I had time to wait around I wouldn't need to cancel it.

This is a problem, as the source server is out of town, and large (millions of records) data sets can take over an hour to load. I really don't want to wait 90 minutes after I've spotted some small mistake before I can correct the error and start loading good data.

The bigger problem, of course, is that script execution occurs in the UI thread, a serious design mistake. A workaround would be to install a copy of QlikView on the data server and execute SQL locally then deploy the finished file, basically a jury-rigged SBS.

15 Replies
Not applicable
Author

I'm not using this specific file any more, so I can't confirm it, but I think I know what the problem was on the SQL side.  This doesn't excuse QlikView locking up while waiting for data, but just in case it helps someone:

Microsoft SQL uses a technique called "parameter sniffing" to create good execution plans for stored procedures.  Basically, the first time you run a sproc the database will build and store an execution plan based on the parameters you gave it.  If you later run it with different parameters, the stored plan could be drastically inefficient.

For example, say you have a sproc with @StartDate and @EndDate parameters.  You create it, and run it with the date 2011/04/27 for both the start and end date, just to see if it works.  SQL looks at that narrow date range and decides that an index seek is appropriate.  Later you run it with a start date of 2000/01/01 and an end date of 2011/04/27.  SQL still uses its index seek execution plan, even though what it really needs for that broad date range is a table scan.  This can make a huge difference, leading to run times of hours rather than seconds - I've seen it happen.

The fix is to specify reasonable parameter values when you first run a sproc after creating or re-creating it.  This will help SQL to build a well-optimized query plan at the beginning.

More info: http://www.simple-talk.com/sql/t-sql-programming/parameter-sniffing/

Not applicable
Author

Thanks Jonathan,

The files are not large at all - only a few meg, maybe 20 TOPS.  I've tried killing the process too and it still just hangs....

I was hoping I'd be able to identify which line from the Services tab to kill instead. 

vlad_komarov
Partner - Specialist III
Partner - Specialist III

I would suggest to try debugging your script (using Limited Load). You might have a Synthetic key(s) somewhere in the model, and QV can simply hang trying to handle that in large data set.

etl_tools
Creator
Creator

I had simular issues when i was loading data from different sql tables into same Qlikviev table

Salesdata:

LOAD * ;

SQL

SELECT F1,f2,...f50

FROM my_table1;

Salesdata:

LOAD * ;

SQL

SELECT F1,f2,...f51

FROM my_table2;

Number of fields is the same.

Note last field has a diifferent name.

Version 11 QlikView hangs.

Miguel_Angel_Baeyens

Hi,

That's likely because the huge number of synthetic keys that QlikView creates for the F1 to F49 fields. Using Qualify or concatenating fields will make the script work.

Regards.

Miguel

etl_tools
Creator
Creator

Yes that was silly mistake but it took a while to figire it out