Re: Delete from mysql table is there a way to....
| From: | phplists at woodenpickle dot com | Date: | Mon, 15 Apr 2002 07:09:24 +0000 |
| Subject: | Re: Delete from mysql table is there a way to.... | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-18509@lists.php.net to get a copy of this message | ||
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" <jendowney@attbi.com> wrote in message
news:20020415004700.86612.qmail@pb1.pair.com...
> 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
>
>