Page 1 of 1

mysql delete query

Posted: Tue Oct 25, 2005 12:44 pm
by rami
i am using mysql and when i use
delete from table...
or even use phpmyadmin when i give delete command i have noticed that the data physially dont get deleted..rather it indicates it as deleted..i could find physical data in files

so how to permanantly delete records from table..(freeing space and user)

another is suppose user_id field is autoincrement field,there are 10 data
and i later deleted the user_id 1
then can i re arrange table ...not making that user_id 1 free
may be suffle one step ahead all
or give that user_id to new user..

how can it be done..

thanks

Posted: Tue Oct 25, 2005 12:55 pm
by feyd
you may need to resync the table via the optimize command or some such. As for reordering or reusing deleted id's, it's not a good idea. ID's are meant to be used once and only once. You should set your ID field to allow for very large numbers of records...