X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 72E8B9DC981 for ; Mon, 9 Jan 2006 22:54:55 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 77960-04 for ; Mon, 9 Jan 2006 22:54:59 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from megazone.bigpanda.com (megazone.bigpanda.com [64.147.171.210]) by postgresql.org (Postfix) with ESMTP id 54B549DC9AD for ; Mon, 9 Jan 2006 22:54:53 -0400 (AST) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id AD51F35161; Mon, 9 Jan 2006 18:54:57 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id A89C435125; Mon, 9 Jan 2006 18:54:57 -0800 (PST) Date: Mon, 9 Jan 2006 18:54:57 -0800 (PST) From: Stephan Szabo To: Andrea Arcangeli Cc: Tom Lane , pgsql-performance@postgresql.org Subject: Re: NOT LIKE much faster than LIKE? In-Reply-To: <20060110022303.GA20168@opteron.random> Message-ID: <20060109185355.S36990@megazone.bigpanda.com> References: <20060110014447.GB18474@opteron.random> <24021.1136858688@sss.pgh.pa.us> <20060110022303.GA20168@opteron.random> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.073 required=5 tests=[AWL=0.073] X-Spam-Score: 0.073 X-Spam-Level: X-Archive-Number: 200601/78 X-Sequence-Number: 16556 On Tue, 10 Jan 2006, Andrea Arcangeli wrote: > I see. I can certainly fix it by stopping using LIKE. But IMHO this > remains a bug, since until the statistics about the numberof matching > rows isn't estimated well, you should not make assumptions on LIKE/NOT > LIKE. I think you can change the code in a way that I won't have to > touch anything, and this will lead to fewer surprises in the future IMHO. I doubt it, since I would expect that this would be as large a pessimization for a larger fraction of people than it is an optimization for you.