Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 60FFB6324A3 for ; Tue, 6 Apr 2010 21:22:19 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 59567-02 for ; Wed, 7 Apr 2010 00:22:01 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-yx0-f195.google.com (mail-yx0-f195.google.com [209.85.210.195]) by mail.postgresql.org (Postfix) with ESMTP id 6D278632315 for ; Tue, 6 Apr 2010 21:22:08 -0300 (ADT) Received: by yxe33 with SMTP id 33so253260yxe.15 for ; Tue, 06 Apr 2010 17:22:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:cc:content-type; bh=xP9Q823j5W2is68zwbbwgZC/FOiAXH4STYKyPzuZ5d0=; b=Gbgqo61olvxecjDgZQmTIj87xzN+g6PN/NB2B23CaBzZD++MUg4tXI56NcLVFn6UwL KR2Ejodajvj3ktMKKUpy0L7etqN8qaIvhM2UT8hQC8yGO1m0XNE5CztLZRrB4EUN2fn2 7KuTzE5thRlJCZ3wlyJ+jUl1B2muv3mKEt2tA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=en53Yi5volYD1ZTXJSTp+rtJpRivthl9aD42lzMaHUpeDJuWzirg5ljX0/Gu78Mv3s PnbGW9wM25+SMa8vjxafPgohrD9fmBVdlHWCodNMnTMrNcihA/zO8ICCgvI/dzXFRxR3 VwuNhz/iTTboIe/0y/IzokTqAD28jgf8Ry50o= MIME-Version: 1.0 Received: by 10.231.19.69 with HTTP; Tue, 6 Apr 2010 17:22:06 -0700 (PDT) In-Reply-To: References: Date: Tue, 6 Apr 2010 20:22:06 -0400 Received: by 10.151.118.20 with SMTP id v20mr9068094ybm.70.1270599726937; Tue, 06 Apr 2010 17:22:06 -0700 (PDT) Message-ID: Subject: Re: LIMIT causes planner to do Index Scan using a less optimal index From: Robert Haas To: Joel Jacobson Cc: Sherry.CTR.Zhu@faa.gov, pgsql-performance@postgresql.org Content-Type: multipart/alternative; boundary=001e680f09fc6038de04839a8d49 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.176 tagged_above=-10 required=5 tests=AWL=-1.178, BAYES_50=0.001, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201004/61 X-Sequence-Number: 38311 --001e680f09fc6038de04839a8d49 Content-Type: text/plain; charset=ISO-8859-1 On Tue, Apr 6, 2010 at 6:30 PM, Joel Jacobson wrote: > Actually, swapping the order of the conditions did in fact make some > difference, strange. > > I ran the query a couple of times for each variation to see if the > difference in speed was just a coincidence or a pattern. Looks like the > speed really is different. > Wow. That's very surprising to me... ...Robert --001e680f09fc6038de04839a8d49 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Tue, Apr 6, 2010 at 6:30 PM, Joel Jacobson <joel@gluefinance.com> wrote:=
Actually, swapping the order of the conditions did in fact make some differ= ence, strange.

I ran the query a couple of times for eac= h variation to see if the difference in speed was just a coincidence or a p= attern. Looks like the speed really is different.

Wow.=A0 That's very surprising to me...

..= .Robert
--001e680f09fc6038de04839a8d49--