Maybe if you ran the delete query, then the optimize table query immed
after, it wouldn't take such a long time.. I would imagine if you had quite
large tables though, it could still take some time.. And if users are
connecting over the internet, you don't want too may delays..

If the user doesn't need any specific feedback about the delete command, you
could do a low priority delete.. That's sketchy at best though from what I
could gather in the manual and around. It just queues the query until the
database is done with everything but it sounds like it might release the
user/client to go on with what they're doing..

You might also check into truncate.. The mysql manual talks about it
briefly.. I guess it's an Oracle thing that mysql supports.. It sounds like
it would keep things clean but sounds slow possibly..

Later,

Bob

"Jennifer Downey" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi all,
> I'm not sure if my first post showed up so I am going to post it again and
I
> apologize if it shows up twice.
>
> Is there a way to delete a record from a mysql table without fragmenting
the
> db?
>
> Here is the query I am using and it does a horrible job. Fragment city.
>
>
>
> if ($quantity == 0)
>  {
>     $gone = mysql_query("DELETE FROM {$config["prefix"]}_my_items WHERE
> uid={$session["uid"]} AND id = '$item'");
>   }
>
>
>
>
> Thanks
> Jennifer
>
>
> --
> The sleeper has awaken
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002
>
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to