Baanboard.com

Go Back   Baanboard.com

User login

Frontpage Sponsor

Main

Baanboard at LinkedIn


Poll
What actions do you take to ensure compliance with the sanction/embargo lists published by the EU and the US?
don't know what you are talking about
55%
we are scanning customers, suppliers and employees using own programs on a regular basis
12%
each delivery/purchase adress is checked immediately with own programs
2%
we are using third party software for this purpose
10%
we simply don't bother
20%
Total votes: 49

Reference Content

 
Query hints overview
By patvdv at 26 Feb 2008 - 21:57

Query hints overview

Introduction

When a query is submitted to the query processor the query processor determines an evaluation plan. It creates this plan based on a fixed set of rules. An application developer may have knowledge about the data that the query processor has not and therefore he or she may be capable of determining a more efficient execution plan. For this the application developer can add hints to the query.

Hints can be added to each select query including subqueries. A hint is supplied to a query by adding a hint clause to the query statement. The hint clause is the last clause of the query.

Syntax

 <hint clause>  ::= hint <hint list>
 <hint list>    ::= <hint>
      | <hint> and <hint list>

 <hint>   ::= use index <nr list> on <table name>
 [ asc | desc ]
      | array fetching
      | no array fetching
      | array size <n>
      | all rows
      | first rows
      | buffer <n> rows
      | <string literal>
      | ordered
      | no hints

 <nr list>    ::= <n>
      | <n> ',' <nr_list>

 <n>      ::= a positive integer

 <table name> ::= the name of a table or a table name alias.
 <string literal> ::= string enclosed in double quotes

Examples

Before we go into the semantics of the hints let us first give you some examples to illustrate the syntax.

 select  tfacr200.*
 from    tfacr200
 where   _index2 = {"  1001"}
 and     {ttyp, ninv, line, tdoc, docn, lino} >= {"",0,0,"",0,0}
 order   by _index2
 as prepared set
 hint    use index 2 on tfacr200
 and     array fetching

 select  a.cuno
 from    tccom010 a
 where   a.cuno in ( select b.cuno
                     from   tfgld106 a, tccom010 b
                     where  a.cuno = b.cuno
                     hint   ordered )
 order   by cuno
 hint    buffer 100 rows

Related topics



0
No votes yet


All times are GMT +2. The time now is 01:56.


©2001-2008 - Baanboard.com - Baanforums.com