Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 790E52E0040 for ; Wed, 27 Feb 2008 05:10:08 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 38979-08 for ; Wed, 27 Feb 2008 05:09:59 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from rv-out-0910.google.com (rv-out-0910.google.com [209.85.198.187]) by postgresql.org (Postfix) with ESMTP id 8490E2E0043 for ; Wed, 27 Feb 2008 05:09:57 -0400 (AST) Received: by rv-out-0910.google.com with SMTP id g13so1904040rvb.43 for ; Wed, 27 Feb 2008 01:09:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; 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; bh=inJWp9S7NOwIzDP1eySAEgbsPpQnosYdxl4WlEOdkAQ=; b=Yc34yfS6ICI/VX734B/qAg0H3TYBfbav2V/Hk2AL2SEtGShiqh8KKpPC4weNMKIYSWqEDGqwyl3HvTPZ/V7oKDpAq5/anXwzcvWuRzZVgoPmQhNcAUEyEN8ACSjvfNqVn1ZvEmlsqmwehl0Y1rxVEv15Qo/8DbWX8gxP1bdu+/c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=lZKA7g/QDJJAoZI7IZyJ3Yy0BCghq7m2wiwYjjkN0T4pDiWFh4KRvCSz1xXK6rdawMA2B8BTmU8dDqFhxb80pHu6z2VIm3OIgPjrUKDnFp0XH+X7dfGMfKFwJ5zMgKQndqt7mP2txbAmDpBDZOyVJUjV+CqWudzuux1jeR5uPLY= Received: by 10.140.82.40 with SMTP id f40mr4274441rvb.0.1204103394647; Wed, 27 Feb 2008 01:09:54 -0800 (PST) Received: by 10.141.128.7 with HTTP; Wed, 27 Feb 2008 01:09:54 -0800 (PST) Message-ID: <684362e10802270109y7d63d656jbdff332274a31456@mail.gmail.com> Date: Wed, 27 Feb 2008 15:09:54 +0600 From: "Markus Bertheau" To: "Bart Degryse" Subject: Re: Function returns error (view) Cc: "=?ISO-8859-1?Q?Professor_Fl=E1vio_Brito?=" , pgsql-sql@postgresql.org In-Reply-To: <47C524E9.A3DD.0030.0@indicator.be> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <6a5e3a6f0802260832k9c1375ap632f8adad0740fa2@mail.gmail.com> <6a5e3a6f0802261020o51327bceof4845c47ae1b099d@mail.gmail.com> <47C524E9.A3DD.0030.0@indicator.be> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200802/216 X-Sequence-Number: 30307 2008/2/27, Bart Degryse : > > I would also suggest you replace the > ...t.cod_user IN (subselect) > by a join construction. I think it's more performant. In recent versions PostgreSQL is quite smart when planning IN, so that shouldn't be a concern. Markus -- Markus Bertheau Blog: http://www.bluetwanger.de/blog/