Skip to Content
author's profile photo
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 comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

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 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