Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
202 views
in Technique[技术] by (71.8m points)

How will SQL Server query a table partitioned using a calculated field if the predicate col is a factor in the field?

Imagine you have table t where statusID is a calculated field based on status. 'Live'=1, 'Deleted'=2 and so on. t is partitioned by statusID meaning that all 1 goes into a partition, all 2 goes into another etc. Now let's query t. If I want all live records can I use WHERE status='live' or must I use where statusID=1 to take advantage of the partition?

ID val1 val2 status statusID
1 abc ABC live 1
2 xyz XYZ deleted 2
3 foo BAR archived 3
question from:https://stackoverflow.com/questions/65926550/how-will-sql-server-query-a-table-partitioned-using-a-calculated-field-if-the-pr

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...