Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 8D4FA9FCB62 for ; Wed, 7 Nov 2007 09:38:17 -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 37870-06 for ; Wed, 7 Nov 2007 09:37:27 -0400 (AST) Received: from fk-out-0910.google.com (fk-out-0910.google.com [209.85.128.185]) by postgresql.org (Postfix) with ESMTP id 53A089F949D for ; Wed, 7 Nov 2007 09:38:07 -0400 (AST) Received: by fk-out-0910.google.com with SMTP id b27so2364877fka for ; Wed, 07 Nov 2007 05:38:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; 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=qCUcXc8h8HP+qoVbf6na5Tf9XMYpCvuRAqB69/0JVGg=; b=kPazBm71je+qqLpheTnbR2mpC+2gYXVvsYUG8Yho6AIFfdg0U+QAZbIO73Ovv32Ap6tXCHetwu7+PqOyNBmbbowZZBc+YTNadDsrXnDuGmEg4ZIQOetDJh3hnF7DfitjMA+HHycmMm3UuEJhiYmP4VyZsNZgZR/mJ7ZPTR54My8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ZSk0ZGi4GwwS2gG4x7cxKgmwMwRE6HHOLsJ4ULyK2EDZPF0QSpRy5epJ8LPlfgO4jKsGFUVBIhZsJV6AH7xemX1WFhNm1g6v3kiPuRryy9GMzkhQ9aGXRN4zb+mCdjmTvu2Usg4v2ZQnnFzkhlvrqx3uQH+1RB5RtmuFlVclAXw= Received: by 10.82.124.10 with SMTP id w10mr14682742buc.1194442684979; Wed, 07 Nov 2007 05:38:04 -0800 (PST) Received: by 10.82.118.6 with HTTP; Wed, 7 Nov 2007 05:38:04 -0800 (PST) Message-ID: <1d4e0c10711070538mf773791ke5950849299b142c@mail.gmail.com> Date: Wed, 7 Nov 2007 14:38:04 +0100 From: "Guillaume Smet" To: "Alexander Staubo" Subject: Re: Estimation problem with a LIKE clause containing a / Cc: pgsql-performance In-Reply-To: <88daf38c0711070525r1e7d6daft56970045de0ec8f4@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1d4e0c10711070453q214f089cpd144cbb5193d3c4f@mail.gmail.com> <88daf38c0711070525r1e7d6daft56970045de0ec8f4@mail.gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200711/80 X-Sequence-Number: 27495 Alexander, On 11/7/07, Alexander Staubo wrote: > That's a difference of less than *three milliseconds* -- a difference > probably way within the expected overhead of running "explain > analyze". Furthermore, all three queries use the same basic plan: a > sequential scan with a filter. At any rate you're microbenchmarking in > a way that is not useful to real-world queries. In what way are these > timings a problem? If you read my previous email carefully, you'll see they aren't a problem: the problem is the estimation, not the timing. This is a self contained test case of a far more complex query which uses a bad plan containing a nested loop due to the bad estimate. > Now all "like 'prefix%'" queries should use the index. Not when you retrieve 50% of this table of 22k rows but that's not my problem anyway. A seqscan is perfectly fine in this case. Thanks anyway. -- Guillaume