这个不是注释,而是hint,就是让优化器按照hint的指示选择执行计划
hint加的好,优化器选择的执行计划就好,执行当然会快了

解决方案 »

  1.   

    Hints
    You can use comments in a SQL statement to pass instructions, or hints, to the Oracle optimizer. The optimizer uses these hints as suggestions for choosing an execution plan for the statement.A statement block can have only one comment containing hints, and that comment must follow the SELECT, UPDATE, INSERT, or DELETE keyword. The following syntax shows hints contained in both styles of comments that Oracle supports within a statement block.{DELETE|INSERT|SELECT|UPDATE} /*+ hint [text] [hint[text]]... */
    or{DELETE|INSERT|SELECT|UPDATE} --+ hint [text] [hint[text]]...
    where:DELETE, INSERT, SELECT, or UPDATE is a DELETE, INSERT, SELECT, or UPDATE keyword that begins a statement block. Comments containing hints can appear only after these keywords. 
    + is a plus sign that causes Oracle to interpret the comment as a list of hints. The plus sign must follow immediately after the comment delimiter (no space is permitted). 
    hint is one of the hints discussed in this section. The space between the plus sign and the hint is optional. If the comment contains multiple hints, then separate the hints by at least one space. 
    text is other commenting text that can be interspersed with the hints.
      

  2.   

    The STAR hint forces a star query plan to be used, if possible. A star plan has the largest table in the query last in the join order and joins it with a nested loops join on a concatenated index. The STAR hint applies when there are at least three tables, the large table's concatenated index has at least three columns, and there are no conflicting access or join method hints. The optimizer also considers different permutations of the small tables.
      

  3.   

    学到了!
    楼上的两位大哥能讲讲 [TEXT]是什么东西吗?或者说这个内容是怎么规定的?从什么地方来得?
      

  4.   

    这些你可以在performance tuning中查到,只有用了正确的hint才可以提高查询速度