X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id A56E9D1D803 for ; Tue, 18 Nov 2003 10:46:24 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 03224-06 for ; Tue, 18 Nov 2003 06:45:55 -0400 (AST) Received: from smtp-send.myrealbox.com (smtp-send.myrealbox.com [192.108.102.143]) by svr1.postgresql.org (Postfix) with ESMTP id 3C673D1C9DA for ; Tue, 18 Nov 2003 06:45:52 -0400 (AST) Received: from myrealbox.com shridhar_daithankar@smtp-send.myrealbox.com [202.54.11.72] by smtp-send.myrealbox.com with NetMail SMTP Agent $Revision: 3.44 $ on Novell NetWare via secured & encrypted transport (TLS); Tue, 18 Nov 2003 03:45:49 -0700 Message-ID: <3FB9F855.7010905@myrealbox.com> Date: Tue, 18 Nov 2003 16:15:41 +0530 From: Shridhar Daithankar User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20031013 Thunderbird/0.3 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Laurent Martelli Cc: pgsql-performance@postgresql.org Subject: Re: Join on incompatible types References: <87k75ym1v7.fsf@news.nerim.net> In-Reply-To: <87k75ym1v7.fsf@news.nerim.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/142 X-Sequence-Number: 4702 Laurent Martelli wrote: >>>>>>"scott" == scott marlowe writes: > > > [...] > > scott> Note here: > > scott> Merge Join (cost=1788.68..4735.71 rows=1 width=85) (actual > scott> time=597.540..1340.526 rows=20153 loops=1) Merge Cond: > scott> ("outer".id = "inner".id) > > scott> This estimate is WAY off. Are both of those fields indexed > scott> and analyzed? Have you tried upping the statistics target on > scott> those two fields? I assume they are compatible types. > > Should I understand that a join on incompatible types (such as integer > and varchar) may lead to bad performances ? Conversely, you should enforce strict type compatibility in comparisons for getting any good plans..:-) Shridhar