﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2005 / Development  / Index on BIT column / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Wed, 22 May 2013 13:22:45 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Index on BIT column</title><link>http://www.sqlservercentral.com/Forums/Topic986958-145-1.aspx</link><description>In SQL 2008, a filtered index on one or another of the values in a bit column, can make a HUGE difference in performance.In 2005 and earlier, just don't make it the leading edge of the index, and it should help, but not quite as much.</description><pubDate>Tue, 15 Feb 2011 10:44:18 GMT</pubDate><dc:creator>GSquared</dc:creator></item><item><title>RE: Index on BIT column</title><link>http://www.sqlservercentral.com/Forums/Topic986958-145-1.aspx</link><description>i agree with shian.  i've actually had instances where indexing on a bit field was extremely useful - though common wisdom suggests they may be more overhead than they are worth.  test both with and without.</description><pubDate>Tue, 15 Feb 2011 09:32:32 GMT</pubDate><dc:creator>Deb Anderson</dc:creator></item><item><title>RE: Index on BIT column</title><link>http://www.sqlservercentral.com/Forums/Topic986958-145-1.aspx</link><description>I've seen instances where an index on boolean field is useful.  If there is a large discrepancy between the number of 0's and 1's, and you're searching for the the smaller of the two, an index may work well.E.g.: If [font="Courier New"]IsDeleted[/font] is set to 1 during online processing and then all entries with IsDeleted=1 are deleted by a script that gets run during off-hours, I'd expect the total number of rows where [font="Courier New"]IsDeleted=1[/font] to be small.  In this case, if your [font="Courier New"]WHERE[/font] clause filters on [font="Courier New"]IsDeleted=1[/font], you're likely to get seeks rather than scans.  On the other hand, if your [font="Courier New"]WHERE[/font] clause filters on [font="Courier New"]IsDeleted=0[/font], it still has to look through the majority of rows that might otherwise be returned, so you'll get scans.Like GilaMonster said, though, it's unlikely that an index on a boolean, all by itself, is going to help you in any significant way.  It's possible that adding it to existing indexes might help.</description><pubDate>Tue, 15 Feb 2011 08:37:43 GMT</pubDate><dc:creator>shian_lineage2</dc:creator></item><item><title>RE: Index on BIT column</title><link>http://www.sqlservercentral.com/Forums/Topic986958-145-1.aspx</link><description>An index just on that column will probably not be useful. What you'll likely need to do is create indexes for the various queries and ensure that the IsDeleted is part of each index.If you can post a couple of example queries I can probably help you further.</description><pubDate>Thu, 16 Sep 2010 01:27:14 GMT</pubDate><dc:creator>GilaMonster</dc:creator></item><item><title>Index on BIT column</title><link>http://www.sqlservercentral.com/Forums/Topic986958-145-1.aspx</link><description>Hi All,      I have around 200+ tables in database and all the tables have column with the name IsDeleted   which is of datatype bit. And we are using this for logical deletion, ie; if an record deleted we are updating the value 1 for IsDeleted columnand while fetching we will select only the records with 0 in IsDeleted column and we are using this column in every select statement for each table  .Now my question is whether i have to create index on this column for all tables? If yes how the performance will be gained?Thanks in Advance</description><pubDate>Thu, 16 Sep 2010 00:55:54 GMT</pubDate><dc:creator>ningaraju.n</dc:creator></item></channel></rss>