Bug #6373 Add a "Limit n" to Load Data Infile command
Submitted: 1 Nov 2004 21:53 Modified: 30 Sep 2009 11:46
Reporter: Mike MySQLAB Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: DML Severity:S4 (Feature request)
Version:4.1 OS:Any (All)
Assigned to: CPU Architecture:Any

[1 Nov 2004 21:53] Mike MySQLAB
Quite often I need to see if the load data is loading data properly without having to load all 10 million rows into the table. I'd like to be able to load the first 10 rows to see if the data loads properly otherwise it could take quite a while and produce a lot of unecessary I/O and bandwidth degradation only to find the data did not load properly.

Adding a "LIMIT [offset],n" to the end of the Load Data Infile command will load only the first "n" rows into the table. The optional Offset would be used to load the table in a bit at a time. If there is a 10 million row table, someone might want to load only 500,000 rows at a time so as not to degrade performance with the other users online. This will allow them to load the table a chunk at a time.

How to repeat:

Suggested fix:
load data infile "bigdata.txt" into table mytable limit 10


load data infile "bigdata.txt" into table mytable limit 100001,100000
[30 Sep 2009 11:46] Valeriy Kravchuk
Thank you for the feature request.
[30 Sep 2009 11:49] Valeriy Kravchuk
Bug #27136 was marked as a duplicate of this one.
[14 May 2015 20:32] Jian Yang
Is it solved now ???