LucidDbInsert

From LucidDB Wiki
Jump to: navigation, search

Syntax

INSERT INTO qualified-table-name [ ( unqualifed-column-name, ... ) ]
query-expression

See LucidDbQueryStatement for specification of query-expression.

See LucidDbUniqueConstraints for the effect of uniqueness constraints on INSERT results.

Example

INSERT INTO employee_dimension(empno, ename, dname, job)
SELECT * FROM transform_schema.emp_view;

WARNING

Single row INSERTs are slow with LucidDB. Column Stores in general being optimized for column at a time access are inherently pretty cruddy at single row INSERTs. There are ways to fake this out, and build some workarounds into the product at great cost/complexity but all that really does is simply mask the issue.

Loops and repetitive INSERT statements will perform orders of magnitude worse than their bulk loading alternatives.

Poorly performing pseudo code:

for ( records in set of 100 )
  INSERT into table (record)

Well performing pseudo code:

Push to flat files, JDBC connector, RemoteRows applib, etc the data
Issue a single INSERT INTO TABLE SELECT * FROM BULKLOADING
Product Documentation