We are working on a project which is serving for Pharmacy WareHouses. And we want to trace Medicines with QR Code. But we have some problems about the records. Couse those records can be several hundred thousands. And we are keeping those records in Information Registers. But, the program getting slower while we are deleting those records.
So, is there anyway to batch delete from Information Registers?
By the way, if you have an idea to keeping those records. We will be pleased to hear that.
Normally when I add 100000 records from MSSQL, it adds in 1 minute. When I add 100000 records from 1c to the inforeg table, it adds in 10 minutes. Likewise, 1c deletes the 100000 record in 10 minutes because it deletes it in one cycle. MSSQL deletes 100000 records in 10 seconds. In fact, we want to delete the bulk quick record from inforeg.
We haven't started the project yet. We do R & D. I tested the codes with a normal and simple loop. What I want to ask is, are we able to perform a quick batch deletion from the inforeg table without looping?
Unfortunately, there is no batch insertion, but there are some settings that can speed up a regular insertion.
For example:
Code
RecordSet = InformationRegisters.ExchangeRates.CreateRecordSet();
// This mode uses a minimum of write checks...
RecordSet.DataExchange.Load = True;
// Some your code...
// This option - "false" - also allows you to speed up the recording.
// But you need to be sure that there are no double entries in the register.
RecordSet.Write(False);
Of course, in speed this can not be compared with MS SQL - but this is the fastest way to write to the information register.
Oh, I get it — you created an object "RecordSet" for every insert operation. It is possible to do this, but this is not the best way to add entries to the register
That's why I asked you for a sample of your code to understand where the error is ...
If you now apply my recommendations, the recording time will be even shorter.
I just checked: your code runs on my server for 2 minutes 10 seconds, and if with my recommendations - 2 minutes 3 seconds. I inserted 2 million records.
Thank you Aleksandr Biryukov. I'm still doing this. But I didn't see the speed difference. I was wondering if there was a different way, so I wanted sample code.