pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gilberto Castillo <gilberto.castillo@etecsa.cu>
To: Mark Steben <mark.steben@drivedominion.com>
Cc: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: [MASSMAIL]long running delete
Date: Tue, 28 Jun 2016 12:15:08 -0500 (GMT+5)
Message-ID: <41101.192.168.207.54.1467134108.squirrel@webmail.etecsa.cu> (raw)
In-Reply-To: <CADyzmyxozipWz7B54MXkRED7vMf5Xya41BqorDgFcbvNgHzrVQ@mail.gmail.com>
References: <CADyzmyxozipWz7B54MXkRED7vMf5Xya41BqorDgFcbvNgHzrVQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>


> Good morning,
>
> We have been running a delete for nearly 24 hours now.  I would like to
> verify that it is either doing what it is supposed to do or 'spinning its
> wheels'.
>
> We are running postgres 9.2.12.
>
> The delete statement is not waiting on any other transaction.
>
> I have run straces on the pid and I see lots of 'reads, lseeks, and an
> occasional semop.  I have also looked in the base directory at the file
> matched by the oid of the table (as defined in pg_class) and have seen no
> change in size.
>
> Is there somewhere else I can verify that work is / is not being done?
> Perhaps looking for something else in strace?



My recomendation,

El DELETE es prohibitivo en Cualquier gestor de BD para ello ponga a su
concideración dos formas de como mejorar su comportamiento en PostgreSQL

--Solución 1

DELETE FROM string s WHERE NOT EXISTS (SELECT 1 FROM data d WHERE
d.object_id = s.id OR d.property_id = s.id OR d.value_id = s.id);

--Solución 2

(1) CREATE TABLE copia AS SELECT (...) WHERE (...)
(2) TRUNCATE en la tabla original.
(3) INSERT (...) SELECT (...) --actualizar desde la copia la tabla original
(4) DROP TABLE copia.


>
> Thanks for your time.
>
> --
> *Mark Steben*
>  Database Administrator
> @utoRevenue <http://www.autorevenue.com/; | Autobase
> <http://www.autobase.net/;
>   CRM division of Dominion Dealer Solutions
> 95D Ashley Ave.
> West Springfield, MA 01089
> t: 413.327-3045
> f: 413.383-9567
>
> www.fb.com/DominionDealerSolutions
> www.twitter.com/DominionDealer
>  www.drivedominion.com <http://www.autorevenue.com/;
>
> <http://autobasedigital.net/marketing/DD12_sig.jpg;
>


-- 
Saludos,
Gilberto Castillo
ETECSA, La Habana, Cuba



-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



view thread (4+ messages)  latest in thread

Message-ID: <41101.192.168.207.54.1467134108.squirrel@webmail.etecsa.cu>
Permalink:  ../41101.192.168.207.54.1467134108.squirrel@webmail.etecsa.cu/
Also on:    postgresql.org/message-id/41101.192.168.207.54.1467134108.squirrel@webmail.etecsa.cu

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: gilberto.castillo@etecsa.cu, mark.steben@drivedominion.com
  Subject: Re: [MASSMAIL]long running delete
  In-Reply-To: <41101.192.168.207.54.1467134108.squirrel@webmail.etecsa.cu>

* 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