Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
vkish16161
Creator III
Creator III

When to drop tables. (From a RAM perspective)

All,

Just wanted to get your thoughts on dropping tables.

Consider this:

When would it be optimal to drop a table? Immediately after it's purpose is served or could we drop all of them at the end.

The reason why I ask is because I've developed a solution (using a subroutine) to automate the process of storing and dropping the tables.

This subroutine is something that I append at the end of my script. So, the tables won't drop until they reach this part of the script.

Say, hypothetically, I drop the tables immediately after they've served their purpose, would it improve the way RAM charecterstics in anyway? Since, tables are being removed from Cache?

For smaller apps it may not matter but I work for a large enterprise who want to be very 'IT Efficient'. So, I was just curious.

Please let me know your thoughts.

mtohicmarcus_sommerrwunderlich

5 Replies
marcus_sommer

I do quite the same and drop my unneeded tables (and fields and variables) directly before the scripts finished UNLESS the tables are quite big and I couldn't waste the RAM on this point.

- Marcus

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I generally drop tables as soon as I am finished with them.  For you it may be a tradeoff between code simplicity and RAM consumption.  If you are dealing with small tables, by all means drop them at the end if that is easiest.  But if you are dealing with large tables in something like an Extract/Store loop, you may find that it's worth the effort to rework your code to drop the tables immediately,

-Rob

vkish16161
Creator III
Creator III
Author

That's how I do it as well Marcus.

But I was curious as to how Qlik internally works in dropping tables. Even when we use the drop statement would Qlik mark that table as to be dropped but only drops it after the script is finished? Or does it do a drop right away?

Maybe hic‌ can comment on this

marcus_sommer

AFAIK it dropped the table immediately. To check it take a look on the taskmanager if its load a bigger table how the RAM increased and also decreased by dropping them.

- Marcus

Anonymous
Not applicable

I agree with Rob, I drop unwanted tables at the earliest opportunity.