Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 89F749FBCC7 for ; Tue, 15 May 2007 13:00:35 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 35575-05-2 for ; Tue, 15 May 2007 13:00:31 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.234]) by postgresql.org (Postfix) with ESMTP id 3A1029FBCD1 for ; Tue, 15 May 2007 13:00:31 -0300 (ADT) Received: by nz-out-0506.google.com with SMTP id s1so213131nze for ; Tue, 15 May 2007 09:00:30 -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=IFPBWxPb+2xbhQoMVLOIXvp3A7t4+tye49OEzKe+AXQTXRQUJ1DKhXr8aqi0NujbVMCiaVRKKsYl33p5Z4LMKP0P9LwcG5emb/tk8zhHvdIi/JfFdjyR7mAkp1Oww8v6ALT1txLczL3beoKIhOmfEzSncSBp53MOehHQj0WkIUA= 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=DG5bWWwU8PRiMS+sB91ID9FqdK9wLQMeg3r2A6QcaKuDDtUJzC6I2igUTRfkBBEQnEFo90sPBNAGPEdTOhyGPoO7oJNyQIxslS7qTCtYog8G59t819ka4NIjGlGk/I+IqOjJVAopONsg+yyo4Ja/CTy9P9BOhh03f75yjBJP/Q0= Received: by 10.115.76.1 with SMTP id d1mr1647772wal.1179244829634; Tue, 15 May 2007 09:00:29 -0700 (PDT) Received: by 10.115.72.5 with HTTP; Tue, 15 May 2007 09:00:29 -0700 (PDT) Message-ID: <48d0cacb0705150900o29f11b42t5dc5634be50e496a@mail.gmail.com> Date: Tue, 15 May 2007 13:00:29 -0300 From: "Daniel Cristian Cruz" To: "Drew Wilson" Subject: Re: Many to many join seems slow? Cc: pgsql-performance@postgresql.org In-Reply-To: <49735678-25F5-48AA-B464-0864BAE56B55@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <49735678-25F5-48AA-B464-0864BAE56B55@gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/270 X-Sequence-Number: 24660 2007/5/15, Drew Wilson : > =# explain SELECT s.source_id, s.value AS sourceValue, t.value AS > translationValue > FROM > source s, > translation_pair tp, > translation t, > language l > WHERE > s.source_id = tp.source_id > AND tp.translation_id = t.translation_id > AND t.language_id = l.language_id > AND l.name = 'French' ; > > QUERY PLAN > ------------------------------------------------------------------------ > ----------------------------------------------------- > Merge Join (cost=524224.49..732216.29 rows=92447 width=97) This way you get all word matches for the French language. Shouldn't it be all matches for a specific word (s.value = 'word' in WHERE)? -- Daniel Cristian Cruz