X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id B0F5052B60 for ; Sat, 30 Jul 2005 12:15:24 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 70236-07 for ; Sat, 30 Jul 2005 15:15:18 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 7F2BC52B8B for ; Sat, 30 Jul 2005 12:15:17 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j6UFFCM6026943; Sat, 30 Jul 2005 11:15:12 -0400 (EDT) To: Kyle Bateman Cc: pgsql-sql@postgresql.org, Peter Eisentraut Subject: Re: bug in information_schema? In-reply-to: <42EB0700.4040600@actarg.com> References: <42EB0700.4040600@actarg.com> Comments: In-reply-to Kyle Bateman message dated "Fri, 29 Jul 2005 22:50:08 -0600" Date: Sat, 30 Jul 2005 11:15:12 -0400 Message-ID: <26942.1122736512@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200507/250 X-Sequence-Number: 22228 Kyle Bateman writes: > I noticed that it seemed a bit slow to query > information_schema.view_column_usage. As I look at the code in > information_schema.sql, I'm not sure why pg_user is referenced twice > (once without an alias). It looks like we can take out the first > pg_user and remove the DISTINCT keyword and this improves the efficiency > significantly. The unconstrained join against pg_user is clearly unnecessary, and in fact I took it out a few days ago. I'm not sure whether the SELECT DISTINCT is still needed --- it might be, if there can be multiple pg_depend entries linking the same entities. Peter, any thoughts? regards, tom lane