Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id F3365632270 for ; Tue, 3 Aug 2010 08:43:05 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 65401-01 for ; Tue, 3 Aug 2010 11:42:57 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.sdb.it (mail.sdb.it [212.141.11.2]) by mail.postgresql.org (Postfix) with ESMTP id 93A556321CA for ; Tue, 3 Aug 2010 08:42:58 -0300 (ADT) Received: by mail.sdb.it (Postfix, from userid 500) id ABD07827C; Tue, 3 Aug 2010 13:42:56 +0200 (CEST) Received: from geronimo.sdb.it (geronimo.sdb.it [10.101.1.20]) by mail.sdb.it (Postfix) with ESMTP id A6533827B; Tue, 3 Aug 2010 13:42:56 +0200 (CEST) Received: from mailtech.sdb.it (sdbit-srv01.sdb.it [10.118.122.250]) by geronimo.sdb.it (Postfix) with ESMTP id 7DDE73808C5; Tue, 3 Aug 2010 13:42:47 +0200 (CEST) Received: from [10.118.101.88] (silviob.sdb.it [10.118.101.88]) by mailtech.sdb.it (Postfix) with ESMTP id 904BD58ABA; Tue, 3 Aug 2010 13:42:56 +0200 (CEST) Message-ID: <4C58007E.4010909@tech.sdb.it> Date: Tue, 03 Aug 2010 13:41:50 +0200 From: Silvio Brandani User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: Kevin Grittner Cc: pgsql-admin@postgresql.org Subject: Re: performance problems on Delete References: <4C567A2E0200002500033FF1@gw.wicourts.gov> In-Reply-To: <4C567A2E0200002500033FF1@gw.wicourts.gov> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Private-Material: Please read notice X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.79 tagged_above=-10 required=5 tests=BAYES_50=0.8, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201008/11 X-Sequence-Number: 35260 Kevin Grittner ha scritto: > Silvio Brandani wrote: > > >> we have a performance issue on deleting data from a table. >> >> the delete is on the index key so should be very fast but the table >> have 13 contraints of type foreign keys and the slowness seems due >> to all the works done with the constraint. >> Trying to drop the constraint and execute the delete the result is >> immediate. >> > > The usual reason for this is that you don't have indexes on the > referencing columns, so to check whether the delete is OK it has to > scan the related tables. Think about what rows need to be checked to > determine whether the delete is allowed and index the columns which > will allow fast access to them. > > -Kevin > > yes, you where right , an index was missing. thanks a lot -- --- Utilizziamo i dati personali che la riguardano esclusivamente per nostre finalitą amministrative e contabili, anche quando li comunichiamo a terzi. Informazioni dettagliate, anche in ordine al Suo diritto di accesso e agli altri Suoi diritti, sono riportate alla pagina http://www.savinodelbene.com/news/privacy.html Se avete ricevuto questo messaggio per errore Vi preghiamo di ritornarlo al mittente eliminandolo assieme agli eventuali allegati, ai sensi art. 616 codice penale http://www.savinodelbene.com/codice_penale_616.html L'Azienda non si assume alcuna responsabilitą giuridica qualora pervengano da questo indirizzo messaggi estranei all'attivitą lavorativa o contrari a norme. --