Resolve a bug that is updated or deleted by using comparison criteria on a SQL2K descending index I've tried it in SQL Server, both enterprise and personal, every time. :(
See my Huitie for more information:
SQL Server 7.0 does not have a problem in SQL 2000 (both enterprise and personal versions are available),
Tables have clustered indexes, and the order of the indexes is descending,
For example, tables created by the following DDL SQL
CREATE TABLE [Atype] (
[AID] [INT] Not NULL,
[Name] [varchar (20)] Not NULL,
CONSTRAINT [Pk_datetype] PRIMARY KEY CLUSTERED
([AID] DESC) On [PRIMARY],
) on [PRIMARY]
After adding some data, the AID is distributed between 1-100
INSERT into [Atype] VALUES (1, ' a ')
INSERT into [atype] VALUES (' B ')
INSERT into [Atype] VALUES (+, ' C ')
Do
Select from Atype where Aid < 50
Go
Delete from Atype where AID < 50
Go
Select from Atype where Aid < 50
The last sentence of the query still has a record output. :(
By Yee Hong Childe
The report was sent to the MSSQL development team, who acknowledged the mistake.
Before the new patches come out, the following recommendations are given:
Do not use a descending index on a single column, as this does not benefit the performance, just omit the order by field Desc, and use QA's show plan to see it, whether there is an order by or ASC or DESC, There is no such overhead (on the clustered index).
Descending indexes are generally used for composite indexes, which may be the cause of this bug.
Original:
Note that there are no need to create a descending index on a single column because SQL Server can traverse
An ascending index backwards when appropriate. Descending is normally used only in composite indexes.
This is probably what the bug surfaces here
http://www.bkjia.com/PHPjc/631191.html www.bkjia.com true http://www.bkjia.com/PHPjc/631191.html techarticle resolve a bug that is updated or deleted by using comparison criteria on a SQL2K descending index I've tried it in SQL Server, both enterprise and personal, every time. : (See my huitie for details: ...)