X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 7FF8AD1C487 for ; Thu, 14 Aug 2003 12:01:08 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 85374-10 for ; Thu, 14 Aug 2003 08:59:33 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 76268D1C9C6 for ; Thu, 14 Aug 2003 09:00:57 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h7EC0nSa015714; Thu, 14 Aug 2003 08:00:49 -0400 (EDT) To: "Alexander Priem" Cc: pgsql-performance@postgresql.org Subject: Re: 'View'-performance In-reply-to: <00e801c36259$30b908b0$b696a8c0@APR> References: <002a01c34f62$75c01de0$b696a8c0@APR> <00e801c36259$30b908b0$b696a8c0@APR> Comments: In-reply-to "Alexander Priem" message dated "Thu, 14 Aug 2003 13:42:50 +0200" Date: Thu, 14 Aug 2003 08:00:49 -0400 Message-ID: <15713.1060862449@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/254 X-Sequence-Number: 3071 "Alexander Priem" writes: > What I am thinking about is creating two views for this table: Table_View a= > nd Table_History. Table_View would contain all records where "Deleted is nu= > ll". Table_History would just contain all records (Select * From Table). > Would " Select * from Table_View Where Name=3D'xxx' " perform worse than " = > Select * from Table Where deleted is null and Name=3D'xxx' " ? They'd be exactly the same (modulo a few extra microseconds/milliseconds for the query planner to expand the view definition). regards, tom lane