Re: New to ADO with Delphi
- From: "Jared Sherman" <Jared.Sherman@xxxxxxxxxx>
- Date: Mon, 14 May 2007 15:49:11 -0700
That is an excellent insight. All my quick lookup queries or tables could be
server side, but the items where I need to show data or possibly perform
updates I could run client-side in a query control.
Thanks for the advice.
Jared Sherman
"Vassiliev V. V." <support@xxxxxxxxxxxxxxx> wrote in message
news:4645f473@xxxxxxxxxxxxxxxxxxxxxxxxx
There is another reason to use server-side cursor: when you analyze a
large query - i.e. you make a query, traverse it without show in UI, make
some calculation and close it as soon as possible. Client-side cursor
anyway internally opens query with server-side cursor, traverses it and
caches values, so if all you need is to quickly traverse query results and
do not want large caches, server-side cursor will be fine and it will be
more effective than client-side cursor. However if you want to hold query
results (to display them in UI or for other reason) client-side cursor
should be used.
//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)
"Brian Hollister" <bhollisterATfuturaintlDOTcom> ñîîáùèë/ñîîáùèëà â
íîâîñòÿõ ñëåäóþùåå: news:4645e9d6$1@xxxxxxxxxxxxxxxxxxxxxxxxx
Jared,
The first thing that sticks out to me is that using server-side cursors,
if
you leave the set open you may possibly create deadlock situations. I
don't
have a ton of experience with this but i have doen it for a little while
now, > 3 years. I feel that the only time you should be using server-side
cursors is when you are writing an application that runs when noone else
is
there interfacing with the db. Server-side cursors held open will create
and
hold locks on tables. While these locks are there noone else will be able
to
change anything. I prefer the optimistic approach to this and as advised
before pull only what i need and deal with failures writing back on a as
needed basis.
Hth,
Brian Hollister
--
Got a big event coming up? Let us
help coordinate your event. For more
visit www.kissemgoodbye.com
"Vassiliev V. V." <support@xxxxxxxxxxxxxxx> wrote in message
news:4640b07e@xxxxxxxxxxxxxxxxxxxxxxxxx
If you use these queries in UI and hold them open quite longtime (notto
just
open, traverse/make some calculations and close), all memory you save on
client will be allocated on server.
You should limit number of returned rows in your application and not try
handle all table rows form one query.much
//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)
"Jared Sherman" <Jared.Sherman@xxxxxxxxxx> ñîîáùèë/ñîîáùèëà â íîâîñòÿõ
ñëåäóþùåå: news:46409d46$1@xxxxxxxxxxxxxxxxxxxxxxxxx
Whoa, that really helps. Thanks a ton. I tried a few different ways.
Dataset is a 1.5 Gig SQL Server database.
I opened 8 tables for the following tests. The values showen are how
http://homepages.borland.com/ccalvert/TechPapers/Delphi/ADOBasics/ADOBasics.htmlmemory was showen being used in Task Manager by my application.
Tables in Client Mode: 845,868 KB
Tables in Server Mode: 10,320 KB
Queries in Client Mode: 288,044 KB
Quereis in Server Mode: 9,008 KB
The Queries in Server mode are by far the best setup, but I think I'm
going to do a mix of tables and queries only in server mode.
Do you guys see any downsides to this approach?
Thanks again for your help
Jared Sherman
"Brian Hollister" <bhollisterATfuturaintlDOTcom> wrote in message
news:463babf0@xxxxxxxxxxxxxxxxxxxxxxxxx
Hi,
It's my belief that the first thing you should eliminate is any
TADOTables
that you can. These are loading every record in the table. Try to
stick
to
queries that contain where clauses so that your selectivity can be as
high
as possible. This will result in a big performance boost.
Here's a couple of links that may be helpful:
http://delphi.about.com/od/database/a/adodelphi.htm
database
http://dn.codegear.com/delphi/database/sqlservers
hth,
brian
--
Got a big event coming up? Let us
help coordinate your event. For more
visit www.kissemgoodbye.com
"Jared Sherman" <Jared.Sherman@xxxxxxxxxx> wrote in message
news:463ba00b$1@xxxxxxxxxxxxxxxxxxxxxxxxx
I'm currently using Delphi 6. I'm in the process of converting overmaintain,
to
Delphi 2006, but for now this project that I've been asked to help
must remain in Delphi 6. It is connecting to a SQL Server 2000
heardthat
is about 1 GB in size. The program was written with a variety ofTADOTables
and TADOQueries. The startup routine of the application opens ato
series
of
TADOTables. Because of the size of the database this application can
grow
be over 500,000 KB in the task manager. When I run the applicationcrash.
it
has
been known to breach Microsofts 2 GB limit for a process and it will
What I'm trying to do is find the right way to optimize this code
for
the
short time. Most the TADOTables are set with the CursorLocation =
clUseClient. They also have the TableDirect setting to False. I've
TADOTablesthat changing to CursorLocation=clUseServer and TableDirect=Truehelp,
would
but evertime I attempt that I get errors like: "Table cannot be
found"
or
something like that.
Can someone give a noob some tips on how to better use these
and
TADOQueries so that this application will stop being such a beast?
Thanks in advance for your help.
Jared Sherman
.
- References:
- New to ADO with Delphi
- From: Jared Sherman
- Re: New to ADO with Delphi
- From: Brian Hollister
- Re: New to ADO with Delphi
- From: Jared Sherman
- Re: New to ADO with Delphi
- From: Vassiliev V. V.
- Re: New to ADO with Delphi
- From: Brian Hollister
- Re: New to ADO with Delphi
- From: Vassiliev V. V.
- New to ADO with Delphi
- Prev by Date: Either BOF or EOF is True...
- Next by Date: Re: TXT delimited (;) filles problem
- Previous by thread: Re: New to ADO with Delphi
- Next by thread: Re: New to ADO with Delphi
- Index(es):
Relevant Pages
|
Loading