Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 3AD429FB41A for ; Wed, 4 Oct 2006 22:55:45 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 08910-03-2 for ; Thu, 5 Oct 2006 01:54:29 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 5682B9FB41D for ; Wed, 4 Oct 2006 22:54:29 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k951sR9q005873; Wed, 4 Oct 2006 21:54:27 -0400 (EDT) To: Ben cc: pgsql-performance@postgresql.org Subject: Re: pg_trgm indexes giving bad estimations? In-reply-to: References: Comments: In-reply-to Ben message dated "Wed, 04 Oct 2006 18:35:15 -0700" Date: Wed, 04 Oct 2006 21:54:27 -0400 Message-ID: <5872.1160013267@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200610/119 X-Sequence-Number: 21248 Ben writes: > How can I get the planner to not expect so many rows to be returned? Write an estimation function for the pg_trgm operator(s). (Send in a patch if you do!) I see that % is using "contsel" which is only a stub, and would likely be wrong for % even if it weren't. > A possibly related question is: because pg_tgrm lets me set the > matching threshold of the % operator, how does that affect the planner? It hasn't a clue about that. regards, tom lane