|
from the storage engine point of view we get a start_bulk_insert() command for INSERT...SELECT regardless if it is one row or millions, we don't know in advance how many we are getting. This is the point where we trigger cpimport. Then write_row() for all the rows and end_bulk_insert().
We could delay until several rows have been received but it is messy. There are already cpimport delay fixes in 1.1 and we have found a couple of potential places where INSERT...SELECT performance can be improved. For now we are probably better off targeting those.
If a user knows that only one row will be inserted they should turn off infinidb_use_import_for_batchinsert for their session. This will bypass cpimport and use the regular insert code path which will likely be faster for single rows.
|