Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 15 total
Thread Table Versus Query
Fri, Aug 17 2007 1:29 PMPermanent Link

Scott Woods
For finding a record in a table, is it fast to use direct table access or a query?  Is there a general set of rules when a query should be used over a table and vice versa?

Thanks
Fri, Aug 17 2007 1:51 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Scott,

<< For finding a record in a table, is it fast to use direct table access or
a query?  Is there a general set of rules when a query should be used over a
table and vice versa? >>

It really depends upon your needs, but the fastest way is TEDBTable.FindKey,
followed by TEDBTable.Locate (using an index), TEDBTable.Filter, TEDBQuery
(sensitive result set), and finally TEDBQuery (insensitive result set).

--
Tim Young
Elevate Software
www.elevatesoft.com

Fri, Aug 17 2007 1:55 PMPermanent Link

Scott Woods
So for a simple query like "Select * from Customers where ID = '4'" a table with an index is the way to go, but for a complexe data result where multiple tables are joined
the query is the way tp go?

Thanks
Fri, Aug 17 2007 1:59 PMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Scott


Table.FindKey is probably going to be fastest. But, you have to think local vs LAN vs WAN and fileserver vs clientserver. Or to put it another way - it depends Smiley


Roy Lambert
Fri, Aug 17 2007 2:33 PMPermanent Link

Scott Woods
OK  - lol - so in the Client - Server model, the query would be faster then the
direct table access for a "Select * from Customers" type of data access?
Fri, Aug 17 2007 2:41 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Scott,

<< So for a simple query like "Select * from Customers where ID = '4'" a
table with an index is the way to go, but for a complexe data result where
multiple tables are joined the query is the way tp go? >>

Well, the differences are very small, so usually we recommend going with
what you feel most comfortable with and works best for your application.
In other words, if you prefer SQL, then use SQL always.

--
Tim Young
Elevate Software
www.elevatesoft.com

Fri, Aug 17 2007 2:44 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Scott,

<< OK  - lol - so in the Client - Server model, the query would be faster
then the direct table access for a "Select * from Customers" type of data
access? >>

Pay no attention to the Scotsman. Smiley

Actually, with EDB C/S access the FindKey would still be faster.   But,
again, we're talking very small differences.   The important thing to
remember is that a:

SELECT * FROM MyTable

type of query with the RequestSensitive property set to True is exactly the
same as basically just opening up the table.   Likewise a:

SELECT * FROM MyTable WHERE MyColumn=1

type of query with the RequestSensitive property set to True is exactly the
same as basically just opening up the table and applying a filter to it of
'MyColumn=1';

--
Tim Young
Elevate Software
www.elevatesoft.com

Fri, Aug 17 2007 4:49 PMPermanent Link

Scott Woods
Thanks - this clarified things.
Sat, Aug 18 2007 4:01 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim


>Pay no attention to the Scotsman. Smiley

Yorkshireman living in Scotland please!

Roy Lambert
Sat, Aug 18 2007 1:32 PMPermanent Link

Dave Harrison
Tim Young [Elevate Software] wrote:

> Scott,
>
> << For finding a record in a table, is it fast to use direct table access or
> a query?  Is there a general set of rules when a query should be used over a
> table and vice versa? >>
>
> It really depends upon your needs, but the fastest way is TEDBTable.FindKey,
> followed by TEDBTable.Locate (using an index), TEDBTable.Filter, TEDBQuery
> (sensitive result set), and finally TEDBQuery (insensitive result set).
>

Tim,
   What, no ranges in EDB? Smile

Dave
Page 1 of 2Next Page »
Jump to Page:  1 2
Image