🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #2080

Re: Accessing highest auto number

#2080
From: Ted Byers
Date: Thu, 04 Dec 2003 19:07
48 lines
3842 bytes
"Kasper Larsen" <kb_larsen@hotmail.com> wrote in message
news:3fcf8077@newsgroups.borland.com...
> Hi Ted
> Since it is a read only DB you might be able to use a solution I've used
> with success :
> I create a struct from the field definitions for each table I need. Then I
> simply read all rows into a stl::vector<struct>. When I need to analyse
the
> data I use the vectors and it is a factor 5 faster then reading the Access
> db. I guess this indicates that the real bottleneck must be the disc
access.
>
Or it may be the way SQL statements are processed.  I modified my SQL along
the lines I suggested to Simon and found an improvement in performance by a
factor of about 50.

FWIW, I was going to go the route you suggest if my modification of my SQL
didn't give a sufficient improvement in performance.  I went the route of
modifying the SQL first, though, since that required a change in only one
function while using a vector of structs or classes would have had
ramifications throughout my program.  The concern I'd have with that is
that, ignoring the minimal overhead of the vector, this option would create
an object in excess of 3.35 MB in size, and in any particular instance, only
a tiny fraction of this would be used (typically less than 0.5%).  The
database in question has nutritional content for 125 nutrients in close to
6700 foods; and I'd like to see it grow to cover the more exotic (to north
american taste) foods.

I am rather pleased.  This program is ready for beta testing, and allows the
user both to enter and store recipes and to analyse recipes for their
nutritonal value, and to create a menu plant for a week which the user can
alter to take into account the nutritional requirements of each member of
the user's family.  I am planning a premium edition which will allow the
user to keep a diary of what has been eaten when, along with health related
information such as exercise periods/intensity, weight, blood sugar levels
(if the user's family includes a diabetic who tests this), and any disease.
Another difference between this version and the planned premium version is
that while this version allows the user to make as many recipe databases as
desired, only one can be loaded at a time, and the premium version will
allow as many recipe databases to be loaded as the user wishes.

My only worry is whether or not a program developed on W2K with Office 2K,
and the latest MDAC, will run OK on other flavours of Windows.

Cheers,

Ted
Technical Details
Message-ID: <3fcf86dc$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newshosting.com!news-xfer2.atl.newshosting.com!63.223.6.99.MISMATCH!c03.atl99!chi1.webusenet.com!news.webusenet.com!cyclone1.gnilink.net!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <vIB+nCAzsMz$IwBT@courtlands.demon.co.uk> <3fccec42$1@newsgroups.borland.com> <rUI$wAAUogz$IwA9@courtlands.demon.co.uk> <3fce1ab8@newsgroups.borland.com> <0x0o5DAm3lz$Iww1@courtlands.demon.co.uk> <3fcea31a$1@newsgroups.borland.com> <3fcf8077@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,3afd7f6873225c1f
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2003-12-04 11:25:50 PST
From: "Ted Byers" <r.ted.byers@sympatico.ca>
Newsgroups: borland.public.cppbuilder.database.ado
References: <vIB+nCAzsMz$IwBT@courtlands.demon.co.uk> <3fccec42$1@newsgroups.borland.com> <rUI$wAAUogz$IwA9@courtlands.demon.co.uk> <3fce1ab8@newsgroups.borland.com> <0x0o5DAm3lz$Iww1@courtlands.demon.co.uk> <3fcea31a$1@newsgroups.borland.com> <3fcf8077@newsgroups.borland.com>
Subject: Re: Accessing highest auto number
Date: Thu, 4 Dec 2003 14:07:08 -0500
Lines: 50
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 65.95.242.19
Message-ID: <3fcf86dc$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1070565084 65.95.242.19 (4 Dec 2003 11:11:24 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newshosting.com!news-xfer2.atl.newshosting.com!63.223.6.99.MISMATCH!c03.atl99!chi1.webusenet.com!news.webusenet.com!cyclone1.gnilink.net!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail