What happens to index once the table got dropped? What happens to index once the table got dropped? sql sql

What happens to index once the table got dropped?


In Oracle when dropping a table

  • all table indexes and domain indexes are dropped
  • any triggers defined on the table are dropped
  • if table is partitioned, any corresponding local index partitions are dropped
  • if the table is a base table for a view or if it is referenced in a stored procedure, function, or package, then these dependent objects are invalidated but not dropped


In Postgres

DROP TABLE always removes -1. any indexes2. rules3. triggers4. constraintsthat exist for the target table. 


By default, MS Sql Server also drops indexes when a table is dropped.(Observed in version 13.0.4206.0.)