Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id A12A79FB90F for ; Tue, 15 May 2007 13:44:09 -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 40466-05 for ; Tue, 15 May 2007 13:44:04 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.181]) by postgresql.org (Postfix) with ESMTP id 9EC099FBCAF for ; Tue, 15 May 2007 13:44:04 -0300 (ADT) Received: by py-out-1112.google.com with SMTP id a73so184736pye for ; Tue, 15 May 2007 09:44:03 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:in-reply-to:references:mime-version:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer; b=GOt/K4f+3WXXHmnkf1WQlOaWJPReGd/CTUeZVQrSs1pLmI8ug0E5hvJQMsUqgj9beCYfw+ngsxHZAijL2DHk5qdI13l9Tgy3NKKRr1ue0bC4AYpssTBtWNOtP18hGBMmU0gsaZSP1NM6qoRrfhrv97liKF7qNukeJ5juOiASGw4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:in-reply-to:references:mime-version:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer; b=fjUrPqrTx3PQ7OTwsA9RVDcgQCZFUbES9oNs+AgQBQM+bCHfr5/6oejO8BN9W25uwvLm3MRx9B8+5nyfNUG+11qoxKG0UrQ1Qf6nI88Sac+ca58QlzWB5W+gea1oYyyXWSoMbXbr4vz4d+axFYqbBXEpsHAby+Pe7esyUlQUAiQ= Received: by 10.65.81.10 with SMTP id i10mr1231430qbl.1179247443291; Tue, 15 May 2007 09:44:03 -0700 (PDT) Received: from ?17.203.35.206? ( [17.203.35.206]) by mx.google.com with ESMTP id e17sm854952qba.2007.05.15.09.44.00; Tue, 15 May 2007 09:44:01 -0700 (PDT) In-Reply-To: <48d0cacb0705150900o29f11b42t5dc5634be50e496a@mail.gmail.com> References: <49735678-25F5-48AA-B464-0864BAE56B55@gmail.com> <48d0cacb0705150900o29f11b42t5dc5634be50e496a@mail.gmail.com> Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <694A96DF-65A7-4DCD-972F-97081A554E1B@gmail.com> Cc: pgsql-performance@postgresql.org Content-Transfer-Encoding: 7bit From: Drew Wilson Subject: Re: Many to many join seems slow? Date: Tue, 15 May 2007 09:43:55 -0700 To: "Daniel Cristian Cruz" X-Mailer: Apple Mail (2.752.3) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/272 X-Sequence-Number: 24662 Yes, I'll be filtering by string value. However, I just wanted to see how long it takes to scan all translations in a particular language. Drew On May 15, 2007, at 9:00 AM, Daniel Cristian Cruz wrote: > 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