Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 0A1054761F1 for ; Tue, 2 Jul 2002 10:01:32 -0400 (EDT) Mailbox-Line: From chantal.ackermann@web.de Tue Jul 2 10:01:32 2002 Received: from smtp.web.de (smtp01.web.de [194.45.170.210]) by postgresql.org (Postfix) with ESMTP id 64070475EE1 for ; Tue, 2 Jul 2002 08:44:31 -0400 (EDT) Received: from kostyaleucin.biomax.de ([212.6.137.236] helo=web.de) by smtp.web.de with asmtp (WEB.DE(Exim) 4.70 #5) id 17PN1G-000336-00 for pgsql-sql@postgresql.org; Tue, 02 Jul 2002 14:44:34 +0200 Message-ID: <3D21A132.4070608@web.de> Date: Tue, 02 Jul 2002 14:48:50 +0200 From: Chantal Ackermann User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020529 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Temporary table instead of repeated joins Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, hits=0.0 required=5.0 tests=none version=2.30 X-Spam-Level: X-Archive-Number: 200207/16 X-Sequence-Number: 8395 hello all, in my program I have to check for a certain combination of data before I make an insert. The check is a select statement with a join and a function call. Now, I wonder if I could gain performance if I would create a temporary view that contained this join and the function call and the other constraints. There will be frequent inserts into the underlying tables so I can't use a real cache that is only updated once in a while (say, a temporary table). So would a select on the view be faster or is the view really just some shortcut for the programmer but the database behaviour actually stays the same? Thanks for any hints Chantal