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 974F83A19D0 for ; Tue, 4 Jan 2005 05:06:36 +0000 (GMT) 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 69928-07 for ; Tue, 4 Jan 2005 05:06:30 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id DDE8C3A3D67 for ; Tue, 4 Jan 2005 05:06:30 +0000 (GMT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.1/8.13.1) with ESMTP id j0456OXu039479 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 3 Jan 2005 22:06:26 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.1/8.13.1) with ESMTP id j0456O0m081350; Mon, 3 Jan 2005 22:06:24 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.1/8.13.1/Submit) id j0456ME9081349; Mon, 3 Jan 2005 22:06:22 -0700 (MST) (envelope-from mfuhr) Date: Mon, 3 Jan 2005 22:06:21 -0700 From: Michael Fuhr To: Adam Palmblad Cc: Postgres Performance Subject: Re: Bad Index Choices with user defined data type Message-ID: <20050104050621.GA81266@winnie.fuhr.org> References: <001d01c4f1dd$7eb98390$97019696@AERS04> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <001d01c4f1dd$7eb98390$97019696@AERS04> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.002 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200501/36 X-Sequence-Number: 9726 On Mon, Jan 03, 2005 at 01:44:27PM -0800, Adam Palmblad wrote: > I've got a table using a data type that I have created as the type for > its primary key. I (hope) I have the type set up properly - it seems > okay, and does not have any problem creating a b-tree index for the > type. The problem I am having is that the index seems to never be > chosen for use. I can force the use of the index by setting > enable_seqscan to off. The table has about 1.2 million rows. I have > also analyzed the table - and immediately afterwards there is no affect > on the index's behaviour. Please post the query and the EXPLAIN ANALYZE output for both cases: one query with enable_seqscan on and one with it off. It might also be useful to see the column's statistics from pg_stats, and perhaps the SQL statements that create the table, the type, the type's operators, etc. -- Michael Fuhr http://www.fuhr.org/~mfuhr/