Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id B605D650EA7 for ; Fri, 4 Jul 2008 09:37:01 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 87549-02 for ; Fri, 4 Jul 2008 09:36:50 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from web56415.mail.re3.yahoo.com (web56415.mail.re3.yahoo.com [216.252.111.94]) by postgresql.org (Postfix) with SMTP id 502F9650EA8 for ; Fri, 4 Jul 2008 09:36:43 -0300 (ADT) Received: (qmail 61840 invoked by uid 60001); 4 Jul 2008 12:36:40 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Received:X-Mailer:Date:From:Subject:To:Cc:MIME-Version:Content-Type:Message-ID; b=Tp3jJp1mOkH3F8EclIyC0Pkn9SI95iKy4pIVv3FUlKMmnCjZ3E4d+TOx6oKtGzHIyBAyh7iKDuNfr0DZia4EPd/uEIk34yY9dn2JGu79eT8Rqjv0FeC6NaCJzSff3aDOTGMgh3+d285nSibC19efK21ORWpD3dZLqaF5VCZYBpw=; Received: from [98.166.112.215] by web56415.mail.re3.yahoo.com via HTTP; Fri, 04 Jul 2008 05:36:40 PDT X-Mailer: YahooMailRC/1042.33 YahooMailWebService/0.7.199 Date: Fri, 4 Jul 2008 05:36:40 -0700 (PDT) From: Jessica Richard Subject: Re: slow delete... To: Charles Duffy Cc: pgsql-admin@postgresql.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1834116338-1215175000=:61618" Message-ID: <310112.61618.qm@web56415.mail.re3.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200807/64 X-Sequence-Number: 29674 --0-1834116338-1215175000=:61618 Content-Type: text/plain; charset=us-ascii thanks a lot. I imagine this will help me a lot. I will give it a try!!! One more question: in the explain output, what is that "Bitmap Heap Scan on test"?, is it a bad thing (a table scan)? I would love to see the index scan instead of this Heap scan... what does "Heap Scan" actually do here? Bitmap Heap Scan on test (cost=2110.49..10491.57 rows=79766 width=6) Recheck Cond: ((cola)::text = 'abc'::text) -> Bitmap Index Scan on test_cola_idx (cost=0.00..2090.55 rows=79766 width=0) Index Cond: ((cola)::text = 'abc'::text) (4 rows) Thanks again, Jessica ----- Original Message ---- From: Charles Duffy To: Jessica Richard Cc: pgsql-admin@postgresql.org Sent: Friday, July 4, 2008 3:17:43 AM Subject: Re: [ADMIN] slow delete... > by the way, there is a foreign key on another table that references the > primary key col0 on table test. > Try putting an index on the FK column in the other table. Analyse the table. Test by starting a transaction then issuing: explain analyze delete from test where cola = 'abc'. Should be faster. Charles Duffy -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin --0-1834116338-1215175000=:61618 Content-Type: text/html; charset=us-ascii
thanks a lot. I imagine this will help me a lot. I will give it a try!!!

One more question: in the explain output, what is that "Bitmap Heap Scan on test"?, is it a bad thing (a table scan)? I would love to see the index scan instead of this Heap scan... what does "Heap Scan" actually do here?

 Bitmap Heap Scan on test  (cost=2110.49..10491.57 rows=79766 width=6)
   Recheck Cond: ((cola)::text = 'abc'::text)
   ->  Bitmap Index Scan on test_cola_idx  (cost=0.00..2090.55 rows=79766 width=0)
         Index Cond: ((cola)::text = 'abc'::text)
(4 rows)

Thanks again,
Jessica

----- Original Message ----
From: Charles Duffy <charles.duffy@gmail.com>
To: Jessica Richard <rjessil@yahoo.com>
Cc: pgsql-admin@postgresql.org
Sent: Friday, July 4, 2008 3:17:43 AM
Subject: Re: [ADMIN] slow delete...

> by the way, there is a foreign key on another table that references the
> primary key col0 on table test.
>

Try putting an index on the FK column in the other table. Analyse the
table. Test by starting a transaction then
issuing: explain analyze delete from test where cola = 'abc'. Should be faster.


Charles Duffy

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

--0-1834116338-1215175000=:61618--