2 added 7 characters in body
source | link

First of all, I discourage you from using the slow log with TABLE output, in production. The reason is that writes are locking, which limits the concurrency of writesyour workload.

Moreover, CSV stored engine does not support indexes. Any non-trivial query will be very slow, so I don't see any advantages in doing this. Of course you could use MyISAM and add indexes, but then writes will become more expensive.

That said, the correct way to "rotate" isthe table is copying it and than truncate it. You will probably lose some queries every time: the ones ran after the copy but before the TRUNCATE TABLE statement.

First of all, I discourage you from using the slow log with TABLE output, in production. The reason is that writes are locking, which limits the concurrency of writes.

Moreover, CSV stored engine does not support indexes. Any non-trivial query will be very slow, so I don't see advantages in doing this. Of course you could use MyISAM and add indexes, but then writes will become more expensive.

That said, the correct way to "rotate" is is copying it and than truncate it. You will probably lose some queries every time: the ones ran after the copy but before the TRUNCATE TABLE statement.

First of all, I discourage you from using the slow log with TABLE output, in production. The reason is that writes are locking, which limits the concurrency of your workload.

Moreover, CSV stored engine does not support indexes. Any non-trivial query will be very slow, so I don't see any advantages in doing this. Of course you could use MyISAM and add indexes, but then writes will become more expensive.

That said, the correct way to "rotate" the table is copying it and than truncate it. You will probably lose some queries every time: the ones ran after the copy but before the TRUNCATE TABLE statement.

1
source | link

First of all, I discourage you from using the slow log with TABLE output, in production. The reason is that writes are locking, which limits the concurrency of writes.

Moreover, CSV stored engine does not support indexes. Any non-trivial query will be very slow, so I don't see advantages in doing this. Of course you could use MyISAM and add indexes, but then writes will become more expensive.

That said, the correct way to "rotate" is is copying it and than truncate it. You will probably lose some queries every time: the ones ran after the copy but before the TRUNCATE TABLE statement.