Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2012
    Posts
    5

    Post Unanswered: syntax for Hints in db2

    Hi Friends,

    Please help me how to apply hints in db2.

    in oracle

    select /*+Index(table1,t1indexname)*/ col1 from table;

    But in DB2 I am not able to understand how to apply hints.
    Please give me some example for my reference.

    I wanted to use index hint in db2 for a select query.

    REgards
    Pr

  2. #2
    Join Date
    Mar 2003
    Posts
    280
    Quote Originally Posted by Prabhakarrao View Post
    Hi Friends,

    Please help me how to apply hints in db2.

    in oracle

    select /*+Index(table1,t1indexname)*/ col1 from table;

    But in DB2 I am not able to understand how to apply hints.
    Please give me some example for my reference.

    I wanted to use index hint in db2 for a select query.

    REgards
    Pr
    There are no hints in db2. DB2 generally does an excellent job in choosing a sufficiently good access plan. If everything else fails you can use an optimization profile to influence the optimizer, but in your case it is probably sufficient to update statistics on the table:

    runstats on table ... with distribution and sampled detailed indexes all

    is the default if you automate runstats, and what I would start with. If runstats alone does not solve the problem have a look at statistical views and optimization level.
    --
    Lennart

  3. #3
    Join Date
    Aug 2011
    Posts
    45
    Hi,
    I have got this link, while searching for hints in db2..you can go through it.

    IBM Information Management Software for z/OS Solutions Information Center

  4. #4
    Join Date
    Mar 2003
    Posts
    280
    Quote Originally Posted by harsh.v View Post
    Hi,
    I have got this link, while searching for hints in db2..you can go through it.

    IBM Information Management Software for z/OS Solutions Information Center
    I assumed LUW, if this post regards Z my comment does not apply (I assume). For the OP, It is a good idea to indicate platform and version when asking for help.
    --
    Lennart

  5. #5
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  6. #6
    Join Date
    Nov 2011
    Posts
    334
    The only hints i know in db2 for luw is selectivity。

    Using a SELECTIVITY clause to influence the optimizer

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •