Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Making use of dates in index
Message
 
 
To
02/05/2011 21:29:53
General information
Forum:
Microsoft SQL Server
Category:
Indexing
Environment versions
SQL Server:
SQL Server 2008
Application:
Web
Miscellaneous
Thread ID:
01509138
Message ID:
01509143
Views:
40
>Some are using a numeric equivalent for a date to optimize the indexing. It is known that using a date in a SQL command is not as optimized as using only integers for example. This is especially true if you use the date field twice such as greater than and less date values. What would be the proper technique to have an equivalent integer field to represent the date field so to use it in SQL commands?
>
>I understand there is some kind of equivalent values which would also includes the hours, minutes, seconds and milliseconds.
>
>Any techniques that are better than another one in this type of support?

IMHO, index on date field (SQL Server 2008) or index on datetime field is all you need. I don't think you need to use any integer conversions, unless you build facts table.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform