pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #6348: PROBLEMAS DELETE
2+ messages / 2 participants
[nested] [flat]

* BUG #6348: PROBLEMAS DELETE
@ 2011-12-21 14:26 wilsoncamago@gmail.com
  2011-12-21 16:25 ` Re: BUG #6348: PROBLEMAS DELETE Alvaro Herrera <alvherre@commandprompt.com>
  0 siblings, 1 reply; 2+ messages in thread

From: wilsoncamago@gmail.com @ 2011-12-21 14:26 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      6348
Logged by:          wilson camargo
Email address:      wilsoncamago@gmail.com
PostgreSQL version: 9.1.2
Operating system:   win linux
Description:        

hace algun tiempo tube el inconveniente de eliminar de una tabla relacionada
en una subconsulta y eliminando 10000 aprox se demoraba 20 seg la consulta
era 
DELETE FROM  saldo_detalle_cartera 
WHERE saldo_detalle_cartera.movimiento_contable in (select
s.movimiento_contable from saldo_detalle_cartera s 
                             inner join movimiento_contable m on
m.id_mov_contable= s.movimiento_contable
                             and m.proyecto = '185' )

afotunadamente hay una forma mas rapida que es usando esta sentencia

DELETE FROM  saldo_detalle_cartera USING movimiento_contable m
WHERE saldo_detalle_cartera.movimiento_contable = m.id_mov_contable and
m.proyecto='185'

la cual lo hace en tan solo 11 ms 
la pregunta es podria hacer algo paracecido usando UDATE con tablas
relacionales                             




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #6348: PROBLEMAS DELETE
  2011-12-21 14:26 BUG #6348: PROBLEMAS DELETE wilsoncamago@gmail.com
@ 2011-12-21 16:25 ` Alvaro Herrera <alvherre@commandprompt.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Alvaro Herrera @ 2011-12-21 16:25 UTC (permalink / raw)
  To: wilsoncamago <wilsoncamago@gmail.com>; +Cc: pgsql-bugs


Excerpts from wilsoncamago's message of mié dic 21 11:26:39 -0300 2011:

> hace algun tiempo tube el inconveniente de eliminar de una tabla relacionada
> en una subconsulta y eliminando 10000 aprox se demoraba 20 seg la consulta
> era 
> DELETE FROM  saldo_detalle_cartera 
> WHERE saldo_detalle_cartera.movimiento_contable in (select
> s.movimiento_contable from saldo_detalle_cartera s 
>                              inner join movimiento_contable m on
> m.id_mov_contable= s.movimiento_contable
>                              and m.proyecto = '185' )
> 
> afotunadamente hay una forma mas rapida que es usando esta sentencia

Wilson, esto no es un bug.  Por favor plantea tu pregunta en
pgsql-es-ayuda@postgresql.org

-- 
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2011-12-21 16:25 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-12-21 14:26 BUG #6348: PROBLEMAS DELETE wilsoncamago@gmail.com
2011-12-21 16:25 ` Alvaro Herrera <alvherre@commandprompt.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox