Skip to content

Releases: jrcs3/SyncFileToDb

Third_Experiment

Choose a tag to compare

@jrcs3 jrcs3 released this 10 Dec 02:47

SyncFileToDbEFManuallyFilter

Experiment using Entity Framework (EF) breaking the changes into the same 4 groups and making the changes with EF and
calling SaveChanges()

Results in one query to the database for updates, I did have to do some tweeking to avoid additional queries when
issuing the EF command earlier in the process.

The perf was slower than SyncFileToDbAdoNet for this small sample size, but since there are fewer SQL exchanges, it may
perform better for larger batch sizes.

Fourth_Experiment

Choose a tag to compare

@jrcs3 jrcs3 released this 10 Dec 19:35

SyncFileToDbBatchAdoNet

Drop table an insert the whole CSV with ADO.NET in batches. Build a large INSERT INTO query with paramaters.
The number of records inserted can be configured.

I did this experiment because the origional application did a truncate and bulk import, but did it as single record inserts.
The hope is that this method would perform better because it made fewer DB calls.

Second_Experiment

Choose a tag to compare

@jrcs3 jrcs3 released this 09 Dec 21:14

SyncFileToDbEFSimple

Experiment using Entity Framework (EF) using a simple drop and write full list (this is how the original app worked).
The hope was that EF would be smart enough to just make the net changes, That assumption proved to be false.

Results in one query to the database for updates

In this release, I refactored the CsvHelper code to a separate library

Moved the data file down so that it will be available to all experiments. Added method CsvCommonLib.Tools.GetDirectoryInParent() to make it easy to get the directory in a consistent manner.

First_Experiment

Choose a tag to compare

@jrcs3 jrcs3 released this 09 Dec 21:05

SyncFileToDbAdoNet

Break the changes into the 4 groups and make the changes with ADO.NET one at a time.

Results in lots of small queries to the database for updates