Skip to Content
author's profile photo Former Member
Former Member

Database Hint (%_HINT) to force a full table scan

Hi All,

I need to implement a database hint so that the SELECT statement ALWAYS does a full table scan. That is, forcing a full table scan and not using any indexes.

Does anybody know how to do that and can provide an example here?

Thanks,

Johannes

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on May 04, 2011 at 07:27 AM

    Hi Johannes,

    Hi All,

    >

    > I need to implement a database hint so that the SELECT statement ALWAYS does a full table scan. That is, forcing a full table scan and not using any indexes.

    > Does anybody know how to do that and can provide an example here?

    >

    > Thanks,

    >

    > Johannes

    since hints are database dependent we need to know the database plattform you are running on.

    on ORACLE it would be:

    %_hints ORACLE 'FULL("TABNAME")'

    other databases have other hints...

    Kind regards,

    Hermann

    Add a comment
    10|10000 characters needed characters exceeded

    • Hello Johannes,

      please refer to the SAP note 133381.

      I have quickly checked with MS SQL colleague.

      Full table scan in MS SQL server is a clustered index scan with index 0. Index 0 is a table itself.

      So please use information from note 133381 to force the usage of index 0.

      I hope it helps.

      Regards,

      Yuri

      P.S. Hermann is faster 😊

      Edited by: Yuri Ziryukin on May 4, 2011 10:11 AM

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.