X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id D532B52851 for ; Wed, 25 May 2005 14:55:47 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 61762-02 for ; Wed, 25 May 2005 17:55:44 +0000 (GMT) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.177]) by svr1.postgresql.org (Postfix) with ESMTP id D946C5280B for ; Wed, 25 May 2005 14:55:41 -0300 (ADT) Received: from [194.25.154.138] (helo=webserv.wug.de) by mrelayeu.kundenserver.de with ESMTP (Nemesis), id 0ML25U-1Db06X05Zt-0000Rt; Wed, 25 May 2005 19:55:41 +0200 Received: from kretschmer by webserv.wug.de with local (Exim 3.35 #1) id 1Db07q-0000wD-00 for pgsql-sql@postgresql.org; Wed, 25 May 2005 19:57:02 +0200 Date: Wed, 25 May 2005 19:57:02 +0200 From: Andreas Kretschmer To: pgsql-sql@postgresql.org Subject: Re: [despammed] Re: Duplicated records Message-ID: <20050525175702.GA3389@webserv.wug-glas.de> Mail-Followup-To: Andreas Kretschmer , pgsql-sql@postgresql.org References: <20050524175931.4dp41vy7v10c4wc4@www.presserv.org> <20050525050346.GA29126@webserv.wug-glas.de> <20050525135807.x9p08co04v8gg0cw@www.presserv.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20050525135807.x9p08co04v8gg0cw@www.presserv.org> X-DEST: 208 X-MSMail-Priority: High X-Message-Flag: The Windows platform is not just insecure - it's patently, blatantly, and unashamedly insecure by design. X-PrivatMail: kretschmer@kaufbach.delug.de X-OS: Linux - weil ich es mir Wert bin! X-Info: registrierter Linux-User 97922 http://counter.li.org User-Agent: mutt-ng 1.5.9i (Linux) X-Provags-ID: kundenserver.de abuse@kundenserver.de login:51ea9561fc3f6d9539a2acd743e4748c X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.319 tagged_above=0 required=5 tests=AWL, MISSING_MIMEOLE, X_MSMAIL_PRIORITY_HIGH X-Spam-Level: X-Archive-Number: 200505/218 X-Sequence-Number: 21531 am 25.05.2005, um 13:58:07 -0300 mailte lucas@presserv.org folgendes: > Hi. > Thanks for the article... > But, I have read it and the query works very slow... > My table have aprox. 180.000 records (correct) and in entire table it has > aprox.360.000 records(duplicated)... How often is this necessary? > Is there a way to delete those duplicated records faster??? Remembering the > table have aprox 360.000 records... I dont know, but i think, you should prevent duplicated records in the future, and make the job (delete duplicates) now. Btw.: you wrote, there is a primary key on the first row. Real? ,----[ sorry, messages in german language ] | test_db=# create table blub (id int primary key, name varchar); | HINWEIS: CREATE TABLE / PRIMARY KEY erstellt implizit einen Index >>blub_pkey<< für Tabelle >>blub<< | CREATE TABLE | test_db=# insert into blub values (1, 'x'); | INSERT 970706 1 | test_db=# insert into blub values (1, 'y'); | FEHLER: duplizierter Schlüssel verletzt Unique-Constraint >>blub_pkey<< `---- In other words: if there a primary key on the first row, you cannot insert duplicates. Regards, Andreas -- Andreas Kretschmer (Kontakt: siehe Header) Heynitz: 035242/47212, D1: 0160/7141639 GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net === Schollglas Unternehmensgruppe ===