Re: [ib-support] Tables and queries in InterBase/Firebird
Author
Woody
Post date
2001-07-30T16:39:08Z
----- Original Message -----
From: "Stevio" <redeagle@...>
To: "IB Support" <ib-support@yahoogroups.com>
Sent: Monday, July 30, 2001 10:19 AM
Subject: [ib-support] Tables and queries in InterBase/Firebird
> What is better to use with InterBase? Tables or queries? I know a lot of
the
> time it can depend on what you're doing, but in general, for simple
searches
> (with maybe a few joins), for adding, editing and deleting records, which
> would you recommend?
>
Everything can be accomplished using queries with a little extra effort.
Tables "may" be useful in certain situations such as a drop down list but it
can usually be converted to using a query with a little time and effort.
That's what to strive for when using SQL back ends.
> I read the following in an article called: "InterBase for Desktop Database
> Users" from the Borland Community web site.
> -------
> Not only must the design of your applications change but so must the
> components you use to build them. Since SQL servers, such as InterBase,
are
> designed to execute SQL statements well you will get the best performance
> doing everything with SQL and that means using TQuery. TTable was designed
> to work well with navigational databases like Paradox and DBase. While you
> can use TTable with Interbase there is a lot of overhead since the BDE
must
> not only fetch the data but also the metadata that describes the fields
and
> their types. You can see the additional SQL statements that the server
must
> execute using SQL Monitor. There is also overhead in using TTable methods,
> such as FindKey and Locate, because the BDE must translate these into SQL
> and send the SQL to Interbase. To illustrate the difference let's look at
> the sample QRY.DPR project that accompanies this paper.
> -------
>
> Would you agree with what is said here?
Yes, this is exactly what happens. Anyone who has converted an app from
desktop database style to SQL based style will tell you the same thing. Most
people who still use tables when using something like Interbase do it
because of time constraints in changing things, IMO.
>
> I had a colleague in a former job that used to always go on about how
> overused and unnecessary live queries were in most situations. Would you
> agree? This guy knew his stuff as far as Delphi and Interbase were
> concerned, whereas I am a beginner.
>
Your friend is wrong, IMHO. Queries execute fast and when built correctly,
provide a more accurate reflection of what you are doing at the time.
Obtaining only the portions of data that you need limits the amount of
resources you use at any given time. Also, when working with transaction
based systems, you want to keep the data within a transaction to a minimum
to reduce the amount of work needed on the server side of things.