Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 4600E9FBC10 for ; Thu, 15 Mar 2007 11:06:19 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 84644-02 for ; Thu, 15 Mar 2007 11:06:07 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.239]) by postgresql.org (Postfix) with ESMTP id 61BCA9FB709 for ; Thu, 15 Mar 2007 11:06:13 -0300 (ADT) Received: by wr-out-0506.google.com with SMTP id 76so98421wra for ; Thu, 15 Mar 2007 07:06:12 -0700 (PDT) DKIM-Signature: a=rsa-sha1; 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; b=KkpLEvuBAjd7i407xnLQnHGwtJAA/vg6EaO/MeMcUD0IyqYYDV2ABfmYXZUYlE103A9CFDFt2UUxsnub+3VCLzulmk7gGTjV0AvqRL2H8pZZsFvGkOWJx8WIcy2JXdcRI0r151J9//KGuQ2lhtQAJ4DVpkTnmSj8i4XNzuQwyCQ= 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=NEUvwpeJRpMB6TiEaZC/MM1TLL08EmGmD93YWZgkWLe/E0NqHrzn4x9BqRvInLHvlhLcVIHkZeV+pHG1UupaLvwEWLB8LAddMjOSEgTOCs+WhGSMgIuK8W4LLV7odgpXlCHMvvwFHtXUqyyLsThdj/r+HxWziPICzid3uEY1G6w= Received: by 10.114.13.1 with SMTP id 1mr225551wam.1173967545094; Thu, 15 Mar 2007 07:05:45 -0700 (PDT) Received: by 10.114.166.8 with HTTP; Thu, 15 Mar 2007 07:05:45 -0700 (PDT) Message-ID: Date: Thu, 15 Mar 2007 09:05:45 -0500 From: "=?ISO-8859-1?Q?Rodrigo_De_Le=F3n?=" To: pgsql-sql@postgresql.org Subject: Re: Joins on many-to-many relations. Cc: "Wiebe Cazemier" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=WINDOWS-1252; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <5.2.1.1.0.20070314133826.050002b0@pop6.sympatico.ca> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200703/211 X-Sequence-Number: 27849 On 3/14/07, Wiebe Cazemier wrote: > I discovered that removing the subselect (the entire second condition of > the join actually) is not the only thing that speeds it up. If I remove > the LIKE check on account.description, it's also a lot faster (152 ms > as opposed to 2915 ms), although not as fast as without the subselect. > I don't understand why that makes such a big difference. There is an > index on upper() on the field.