Rick Hillegas <[email protected]> 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 builds. -- Knut Anders
