Re: [GENERAL] delete duplicates takes too long

2009-04-30 Thread Dennis Brakhane
On Sat, Apr 25, 2009 at 2:51 AM, Alvaro Herrera wrote: > In that case you can create a partial unique index: > > create index foo on cdr_ama_stat (abonado_a, abonado_b, fecha_llamada, > duracion) where processed = 2; Of course, the unique is missing in this one: CREATE UNIQUE INDEX foo ON cdr_am

Re: [GENERAL] delete duplicates takes too long

2009-04-24 Thread Alvaro Herrera
Miguel Miranda escribió: > I cant use a unique index because i only want to check for duplicates where > processed = 2, for simplicity i did not include that condition in the > example. In that case you can create a partial unique index: create index foo on cdr_ama_stat (abonado_a, abonado_b, fec

Re: [GENERAL] delete duplicates takes too long

2009-04-24 Thread Miguel Miranda
I cant use a unique index because i only want to check for duplicates where processed = 2, for simplicity i did not include that condition in the example. On Fri, Apr 24, 2009 at 5:50 PM, Scott Marlowe wrote: > On Fri, Apr 24, 2009 at 5:37 PM, Miguel Miranda > wrote: > > hi , i hava a table: > >

Re: [GENERAL] delete duplicates takes too long

2009-04-24 Thread Scott Marlowe
On Fri, Apr 24, 2009 at 5:37 PM, Miguel Miranda wrote: > hi , i hava a table: > CREATE TABLE public.cdr_ama_stat ( > id int4 NOT NULL DEFAULT nextval('cdr_ama_stat_id_seq'::regclass), > abonado_a varchar(30) NULL, > abonado_b varchar(30) NULL, > fecha_llamada timestamp NULL, > duracion int4 NULL,

[GENERAL] delete duplicates takes too long

2009-04-24 Thread Miguel Miranda
hi , i hava a table: CREATE TABLE public.cdr_ama_stat ( id int4 NOT NULL DEFAULT nextval('cdr_ama_stat_id_seq'::regclass), abonado_a varchar(30) NULL, abonado_b varchar(30) NULL, fecha_llamada timestamp NULL, duracion int4 NULL, puerto_a varchar(4) NULL, puerto_b varchar(4) NULL, tipo_llamada char(