Using the bug_php tutorial on the SQL2K descending index

Source: Internet
Author: User
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: ...)

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.