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
211 views
in Technique[技术] by (71.8m points)

database partitioning - Sql server table: create partitions?

I have an sql datadas, where among other things I have a prices table, where I have one price per product per store.

There are 50 stores and over 500000 products, so this table Will easily have 25 to 30 million records.

This table is feed daily over night with prices updates, and has huge read operations during day. Reads are made with readonly intent.

All queries contain storeid as part of identifying the record to update or read.

I m not able yet to determine how this Will behave since I m expecting external supply of prices but I m expecting performance issues at least on read operations, even though indexes are in place for now...

My question is if I should consider table partition by store since it is always part of queries. But then I have indexes where storeid is not the only column that is part of the index.

Based on this scenario, would you recommend partitioning? The alternative I see is having 50 tables one per store, but it seems painless and if possible to avoid the better

question from:https://stackoverflow.com/questions/65876439/sql-server-table-create-partitions

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

1 Answer

0 votes
by (71.8m points)

if I should consider table partition by store since it is always part of queries

Yes. That sounds promising.

But then I have indexes where storeid is not the only column that is part of the index.

That's fine. So long as the partitioning column is one of the clustered index columns, you can partition by it. In fact with partitioning, you can get partition elimination for a trailing column of the clustered index, then a clustered index seek within the target partition.


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

...