On Oct 27, 2010, at 9:43 AM, Vick Khera wrote:

> Any recommendations on how to fix?  It is hard to trace the schema relations 
> since there are not FK's defined, so I'm not sure how to update the group id 
> references or if I need to.  Also, is this table supposed to be really huge?  
> I have over 700k tuples in it!

In awesome form, I'll reply to myself ;-)

Looks like there are two "groups" that are duplicate groupid+member id.  It 
should be plenty easy to clean that up.  What other table refers to the 
groupmembers.id field?  I can just update those, delete the dupes, and have a 
nice unique index.

Basically I did this:

select groupid,memberid,count(*) from groupmembers group by groupid,memberid 
having count(*) > 1;

It gave me this:

 groupid | memberid | count 
---------+----------+-------
  466380 |   134922 |     2
  386385 |   134922 |     2


Reply via email to