CREATING INDEX ON MORE THAN ONE BOOLEAN COLUMNS

  • HI,

    All

    I have table with columns

    id primary key int,bitcolumn1 bit,bitcolumn2 bit,bitcolumn3 bit,bitcolumn4 bit,...,...bitcolumn50 bit.

    I want suggestion to create indexes to gain performance.

    on which column it should be there.(Table contains 2 millions of records)

    generally data access through id and any bitcolumn:

    select bitcolumn1 where id=1;

    select bitcolumn1 where bitcolumn1=1/0;

    same update query to change a bit value.

    My reason to post this topic is to know index on binary columns

  • Indexes on bit columns work the same way as indexes on any other column type. Have a look at this blog post.

    http://sqlinthewild.co.za/index.php/2009/01/19/index-columns-selectivity-and-equality-predicates/

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply