🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.database.multi-tier
3 messages
3 total messages Started by Quentin Hurt Fri, 02 Feb 2001 12:21
speeding up my app
#865
Author: Quentin Hurt
Date: Fri, 02 Feb 2001 12:21
16 lines
1440 bytes
Hi, please can someone give me advise on how to make my application run and
load faster.  I have developed a two tiered database application (databases
on the server & and an application on each client) and use eight different
paradox tables.  I realise that opening and closing tables takes time but
what is the general rule of thumb for keeping process times short i.e.. open
them all on start up or when necessary?  (There are about 12 client
machines)  Also. any other coding tips will be useful.

Many thanks
Nick

--
ECOSERV
www.ecoserv.co.za
(086) 123-0000
Direct: (031) 710-1864
Re: speeding up my app
#866
Author: Neo
Date: Sun, 04 Feb 2001 15:41
26 lines
1632 bytes
Tip: Do not use TQuery->RecordCount - it takes too much Client process time



Quentin Hurt <hurt@ecoserv.co.za> wrote in message news:3a7aa713_2@dnews...
> Hi, please can someone give me advise on how to make my application run
and
> load faster.  I have developed a two tiered database application
(databases
> on the server & and an application on each client) and use eight different
> paradox tables.  I realise that opening and closing tables takes time but
> what is the general rule of thumb for keeping process times short i.e..
open
> them all on start up or when necessary?  (There are about 12 client
> machines)  Also. any other coding tips will be useful.
>
> Many thanks
> Nick
>
> --
> ECOSERV
> www.ecoserv.co.za
> (086) 123-0000
> Direct: (031) 710-1864
>
>
Re: speeding up my app
#867
Author: Jerry Bloomfield (TeamB)
Date: Sun, 04 Feb 2001 17:12
51 lines
3846 bytes
On Fri, 2 Feb 2001 14:21:50 +0200, "Quentin Hurt" <hurt@ecoserv.co.za>
wrote:

>Hi, please can someone give me advise on how to make my application run and
>load faster.  I have developed a two tiered database application (databases
>on the server & and an application on each client) and use eight different
>paradox tables.  I realise that opening and closing tables takes time but
>what is the general rule of thumb for keeping process times short i.e.. open
>them all on start up or when necessary?  (There are about 12 client
>machines)  Also. any other coding tips will be useful.

My first suggestion to you is that you should be using a TQuery component
rather than a TTable components.  You do not explicitly say which you are
using,  so I am sorry if you already are using TQuery components.

Next,  I will suggest that you use a TDatabase component to connect your
TQuery to the actual "database".  When you use a TDatabase,  use Persistent
Connections (KeepConnection = true).  In my experience,  the biggest
performance hit an application takes with a database is initializing the
connection to the database.  By using the persistent connections,  you
reduce this to only the times when your TDatabase is set Active.

If you are using a TQuery component,  only select the records you need,
using an appropriate "WHERE" clause in your SQL command.  Pulling
additional records into your application will only slow you down by
increasing the number of records you have to process,  as well as
increasing the virtual memory required to hold the results of your TQuery.
If you can build an index over the fields you will be querying against,  it
can also improve your "lookup time",  but this can have a negative impact
on your insert/update time,  so YMMV with this one.

When using a TQuery,  avoid using any of the TQuery methods which cause a
"Fetch All" to be executed,  as this will cause the TQuery to pull in the
entire results set before you can continue processing.  One example of
something to avoid for this reason is the RecordCount property,  as it
needs to get all of the rows in the result to know how many are there.

Using the above information,  I was able to show a co-worker how to improve
his performance in one application at the office.  He was using a TTable
which would take about 2 minutes to open or refresh,  but he could Locate
to the record he wanted in about 200 milliseconds.  By converting to a
TQuery (using persistent connections via a TDatabase) we reduced the
initial open to about 25 seconds,  and the TQuery would return the result
in about 250 milliseconds.  This was querying against an Access97 MDB file
on a local hard disk using ODBC on a table with about 1.25 million rows.

Jerry Bloomfield (TeamB)
-- 
http://www.teamb.com                                      JersWork@wwa.com
Please do *NOT* send private e-mail without prior permission (my anti-spam 
filters will probably just delete it anyway <g>)
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