Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
david_ze
Partner - Contributor III
Partner - Contributor III

Loading from QVD takes long time with WHERE

Hi all,

I'm loading data from QVD file (300M recs) and using WHERE in the load statment:

Params:

load

event_id as id,

"param_name",

"param_value"

FROM event_params.qvd

(qvd) WHERE event_id>=$(vMin_id) and event_id<=$(vMax_id);

can someone advice me why it take so long to load the data? is it something I should change in the load script?

Will appreciate your help.

Thanks,

David





6 Replies
Not applicable

David,

The 'where' clause on a QVD affects optimisation.

Try loading the QVD completely (so that it is optimised) and then apply the 'where' to the resultant table.

Regards,

Gordon

Not applicable

There is one exception, and that is the EXISTS function. You can have an optimized load with a WHERE EXISTS or WHERE NOT EXISTS clause.

david_ze
Partner - Contributor III
Partner - Contributor III
Author

Thanks,

can you reply me with the syntax I should use in my script?

Not applicable

by using incramental load

you can use "where" only on the delta

Not applicable

Try this:

tParams:

load

event_id,

"param_name",

"param_value"

FROM event_params.qvd (qvd);


Params:

load

event_id as id,

"param_name",

"param_value"

resident tParams

WHERE event_id>=$(vMin_id) and event_id<=$(vMax_id);

drop table tParams;

Note that as event_id is renames as id in table Params then the data will not be concatenated with table tParams.

Regards,

Gordon

Not applicable

Assuming you already have the IDs that you need to load in a field [id], you can modify your WHERE clause to:

WHERE EXISTS(id,event_id)


...this way you don't need the variables and you keep the optimized load.