Dropping unwanted tables immediately after use

Quite often, we create temporary tables to do some calculations and, after using them, we drop them. Many developers consolidate such drop statements from all the tabs of the script and place them at the end of the script.

When they do this, they forget that the data used by the temporary tables remains in the RAM until the script reaches the drop statement for those tables. This increases the load time and the RAM required to load the data. This creates performance issues when the temporary tables hold a large amount of data.

For example, you may use the transactional table for some calculation and, after calculation, you may store it with a different name. Now, if you do not drop the table immediately, the script holds the data of both tables in the RAM, which unnecessarily increases RAM usage. The RAM will be released only when the drop statement for that table is executed.

Therefore, the suggested best optimization practice is to drop the unwanted tables immediately after use.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset