Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 5AD1564FD05 for ; Wed, 10 Dec 2008 15:39:51 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 02037-10 for ; Wed, 10 Dec 2008 15:39:45 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.230]) by mail.postgresql.org (Postfix) with ESMTP id 2598B64FC4F for ; Wed, 10 Dec 2008 15:39:44 -0400 (AST) Received: by rv-out-0506.google.com with SMTP id b25so509862rvf.43 for ; Wed, 10 Dec 2008 11:39:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=Qw4oh8NTB4zyMmMQE8FUp2TjRfsQ3NL1CErbXp4zcCk=; b=LxMeBgzV0SrGpS9t1D806IxIP7+CfYMBnAtN2kjggse6hs9M7x28/qaHAaMQ+qBpXL +43N0eMAB59gtCRx1lonV8oD8pG6hLHQvr8luRAEsVdqf9Sv8l33y/xWofRvItvlTk5O IO3LAch4I6A/VuCuksMKBRKyK1+oMCNoT5YBE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=xBVmPfoaWWPlqzT7SwJyHKKJbRZEXDN65qFy8rbeDEJEdPqdnzjBEkPoLvi6kgC8Tg fBIPdb8gnhxQM0ieyaSFn56pwK75P11jthGuf5f+uJK0oBOdCga5uD7w1nMLrLRZXloS jAvF1TWBcGNHruI6UARyMQ3XGuC7C4bTW9pwA= Received: by 10.141.105.18 with SMTP id h18mr826896rvm.109.1228937982985; Wed, 10 Dec 2008 11:39:42 -0800 (PST) Received: by 10.140.164.12 with HTTP; Wed, 10 Dec 2008 11:39:42 -0800 (PST) Message-ID: <603c8f070812101139p189cc828hef8702f37f952b6d@mail.gmail.com> Date: Wed, 10 Dec 2008 14:39:42 -0500 From: "Robert Haas" To: "Richard Yen" Subject: Re: query plan with index having a btrim is different for strings of different length Cc: "Tom Lane" , pgsql-performance@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <751F49DC-1142-4E9C-95C8-BC3C229B3F0B@richyen.com> <22937.1228865243@sss.pgh.pa.us> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200812/125 X-Sequence-Number: 32161 > You guys are right. I tried "Miller" and gave me the same result. Is there > any way to tune this so that for the common last names, the query run time > doesn't jump from <1s to >300s? > Thanks for the help! Can you send the output of EXPLAIN ANALYZE for both cases? ...Robert