Interface IParallelImportProvider
What a provider needs to offer for an import that writes over several connections at once.
The ordinary import is one connection and one transaction: it either lands whole or leaves the
database as it was. The parallel import trades that guarantee for speed. Rows go in over N
connections that commit on their own, and the secondary indexes of the large tables are dropped
before the load and built again after it, because maintaining them row by row is what makes a
large import slow. A parallel import that stops half-way leaves a partly loaded database; the
definitions of the dropped indexes are kept in the database itself so that the next run, or the
operator, can put them back.
public interface IParallelImportProvider
Properties
BuildsIndexesOfOneTableConcurrently
False when two index builds on the same table must not run side by side; the indexes of a
bool BuildsIndexesOfOneTableConcurrently { get; }
Methods
CreateIndexAsync(DroppedIndex, CancellationToken)
Creates one index from the statement returned.
Task CreateIndexAsync(DroppedIndex index, CancellationToken ct = default)
DropLoadIndexesAsync(CancellationToken)
Drops the secondary indexes of the large tables and returns the statements that create them
Task<IReadOnlyList<DroppedIndex>> DropLoadIndexesAsync(CancellationToken ct = default)
ForgetDroppedIndexesAsync(CancellationToken)
Removes the stored definitions once every index is back.
Task ForgetDroppedIndexesAsync(CancellationToken ct = default)
OpenWorkerAsync(CancellationToken)
Opens one more connection to the same database, set up for loading: no transaction, and
Task<IDataProvider> OpenWorkerAsync(CancellationToken ct = default)
RelaxConstraintsForLoadAsync(CancellationToken)
Switches off foreign key checks and triggers for the load where that is a setting of the
Task RelaxConstraintsForLoadAsync(CancellationToken ct = default)
RestoreConstraintsAfterLoadAsync(CancellationToken)
Undoes once the rows and the indexes are in, and
Task RestoreConstraintsAfterLoadAsync(CancellationToken ct = default)