Dropping or removing an unused table from a database schema can be challenging. Even after triple checking that all of your apps have migrated away from querying the table, there may still be that one rogue script that accesses it.
Running the dreaded DROP TABLE statement can cause a
host of unintentional problems if that table is still being used
elsewhere. It completely erases the table definition, partitions,
and the data in that table. Before you drop a table, you should
double (or triple!) check when a table was last queried.
When was the table you want to drop last accessed?
You can manually check when a table was last accessed, but it's a bit complicated. The following query will show you the last time a table was written to, but not read:
…[Read more]