pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: wilsoncamago@gmail.com
To: pgsql-bugs@postgresql.org
Subject: BUG #6348: PROBLEMAS DELETE
Date: Wed, 21 Dec 2011 14:26:39 +0000
Message-ID: <E1RdN7v-0005FK-SG@wrigleys.postgresql.org> (raw)

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                             




view thread (2+ messages)  latest in thread

Message-ID: <E1RdN7v-0005FK-SG@wrigleys.postgresql.org>
Permalink:  ../E1RdN7v-0005FK-SG@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/E1RdN7v-0005FK-SG@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: wilsoncamago@gmail.com
  Subject: Re: BUG #6348: PROBLEMAS DELETE
  In-Reply-To: <E1RdN7v-0005FK-SG@wrigleys.postgresql.org>
  References: <E1RdN7v-0005FK-SG@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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