This paper describes the improvement of two versions of SQL2005 and SQL2000 from four aspects, such as database design, development and DBA management.
First, the database design aspect
1. type of field.
The introduction of the varchar (max) \nvarchar (max) type greatly improves the efficiency of programming, and it is a bright spot to use string functions to manipulate CLOB types. But this raises the old question of discussion of varchar and char efficiency. In the end how to allocate varchar data, will there be large-scale fragmentation? Does fragmentation cause efficiency problems? These are the things that need to be explored further.
varbinary (max) Instead of image also makes the field types of SQL Server more compact and uniform.
XML field types better address the operation of XML data. XQuery is really good, but the individual doesn't have a crush on it. (The CSDN developers should be quite familiar with it!) )
2, the foreign key cascade more can expand.
Perhaps most of the peers in the design of OLTP systems are unwilling to establish foreign keys, all through the program to control the integrity of parent-child data. However, in the development of debugging and OLAP environments, foreign keys can be established. Set NULL and set DEFAULT properties are added to the new version to provide good cascading settings.
3, index additional fields.
This is a nice new feature. Although the additional fields of the index are not efficient in index key values, the relative efficiency of mapping to the datasheet is much higher. I have done experiments, and in my experimental environment it is more than 30% more efficient to map to the table.
4, the calculation of the persistence of the field.
The original calculated field is actually similar to the virtual field. It's just a matter of management, but not much performance improvement. However, SQL2005 provides a persistence of calculated fields, which improves query performance, but adds to the burden of insert and update. Be cautious with OLTP. OLAP can be used on a large scale.
5, Partition table.
The partition table is a bright spot! The partition table also shows Microsoft's confidence in making SQL Server bigger and stronger. There is a lot of information, not in detail here. But it's important to know that the SQL Server2005 table is now the default for partitioned tables. Because it supports this feature of the sliding window. This feature is useful for the processing of historical data and real-time data.
But the point that needs to be noticed is also a problem that I found in the process of using. After the function->schema->table is established, if a clustered index without an explicit declaration is established on an existing partitioned table, the partitioned table automatically becomes a non partitioned table. This makes me wonder. If you think that my non partitioned index is not able to partition the screwdriver.
The efficiency of partitioned tables is certainly a matter of concern to all of us. In my experiment, the query (filtering) efficiency in the partitioning field is higher than the same statement for the unpartitioned table. However, if you query by non-partitioned fields, the efficiency is lower than the same statement for the unpartitioned table. But as the amount of data increases, the cost gap tends to decrease and become equal. (5 million order of magnitude only 10% or so)