Board index » delphi » View, Stored Procedure or Join in a TQuery

View, Stored Procedure or Join in a TQuery

Hi all,

I am trying to improve performance in my Delphi 3 App running of MS
SQLServer 6.5.  I have a TQuery that currently queries 3 tables in a
standard join type situation.  Everyting works ok, but the speed could be
better I think.  Currently the first read of 88 rows (putting them in a
dbgrid) takes about 3 seconds, and all subsequent reads about 1 second.
Surely with such a small number of rows I could make it more efficient, as I
only expect the number of rows to increase over time and so the time taken
will no doubt increase.  So I tried putting the join in a stored procedure
and called that from the app without much noticeable difference.  Trying a
different approach I built the join as a view and tried selecting off that
again with very similar results.  What I really want to know is what is the
optimal approach of obtaining a read only dataset based on two or more

Thanks for any imput,



Re:View, Stored Procedure or Join in a TQuery

Define indexes, foreign keys.
Without index, the server does sequential scan for joined tables.

Robert Cerny
Remove both qwe when replying

No questions via email, unless explicitly invited.

Other Threads