Article View: borland.public.interbase.opensource
Article #165Re: Slow fetching of large record table
From: Bill Todd
Date: Tue, 13 Sep 2005 02:27
Date: Tue, 13 Sep 2005 02:27
43 lines
2882 bytes
2882 bytes
> Yes, I'm doing a First and then a while not eof do processing and > next loop. I'm wondering why it takes so long. CPU load stays under > 1% average at all times (peaks are 3 or 4 %) Obviously, the CPU is > more waiting then running. Is there not a way to make it more CPU > intensive? I should think 100 minutes at 1% could be done in 1 > minute at 100%? I am confused. What does the CPU usage have to do with this? The process of moving records from the server to the client is I/O bound. The constraint is how fast data can be moved over the network cable. The CPU is doing nothing because it is waiting for the I/O to take place. > > > Either of the following approaches should be faster. > > > > 1) Read the flat file one row at a time and SELECT the matching row > > from the database using the primary key. Then process the record on > > the client. To select the row from the database use an IBSQL > > component with a parameterized SELECT. > > So, you think running 200 000 separate selects should execute faster? If the flat file contained a subset of the records then yes, I do. > > 2) Convert the flat file to fixed length format. Create an external > > table in the database that matches the fixed lenght file. INSERT the > > data from the external table into a table in the database (this > > would be a good place to use a temporary table if you are using IB > > 7.5.1). > > I'm using 6.02 (the freeware version). > Can this file for filling the table come from a stream? I preprocess No. It must be a fixed length file. > > You mean with a stored procedure? Yes. The way to improve performance is to drastically reduce the amount of data moved across the network. Bill Todd
Technical Details
Message-ID:
<4326391d@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!newsfeed00.sul.t-online.de!t-online.de!195.92.193.196.MISMATCH!nntp.theplanet.net!inewsm1.nntp.theplanet.net!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<43256774$1@newsgroups.borland.com> <4325d2a4$1@newsgroups.borland.com> <43261888$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 106772,9d3ef49be1dec05b
X-Google-Attributes: gid106772,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Bill Todd" <no@no.com>
Subject: Re: Slow fetching of large record table
Newsgroups: borland.public.interbase.opensource
References: <43256774$1@newsgroups.borland.com> <4325d2a4$1@newsgroups.borland.com> <43261888$1@newsgroups.borland.com>
Organization: The Database Group, Inc.
User-Agent: XanaNews/1.17.5.9
X-Face: ":yn4zt^A_dn>6~{YJmu^B\'4w)e:apPM\VC=Dvf&*tASxX9|BYczkFd$xr.$vNSZ[3Uobr p]c4\+\l){!WQI.$]veP({HLd;CDYH?iN
NNTP-Posting-Host: 216.207.211.19
Message-ID: <4326391d@newsgroups.borland.com>
Date: 12 Sep 2005 19:27:41 -0700
X-Trace: newsgroups.borland.com 1126578461 216.207.211.19 (12 Sep 2005 19:27:41 -0700)
Lines: 44
X-Authenticated-User: btodd
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!newsfeed00.sul.t-online.de!t-online.de!195.92.193.196.MISMATCH!nntp.theplanet.net!inewsm1.nntp.theplanet.net!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail