DELETE and overheads

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
CoreLEx
Forum Newbie
Posts: 10
Joined: Sun Jun 01, 2003 5:18 pm

DELETE and overheads

Post by CoreLEx »

Hi everyone

Quick question here from a relative newbie:

I've got a very basic table set up that I pull data from for one of my pages. I've also set up an admin page where I can approve or delete user submissions.

The problem is that whenever a row is marked for deletion and the SQL query "DELETE FROM table WHERE id=$records[$i];" is processed, I get about 20 bytes of overhead showing up in phpMyAdmin. I can optimize the table and get around the warning, but is there something very simple that I am missing and which is causing this to happen?

Thanks for any help.
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

It's expected behavior. Rows are not deleted upon a DELETE query, but instead are marked as deleted. OPTIMIZE your tables from time to time if you're deleting a lot.
Post Reply