Performance problems importing data

I am reading a text-file into a container and generate LedgerJournal transactions from these records. The first about 3.000 records are quite fast, but then it slows down gradually until it virtually stops. I have tried to ttscommit and ttsbegin for each 1000 i read, but it does not seem to make any difference. Is there something else I need to do? (like freeing cache, for instance)? I remember having similar problems when reading with Dataports in Navision Financials, but solved that with reading a File with a report or codeunit in stead. Hope somebody else have encountered these problems - and solved them :slight_smile:

I have got the same problem while importing the data for one of my clients but at that time I was very new to Axapta. Then what i did is, that i have splitted my csv file into multiple files i.e. at an interval of 2000 records. And had imported the data. Jagjeet

It is a recommended that you don’t use container when working with large number of record. A quote from Developers guide:


One major difference between temporary tables and containers is that data in containers are stored sequentially, and thus retrieved sequentially, while a temporary table allows you to define indexes to speed up data retrieval. This means that containers provide slower data access if you are working with large numbers of records. However, if you are working with only a few records, you should use a container. Another important difference between temporary tables and containers, is when using a temporary table in a method call, the information is passed by reference, while containers are passed by value. This means that if you are using a container as a parameter in a method call, it will be pushed on the system stack. If you are keeping many records in a container, and then pass it as a parameter, it will be pushed on the internal system stack. If your computer has a limited amount of memory, this causes the computer to start swapping part of the memory space to the disk, which slows down the execution of your application. In this case you should use a temporary table instead of a container.

why don’t you use the RecordInsertList instead??