Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id AAD8DB5DC3C for ; Sun, 4 Sep 2011 15:06:40 -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 71586-10 for ; Sun, 4 Sep 2011 18:06:34 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sam.nabble.com (sam.nabble.com [216.139.236.26]) by mail.postgresql.org (Postfix) with ESMTP id 446B4B5DC26 for ; Sun, 4 Sep 2011 15:06:33 -0300 (ADT) Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1R0H5T-0001js-ON for pgsql-performance@postgresql.org; Sun, 04 Sep 2011 11:06:31 -0700 Date: Sun, 4 Sep 2011 11:06:31 -0700 (PDT) From: Jayadevan To: pgsql-performance@postgresql.org Message-ID: <1315159591749-4768047.post@n5.nabble.com> In-Reply-To: <12017.1315149499@sss.pgh.pa.us> References: <4E6345520200002500040BD6@gw.wicourts.gov> <12017.1315149499@sss.pgh.pa.us> Subject: Re: Query performance issue MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.778 tagged_above=-10 required=5 tests=BAYES_00=-1.9, URI_HEX=1.122 X-Spam-Level: X-Archive-Number: 201109/20 X-Sequence-Number: 44796 I don't think I understood all that. Anyway, is there a way to fix this - either by rewriting the query or by creating an index? The output does match what I am expecting. It does take more than 10 times the time taken by Oracle for the same result, with PostgreSQL taking more than 20 minutes. I am sort of stuck on this since this query does get executed often. By the way, changing the filter from FAMNAM to GIVENNAME fetches results in 90 seconds. Probably there is a difference in the cardinality of values in these 2 columns. -- View this message in context: http://postgresql.1045698.n5.nabble.com/Query-performance-issue-tp4753453p4768047.html Sent from the PostgreSQL - performance mailing list archive at Nabble.com.