Re: SQL Index Problem



How are you querying an index?
An SQL-index cannot be specified in an SQL statement.
In this way assume you created a DDS described logical file and
specify it in the SQL statement.

The query optimizer does not care about any access paths stored in an
DDS described logical file (in the first step of optimization). In the
first step the query optimizer analyses the specified files and
rewrites the SQL statement based on the physical files (or SQL
tables).

After having rewritten the SQL statement all access paths built over
the physical files or SQL tables are searched and extimated. The
optimizer decides which access path will be used or if a table scan is
the fastest way to return the requested data.

The Optimizer uses a table scan because this is the fastest way to
access the data.

In this way:
If you want to get the data in a predefined sequence add an order by
clause to your query.
If the sequence of the returned data does not matter, do not add an
order by clause.
With an order by clause sometimes temporary objects (such as Hash
Tables) will be built and filled with the returned data. After the
temporary stored data will be sorted. This additional (unnecessary)
sort will waste some query time.

Also all queries, where DDS described logical files are specified must
be executed by the old (classic) query engine. The rerouting to the
CQE may cost between 10 and 15 % of performance.

And all enhancements introduced since release V5R3 can only be used
with the newer (SQL) Query Engine SQE.

Birgitta
.



Relevant Pages

  • Re: Help with using form text box to change a query criteria
    ... What do you mean by "run an SQL statement to do this", ... conditional statements to my query. ... it can not be used to specify the comparison operator. ...
    (microsoft.public.access.queries)
  • Re: Can I create an index on a view?
    ... Creating a logical file won't help, even though in a logical file keys, ... If you specify a logical file in an select statement, ... physical files (or SQL tables) and the information from the logical ... the SQL statement gets rewritten by replacing the ...
    (comp.sys.ibm.as400.misc)
  • Re: Make a query in VBA code
    ... You have to specify which one you want by adding the table ... I try to make a code in the VBA to run a retest query. ... your SQL statement. ... VBA code ...
    (microsoft.public.access.modulesdaovba)
  • RE: Access query in VBA
    ... Mine is a little more advanced in that you dont ... specify the query but rather the SQL statement that generates the query ...
    (microsoft.public.excel.programming)
  • Re: Error using " in .open with ADODB.Recordset
    ... recordset but I'm getting hung up on the SQL statement. ... query that has a string as a condition. ... Dim mrk As String ...
    (microsoft.public.data.ado)