Board index » delphi » indexes

indexes

hi
can we give an index to a query to get  data faster ? (interbase 6.0 and
suppose there is one table and 10 fields and 3 indexes)
thanks
 

Re:indexes


Quote
PomeleN wrote:
> can we give an index to a query to get  data faster ? (interbase 6.0 and
> suppose there is one table and 10 fields and 3 indexes)

        You put indices on tables, not queries.  IB will automatically use the
index if it helps in your query.  You can confirm the index is being
used by looking at the PLAN which IB generates for your query.

        HTH,

        -Craig

--
  Craig Stuntz (TeamB) Vertex Systems Corp. Columbus, OH
      Delphi/InterBase WebLog: http://delphi.weblogs.com
      InterBase PLANalyzer (Free IB optimization tool):
           http://delphi.weblogs.com/IBPLANalyzer

Re:indexes


The IB SELECT syntax has a feature called PLAN which allows
you to enter the order for selecting tables, indexes and
tasks. This feature is, however, very difficult to use and
not reliable at all if you rebuild the database.

I never use PLAN in applications and rarely use it in
testing and then only when I can copy and paste.

Performance in an application is best managed through, table
design, indexes and creative writing of where clauses.

Phil Cain

Other Threads