Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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
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
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
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
I agree with Rob, I drop unwanted tables at the earliest opportunity.