X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 41D5652862 for ; Fri, 29 Jul 2005 01:06:21 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 12253-10 for ; Fri, 29 Jul 2005 04:06:19 +0000 (GMT) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.200]) by svr1.postgresql.org (Postfix) with ESMTP id B532952816 for ; Fri, 29 Jul 2005 01:06:17 -0300 (ADT) Received: by zproxy.gmail.com with SMTP id z6so339988nzd for ; Thu, 28 Jul 2005 21:06:17 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:references; b=TUEV79VD8e9JTcb1p4513QPlPedvJehLd0PCsSd6RIs0lKNS64sb+pEE1rkvE/rkOVHY1BVxMxf+jxC9E7edJt1XhVF2N1AkU2a2Esk5t6wZNQedyzQzU73lRqXDGFLp8aHPmGVi88D4Mc3N1JxjDev2XjeiR8WUaeJrnoZoNxY= Received: by 10.36.36.10 with SMTP id j10mr2380637nzj; Thu, 28 Jul 2005 21:05:40 -0700 (PDT) Received: by 10.36.119.19 with HTTP; Thu, 28 Jul 2005 21:05:40 -0700 (PDT) Message-ID: Date: Fri, 29 Jul 2005 09:35:40 +0530 From: Gnanavel S Reply-To: Gnanavel S To: Chris Travers Subject: Re: Left joining against two empty tables makes a query SLOW Cc: pgsql-performance@postgresql.org In-Reply-To: <42E90E19.3030702@travelamericas.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_8056_14123843.1122609940529" References: <42E86A03.1070803@travelamericas.com> <42E90E19.3030702@travelamericas.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.435 tagged_above=0 required=5 tests=AWL, HTML_50_60, HTML_MESSAGE, RCVD_BY_IP X-Spam-Level: X-Archive-Number: 200507/455 X-Sequence-Number: 13696 ------=_Part_8056_14123843.1122609940529 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 7/28/05, Chris Travers wrote: >=20 > Gnanavel S wrote: >=20 > > > > > > vacuum & reindex the department and project table as the planner > > expects there are 1060 rows but actually returning nothing. >=20 > I guess I should have mentioned that I have been vacuuming and > reindexing at least once a week, and I did so just before running this=20 > test. > Normally I do: > vacuum analyze; > reindex database ....; reindex the tables separately. Secondly, the project table has *never* had anything in it. So where > are these numbers coming from? pg_statistics=20 Best Wishes, > Chris Travers > Metatron Technology Consulting >=20 --=20 with regards, S.Gnanavel Satyam Computer Services Ltd. ------=_Part_8056_14123843.1122609940529 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline

On 7/28/05, Chris Travers <c= hris@travelamericas.com> wrote:
Gnanavel S wrote:

>
>
> vacuum & reindex the depa= rtment and project table as the planner
> expects there are 1060 rows= but actually returning nothing.

I guess I should have mentioned tha= t I have been vacuuming and
reindexing at least once a week, and I did so just before running this = test.
Normally I do:
vacuum analyze;
reindex database ....;

reindex the tables separately.

Secondl= y, the project table has *never* had anything in it.  So whereare these numbers coming from?

pg_statistics

Best Wi= shes,
Chris Travers
Metatron Technology Consulting



--
with regards,
S.Gnanavel
Satyam Comp= uter Services Ltd. ------=_Part_8056_14123843.1122609940529--