Board index » delphi » Secondary indexes for LOCAL SQL queries...?

Secondary indexes for LOCAL SQL queries...?

Anybody know how (or whether) one can specify the use of a secondary
index in a TQuery SQL string?

The underlying table is a Paradox table, and there are two or three
dynamic parameters constraining each query.

Thanks in advance...

-------------------------------------------------------------------
Michael Philip Kaufman                          Mail: m...@panix.com
Software Design/Consulting                CompuServe: 71052,3715
28 East 10th Street  Suite 4H                  Phone: 212 529 5592
New York, NY  10003-6210                         Fax: 212 529 5001

 

Re:Secondary indexes for LOCAL SQL queries...?


In article <4cc61v$...@news1.panix.com>
           m...@panix.com "Michael Philip Kaufman" writes:

Quote
>Anybody know how (or whether) one can specify the use of a secondary
>index in a TQuery SQL string?

>The underlying table is a Paradox table, and there are two or three
>dynamic parameters constraining each query.

Generally if an appropriate secondary index exists it will be used
automatically. I have heard that there are circumstances where this
does not work correctly but have not experienced it.

--
Donald Oddy
Grove Systems Ltd.                                    0161-224 4465

Re:Secondary indexes for LOCAL SQL queries...?


In article <820972166...@grove.demon.co.uk> "Donald R. Oddy" <don...@grove.demon.co.uk> writes:

Quote
>>Anybody know how (or whether) one can specify the use of a secondary
>>index in a TQuery SQL string?

>>The underlying table is a Paradox table, and there are two or three
>>dynamic parameters constraining each query.
>Generally if an appropriate secondary index exists it will be used
>automatically. I have heard that there are circumstances where this
>does not work correctly but have not experienced it.

You cannot specify what index(es) to use.  That is purely at the discretion of
the database engine.  This is by design.

A query is intended to be a functional specification of *what* the engine is
to obtain; not a procedural specification of *how* to obtain it.

In processing the query, a portion of the database engine known as the "query
optimizer" is responsible for finding the currently-probably-most-optimal
strategy for solving the query.  This is really where different database
engine vendors compete with one another.

In the current relese of Paradox/BDE, an index must be single-field and
case-sensitive (the latter is NOT the default) in order to be used in a query.

/mr/

Other Threads