Received: from hawk.prod.itd.earthlink.net (hawk.mail.pas.earthlink.net [207.217.120.22]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fBH16Am47456 for ; Sun, 16 Dec 2001 20:06:10 -0500 (EST) (envelope-from metaperl@mac.com) Received: from pool0847.cvx36-bradley.dialup.earthlink.net ([216.244.21.82] helo=localhost) by hawk.prod.itd.earthlink.net with esmtp (Exim 3.33 #1) id 16FmEL-00034L-00 for pgsql-sql@postgresql.org; Sun, 16 Dec 2001 17:06:09 -0800 Date: Sun, 16 Dec 2001 15:54:16 -0800 Subject: temp tables versus the global sql area Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v475) From: Terrence Brannon To: pgsql-sql@postgresql.org Content-Transfer-Encoding: 7bit In-Reply-To: <20011211163822.O70071-100000@teak.adhesivemedia.com> Message-Id: <36AF7A62-F280-11D5-92F7-003065C2A10C@mac.com> X-Mailer: Apple Mail (2.475) X-Archive-Number: 200112/165 X-Sequence-Number: 5988 In the Momjian book it is stated: Temporary tables are ideal for holding intermediate data used by the current SQL session. For example, suppose you need to do many SELECTs on the result of a complex query. An efficient strategy is to execute the complex query once, then store the result in a temporary table. ...However, my question is doesn't postgresql calculate the cost of complex queries and store there result in some sort of global sql area sorted by LRU or cost so that you can simply write complex queries and take care of automatic caching?