View Using the Infobright Loader

Infobright includes a dedicated high-performance loader, in addition to supporting the MySQL Loader and the INSERT statement. The Infobright Loader is designed for speed, but supports less load syntax than the MySQL Loader, and only supports variable length text formatted load files.

Further details can be found in the Data Loading Guide located in the top level Infobright install directory.

Default Loader

IEE defaults to the MySQL Loader, which has more robust error handing, but is not as fast as the Infobright Loader. For fastest LOAD results, use the Infobright Loader by setting the @bh_dataformat environment variable as described below:

To use the Infobright Loader with variable-length text in CSV format, enter:

mysql> set @bh_dataformat = ‘txt_variable’;

To use the Infobright Loader with binary data, enter the following command:

mysql> set @bh_dataformat = ‘binary’;

To return to the default MySQL Loader, set the data format to the standard MySQL format:

mysql> set @bh_dataformat = ‘mysql’;

Infobright Loader Syntax

To import your data using the high performance loader into an Infobright table, use the following load syntax (all other MySQL Loader syntax is not supported):

LOAD DATA INFILE '/full_path/file_name'

   
INTO TABLE tbl_name
   [FIELDS

      [TERMINATED BY 
'char']
      [ENCLOSED BY 
'char']
      [ESCAPED BY 
'char']

   ]

The data is committed when the load completes if AUTOCOMMIT is set to on. This is default setting, but you can make it explicit by setting:

Set AUTOCOMMIT=1;

If you want to check the data via select before committing, then set AUTOCOMMIT to off:

Set AUTOCOMMIT=0;

New data can be seen by the loading session even though its not committed. Complete the load using an explicit COMMIT:

COMMIT;

Named Pipes

Another option available for use with the loader is to use a named pipe rather than a flat file. This method has been doucumented in the Infobright Users Guide as well as in a How To document that can be downloaded here.