Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 6A08A2E0031 for ; Tue, 12 Feb 2008 20:07:36 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 70998-04 for ; Tue, 12 Feb 2008 20:07:08 -0400 (AST) Received: from mail.mailpen.net (mail.mailpen.net [209.90.228.14]) by postgresql.org (Postfix) with ESMTP id E18872E002E for ; Tue, 12 Feb 2008 20:07:31 -0400 (AST) Received: from [192.168.42.79] (207.155.204.150.ptr.us.xo.net [207.155.204.150]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.mailpen.net (Postfix) with ESMTP id E87AD25ED6C for ; Tue, 12 Feb 2008 16:07:29 -0800 (PST) Message-ID: <47B234C1.1090707@ultimeth.com> Date: Tue, 12 Feb 2008 16:07:29 -0800 From: "Dean Gibson (DB Administrator)" Organization: UltiMeth Systems User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: Optimizing No matching record Queries References: <47B2112C.5070707@livedatagroup.com> In-Reply-To: <47B2112C.5070707@livedatagroup.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200802/124 X-Sequence-Number: 28666 On 2008-02-12 13:35, Pallav Kalva wrote: > Hi, > > ... > Table Definitions > ============ > > \d listing.listingstatus > Table "listing.listingstatus" > Column | Type > | Modifiers > -----------------+-----------------------------+------------------------------------------------------------------------ > > listingstatusid | integer | not null default > nextval(('listing.listingstatusseq'::text)::regclass) > shortname | text | > longname | text | > _entrydate | timestamp without time zone | default > ('now'::text)::timestamp(6) without time zone > Indexes: > "pk_listingstatus_listingstatusid" PRIMARY KEY, btree > (listingstatusid), tablespace "indexdata" > Since you are searching by "shortname", trying adding an index on that. Although with that tiny a table, it might not matter. The questions are: 1. Why in the planner scanning the entire idx_listing_entrydate, when I'd think it should be scanning the entire pk_listingstatus_listingstatusid ? 2. Why is "Index Scan using pk_listingstatus_listingstatusid on listingstatus listingsta1_ (cost=0.00..0.27 rows=1 width=4) (never executed)" ? Note: I'm new at this as well, and jumped in to learn as well as to help. -- Dean -- Mail to my list address MUST be sent via the mailing list. All other mail will bounce.