Jerry,

Does TRUNCATE work on a merge table?

Apparently not.
I tried:

"truncate table mymergetable" and got:

Error Code : 1
Can't create/write to file '.\dbname\mymergetable.MRG' (Errcode: 17)

I even tried a Flush Tables before the truncate and that didn't help.
So it looks like I'll have to truncate each individual table which is a pain because the merge table definition may change.

Mike



 I honestly don't know, but it should be
faster than a DELETE for removing all of the records.

Regards,

Jerry Schwartz
The Infoshop by Global Information Incorporated
195 Farmington Ave.
Farmington, CT 06032

860.674.8796 / FAX: 860.674.8341

www.the-infoshop.com
www.giiexpress.com
www.etudes-marche.com
> -----Original Message-----
> From: mos [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, November 20, 2007 4:13 PM
> To: mysql@lists.mysql.com
> Subject: Why is Delete slow on a Merge Table?
>
> I have a merge table that is a union of 20 1 million row tables. Select
> rows from it is quite fast. However if I want to delete all the rows as
> in:
>
> delete from MyMergeTable;
>
> it takes just over 3 minutes. I could execute 20 separate delete
> statements
> for each of the 20 tables and it would complete in under a second. Why
> is a
> Delete on a merge table so inefficient? It appears it is deleting all
> the
> rows individually.
>
> Mike
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]
> infoshop.com

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to