View Issue Details

IDProjectCategoryView StatusLast Update
0006616SymmetricDSImprovementpublic2024-10-11 16:06
Reporterpbelov Assigned Topbelov  
Prioritynormal 
Status assignedResolutionopen 
Product Version3.15.0 
Summary0006616: Save column references as numeric values for faster look-up in AbstractDatabaseWriter.getRowData()
DescriptionBackground: AbstractDatabaseWriter.getRowData() is used to prepare array of string values for import into target table. It does so by lookup up source columns by name and copying values from the source array to the target array.

Currently getRowData() is searching for source columns (to copy data from) for every single data row.
This adds up to about 1 second overhead per 500K rows. Originally discovered while working on bulk load, but affects all load batches.

Proposed solution is to save column references as numeric values (source column 1 ==> target column 1) and re-use these numeric references to copy values from source to target skipping additional column name look-ups (for every row of data, after the first).
Steps To ReproduceUnit test AbstractDatabaseWriterTest illustrates this issue.
Specifically testGetRowData_LotsOfRandomAndFewSkippedColumns() can target current and new implementation to capture run times.

Current way:
    rowData = abstractDatabaseWriter.getRowDataOld(csvData, CsvData.ROW_DATA);

New way:
   rowData = abstractDatabaseWriter.getRowDataNew(csvData, CsvData.ROW_DATA);
Additional InformationGiven:
S = number of columns in the source table,
T = number of columns in the target table,
N = number of rows in the data load batch,

Current algorithm cost is: O( S * T * N)
Proposed algorithm cost is: O( S * T ) + O( N ); For large N this cost growth is linear
Tagsinitial/partial load, performance

Activities

pbelov

2024-10-11 16:06

developer   ~0002500

Branch: enhancement/6608-rowdata-lookup-columns-faster

Issue History

Date Modified Username Field Change
2024-10-11 12:54 pbelov New Issue
2024-10-11 12:54 pbelov Status new => assigned
2024-10-11 12:54 pbelov Assigned To => pbelov
2024-10-11 12:54 pbelov Tag Attached: initial/partial load
2024-10-11 12:54 pbelov Tag Attached: performance
2024-10-11 14:26 elong Description Updated View Revisions
2024-10-11 14:27 elong Description Updated View Revisions
2024-10-11 16:06 pbelov Additional Information Updated View Revisions
2024-10-11 16:06 pbelov Note Added: 0002500