Re: Throttling mysql command line

Kezdőlap
Csatolmányok:
Üzenet email-ben
+ (text/plain)
Üzenet törlése
Válasz az üzenetre
Szerző: Alex Dean
Dátum:  
Címzett: Main PLUG discussion list
Tárgy: Re: Throttling mysql command line
On Jan 18, 2012, at 1:30 PM, Eric Cope wrote:

> good point. Its just a series of INSERTs (8000 or so), but the table
> has a fulltext index, so its pretty slow (10 records/sec).
> It sounds like I should split up the batch script, then load a few,
> pause, load a few, pause, etc.
> Any ideas?
>
> Eric


Look at 'alter table disable/enable keys'
you tell the server not to update any indexes while you're doing your bulk load.
http://dev.mysql.com/doc/refman/5.1/en/alter-table.html

Consider loading via tab-delimited rather than SQL.
Much much faster, but the data file must be on the mysql server's filesystem.
http://dev.mysql.com/doc/refman/5.1/en/load-data.html

As others suggested, do inserts in batches and sleep.

alex
---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss