Fixing Bug/ssad 33 fix houses.zip#72
Conversation
|
DrFaust555
left a comment
There was a problem hiding this comment.
Approved after the next remarks:
- Search for deletion — N+1 query:
foreach (var candidate in possibleToponymsToDelete)
{
var entity = await _repository.ToponymRepository.GetFirstOrDefaultAsync(t =>
t.Gromada == candidate.Gromada &&
t.Coordinate.Latitude == candidate.Coordinate.Latitude &&
...);
}
Each candidate is a separate query to the database. If dataToDelete has 100 records, it is 100 queries. It can be optimized through one GetAllAsync with Contains, but for Take(20) it is not critical.
Now I suspect the following (I need to check, I could be wrong myself!):
- News tests in PR:
PR contains 8 News test files from PR #63. You need to either rebase to the current dev (if #63 has already been merged), or it will be a conflict.
- .gitignore not updated:
The PR description says "adding houses.csv to .gitignore". houses.csv has been removed from git, but without .gitignore it can be re-committed.
…etcode-Server-January-2026 into bug/SSAD-33-Fix-houses.zip
…etcode-Server-January-2026 into bug/SSAD-33-Fix-houses.zip
|
Add entries for houses.csv, data.csv and houses.zip to .gitignore so that they do not end up in the repo after local launch. Also fix N+1 query in SaveToponymsToDbAsync — now in the foreach loop for each candidate for deletion there is a separate GetFirstOrDefaultAsync query, this needs to be replaced with a single query that will extract all the necessary records. And remove lines from Controllers\Newss\ and Controllers\Analytics\ from .csproj — they are not relevant to your task. |
|




dev
JIRA
Summary of issue
The database synchronization process in
SaveToponymsToDbAsyncwas unoptimized (caused full table truncation and row-by-row insertion). Additionally, the path forhouses.zipwas hardcoded and the large binary file was tracked in the repository root.Summary of change
SaveToponymsToDbAsync:CreateRange,DeleteRange) for better performance.houses.zipto be downloaded at runtime to theResourcesfolder.houses.csvto.gitignoreto prevent tracking large files.CHECK LIST