In MySQL do indexes get automatically deleted when the table is dropped? Is it true for other databases as well like Postgres?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
All table data is removed; this includes indexes and the table definition.
Indexes can always be rebuilt given table data and definition remain intact, but not the other way around. It’s not possible to restore anything meaningful from indexes without anything else.
I’m not aware of another database server that would leave the indexes but that doesn’t mean there isn’t one.