Selecting dupes from table

From: Uros <uros(at)sir-mag(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Selecting dupes from table
Date: 2003-06-24 10:16:43
Message-ID: 526292874.20030624121643@sir-mag.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello ,

I have table directory with 3 columns (id,url,title)

I want to list all entries with duplicate urls.

I tried this:

select id,url,title from directory where url IN
(select url from directory group by url having count(url) > 1)
ORDER by url;

but this takes 30 seconds with 25.000 entries. I have index on url.

Can I use any other query to select this faster.

--
Best regards,
Uros mailto:uros(at)sir-mag(dot)com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jean-Christian Imbeault 2003-06-24 10:31:46 Re: Selecting dupes from table
Previous Message culley harrelson 2003-06-24 07:41:21 Re: interesting PHP/MySQL thread