msaccess-vcs-addin icon indicating copy to clipboard operation
msaccess-vcs-addin copied to clipboard

Slow export on large database due to ClearFilesByExtension

Open rsonnier-cfs opened this issue 1 year ago • 8 comments
trafficstars

I am new to this site, but I have been using Version_Control_v3.4.23 for about a year. I tried upgrading to Version_Control_v4.0.34 months ago, but was discouraged by the extreme slowness of the export source function compared to the previous version. Last month, I decided to go ahead and move to the V4 anyway. So my exports have now increased from seconds or a few minutes to 30 minutes or more! BTW...I really like the new version, and it has resolved some of the issues we were experiencing with v3.

In our environment, we have 4 developers, over 40 MS-Access databases. Some of those databases have in excess of 400 - 500 linked tables (I inherited all of this and am in the process of cleaning up unused linked tables). Regardless, many of our databases actually use well over 100-200 linked tables (and views).

When investigating the cause of the extreme delays in the export to source process, it was fairly easy to determine that the delay occurred in the export tables section of the routine. By suspending code and stepping through the export process, I zeroed in on these new calls to Public Sub ClearFilesByExtension (not in v3) that appear to be searching for and removing some legacy files by the file types "LNKD", "bas", and "tdf" from the tbldefs source folder.

The issue is that the ClearFilesByExtension seems to be called at the wrong place in the code. I am still evaluating the logic behind this, but it appears to me that these only need to be called once during the export tables section of the code. Instead the ClearFilesByExtension sub is called during the loop for EVERY table in the database project. SO in a large database with hundreds of linked tables, the delay is excessive. Further, my source does not have any of these file types in the tbldefs folder so I am guessing that the reason for the ClearFilesByExtension sub may related file types created by an earlier version of the add-in?

MODULE: modImportExport Public Sub ExportSource (calls) cDbObject.Export

which leads to: MODULE: clsDbTableDef Private Sub IDbComponent_Export ..... ClearFilesByExtension IDbComponent_BaseFolder, "LNKD" ClearFilesByExtension IDbComponent_BaseFolder, "bas" ClearFilesByExtension IDbComponent_BaseFolder, "tdf" ......

rsonnier-cfs avatar Aug 07 '24 19:08 rsonnier-cfs