Search Postgresql Archives

Re: How to delete duplicate rows?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Doh, sorry - you're completely correct! Silly me...

Can you not add a serial or sequence column to the table for the purposes of the de-dupe?

Then create an index on that column in one operation at the end and use that in the way that you would use Oracle's rowid from the examples?

John Sidney-Woollett


Clodoaldo Pinto wrote:

On Fri, 04 Feb 2005 07:38:26 +0000, John Sidney-Woollett
<johnsw@xxxxxxxxxxxxx> wrote:

Can you not use your table's primary key value instead?


John, If a primary key existed there would be no duplicates.

The row insertion is made in 650k rows batches 8 times a day and a
primary key make it very slow.
Found also methods 2 and 3 in
http://www.orafaq.com/faq/Server_Utilities/SQL/faq55.htm


Method 3 also relies in the row id. If no one can help I will do this:

Insert the distinct rows in a temporary table. Drop the index. Insert
into the original from the temporary.

Clodoaldo

---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux