Path: utzoo!attcan!telly!problem!compus!lethe!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!uunet!cimshop!davidm From: cimshop!davidm@uunet.UU.NET (David S. Masterson) Newsgroups: comp.databases Subject: Re: Duplicated tuples problem (Oracle/SQL) Message-ID: Date: 21 Dec 90 17:52:39 GMT References: <772@keele.keele.ac.uk> Sender: davidm@cimshop.UUCP Distribution: comp Organization: Consilium Inc., Mountain View, California. Lines: 22 In-reply-to: csa18@seq1.keele.ac.uk's message of 21 Dec 90 10:13:14 GMT X-Posting-Software: GNUS 3.12 [ NNTP-based News Reader for GNU Emacs ] >>>>> On 21 Dec 90 10:13:14 GMT, csa18@seq1.keele.ac.uk (R.J. Husmo) said: R.J.> Q: Is there a way to automatically delete duplicate tuples from a R.J.> table/all tables in a db using SQL? The typical way is to put a unique index on the primary key of each table. R.J.> And why do relational dbs allow duplicate tuples, anyway? A tradeoff between performance and soundness of model. Without an index on the primary key, its typically difficult to determine that a duplicate row has been entered into the system with sequentially searching the table. This can be a rather time-consuming operation for every update to take. The same effect can be achieved by a unique index or constraint on the primary key of the table. -- ==================================================================== David Masterson Consilium, Inc. (415) 691-6311 640 Clyde Ct. uunet!cimshop!davidm Mtn. View, CA 94043 ==================================================================== "If someone thinks they know what I said, then I didn't say it!"