Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
This query is slow
Message
From
15/10/2004 13:20:26
 
 
To
15/10/2004 11:34:34
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00951748
Message ID:
00951773
Views:
11
>I have a table called testtable. In this table have column flag with bit data type.
>When I run this query. it very slow.
>
>select * from testtable where flag=0
>
>
>How can I improve this?
>
>
>Thanks
>
>
>Jim

You have to set a index for flag, but SQL don't allow index for bit datatype.

1. define a computed field like flagOnIndex = CAST(flag AS TINYINT)
2. define a index for flagOnIndex
3. use
select * from testtable where flagOnIndex =0
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform