🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.database.multi-tier
5 messages
5 total messages Started by Martin Pennings Tue, 28 Nov 2000 00:00
Very slow database
#764
Author: Martin Pennings
Date: Tue, 28 Nov 2000 00:00
17 lines
1188 bytes
Hello!

I've made an application that reads in a huge text file. This textfile
contains information which I put into a flat-file database.
I use the Paradox 7 driver for this.
The textfiles that have to be read are 670Kb, this converts to about 3700
records.
The first lets say 1000 records are read and converted very fast, the other
2700 records take about 30 minutes!
To speed things up, I deleted all indexes, and I putted the proces in a
thread. This had no effect.
Does anyone know how I can speed up this proces?
I think the problem is that every time a new record is inserted, the
application runs through the entire database. What can I do about this??
Thanks in advance!

Martin
Re: Very slow database
#767
Author: Mark Vejvoda
Date: Wed, 29 Nov 2000 00:00
26 lines
1452 bytes
Try doing it all in once transaction: StartTransaction... import the file,
then Commit.

"Martin Pennings" <anolis@wish.net> wrote in message
news:3a240af5_2@dnews...
> Hello!
>
> I've made an application that reads in a huge text file. This textfile
> contains information which I put into a flat-file database.
> I use the Paradox 7 driver for this.
> The textfiles that have to be read are 670Kb, this converts to about 3700
> records.
> The first lets say 1000 records are read and converted very fast, the
other
> 2700 records take about 30 minutes!
> To speed things up, I deleted all indexes, and I putted the proces in a
> thread. This had no effect.
> Does anyone know how I can speed up this proces?
> I think the problem is that every time a new record is inserted, the
> application runs through the entire database. What can I do about this??
> Thanks in advance!
>
> Martin
>
>
>
Re: Very slow database
#769
Author: Martin Pennings
Date: Thu, 30 Nov 2000 00:00
35 lines
1411 bytes
Thanks, but how do I do that?

The following is the structure of my program:


     String fill
     fstream FileA;
     FileA.open(Mainform->OpenDialog->FileName.c_str(),ios::in);

    if (bestand.is_open())
       {
            for(;;)
            {
            DataModule->Table->Insert();

             DataModule->Table->FieldValues["some field"]=fill.c_str();
             FileA >> fill.c_str()

            // there are 18 fields that are loaded   the same way

            DataModule->Table->Post();
            if(bestand.eof()) break;
           }
        }

    FileA.close();

How can I put all this in one transaction?



"Mark Vejvoda" <mvejvoda@soft-haus.com> schreef in bericht
news:903ha9$jcd8@bornews.inprise.com...
> Try doing it all in once transaction: StartTransaction... import the file,
> then Commit.
Re: Very slow database
#771
Author: Mark Vejvoda
Date: Thu, 30 Nov 2000 00:00
65 lines
2241 bytes
      String fill
      fstream FileA;
      FileA.open(Mainform->OpenDialog->FileName.c_str(),ios::in);

     if (bestand.is_open())
        {
            myDatabaseComponent.StartTransaction();
            for(;;)
             {
             DataModule->Table->Insert();
              DataModule->Table->FieldValues["some field"]=fill.c_str();
              FileA >> fill.c_str()

             // there are 18 fields that are loaded   the same way

             DataModule->Table->Post();
             if(bestand.eof()) break;
            }

            myDatabaseComponent.Commit();
         }

     FileA.close();

"Martin Pennings" <mpennings@pentis.nl> wrote in message
news:3a260a0e_2@dnews...
> Thanks, but how do I do that?
>
> The following is the structure of my program:
>
>
>      String fill
>      fstream FileA;
>      FileA.open(Mainform->OpenDialog->FileName.c_str(),ios::in);
>
>     if (bestand.is_open())
>        {
>             for(;;)
>             {
>             DataModule->Table->Insert();
>
>              DataModule->Table->FieldValues["some field"]=fill.c_str();
>              FileA >> fill.c_str()
>
>             // there are 18 fields that are loaded   the same way
>
>             DataModule->Table->Post();
>             if(bestand.eof()) break;
>            }
>         }
>
>     FileA.close();
>
> How can I put all this in one transaction?
>
>
>
> "Mark Vejvoda" <mvejvoda@soft-haus.com> schreef in bericht
> news:903ha9$jcd8@bornews.inprise.com...
> > Try doing it all in once transaction: StartTransaction... import the
file,
> > then Commit.
>
>
>
Re: Very slow database
#776
Author: Martin Pennings
Date: Sat, 02 Dec 2000 00:00
2 lines
620 bytes
Thanks!
It works!
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads