db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Knut Anders Hatlen <knut.hat...@oracle.com>
Subject Re: is there some way to support bulk insert without new syntax, in a zero admin way?
Date Tue, 31 Aug 2010 21:31:42 GMT
Rick Hillegas <rick.hillegas@oracle.com> writes:

> I think that I would be satisfied with something less ambitious: If
> the source stream for the INSERT involves a table function, then
> always attempt a bulk insert--naturally, the bulk insert optimization
> would be applied only if the target table was empty. This wouldn't
> give us simple, standard syntax for the replace functionality enjoyed
> by the import procedures, but the incremental improvement would be
> significant.

If we can live with two statements instead of one, we could use this
standard syntax:

  truncate table t;    -- SQL:2008 / DERBY-268
  insert into t select * from table ( my_vti () ) as tt;

Since the table is empty after TRUNCATE TABLE, the suggested
optimization for inserts from table functions should kick in here.

This would however require someone to verify that our TRUNCATE TABLE
implementation is standards compliant and enable it in production

Knut Anders

View raw message