July 12, 2005 at 8:12 pm
Execution plan for "select cycleName from tbl_Cycle where dateClosed is null and deleted = 0" with an index on (dateClosed, deleted, cycleName) and [deleted] is a bit:
----------------------------------------------------------------------------------------------
|--Index Seek(OBJECT: ([Sandbox].[dbo].[tbl_Cycle].[IX_tbl_Cycle]), SEEK: ([tbl_Cycle].[dateClosed]=NULL), WHERE: (Convert([tbl_Cycle].[deleted])=0) ORDERED FORWARD)
Execution plan for the same query if [deleted] is changed to tinyint:
----------------------------------------------------------------------------------------------
|--Index Seek(OBJECT: ([Sandbox].[dbo].[tbl_Cycle].[IX_tbl_Cycle]), SEEK: ([tbl_Cycle].[dateClosed]=NULL AND [tbl_Cycle].[deleted]=0) ORDERED FORWARD)
The plans are different, but are both seeks instead of scans. The records you need will be at the beginning of the index, so I would be surprised if the difference is significant.
Viewing post 16 (of 15 total)
You must be logged in to reply to this topic. Login to reply