"Sean L. Gilley" wrote:
>
> I got an application that occasionally (through one or more bugs)
> creates a large number of entries in a mysql table -- entries numbering
> in the millions.
>
> I've got a way to recreate the table with correct data from scratch,
> but the problem lays in deleting the data from the tables. I've tried
> various things...
>
> delete from table where field like '%'
> delete from table
> drop table (then recreating it)
>
> All these approaches seem to take forever when the tables get that big.
> Today I discovered something that may work, but probably isn't the best
> thing to do.. I remove all associated files from the data area for that
> table, then do mysqladmin refresh. This seemed to work the one time I
> tried it.
>
> Is there something better I can do, that works quickly?
>
> Thanks,
>
> Sean.
Hi Sean
First:
DELETE FROM table;
Should be the fastest way to destroy and recreate a table, as long as there aren't any
LOCKs on the table.
Second:
Moving the files ad issue an refresh or flush tables should be save to do.
Tschau
Christian
| Thread |
|---|
| • Drop large tables? | Sean L. Gilley | 12 Aug |
| • Re: Drop large tables? | Christian Mack | 12 Aug |