• sf.onlineforums (9/21/2013)


    Loading data by date, every week, is the main reason for redesigning partitions to be based on dates. I like your idea of generating an artificial key. Do you recommend partitioning the table on artificial key or just creating indexes would do the same thing?

    I don't recommend anything, because I know too little of your system and your requirements. I'm just tossing up ideas. They may be right, or they may be a complete disaster.

    What I can say is that using an artificial key will make your system more complex and add maintenance costs, and may also be a burden to users, if they access the database and will have to work with this key. But if this solution is needed to get acceptable performance for both loading and querying data, you may be prepared to pay the price.

    And, oh, speaking about tossing up ideas, SQL Server is able to work with partitioning in two levels, since there are both partitioned tables and partitioned views. You could have one table per supplier, each table partioned by date. Then you would have a view which unites the supplier tables, so it looks like a single table. I need to add the caveat that I have no idea how well the optimizer is able to handle the combination. And, again this is a complex solution which will increase the total cost of ownership for the system.

    [font="Times New Roman"]Erland Sommarskog, SQL Server MVP, www.sommarskog.se[/font]