X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id B041AD1D186 for ; Wed, 20 Aug 2003 12:19:03 -0300 (ADT) 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 89229-01 for ; Wed, 20 Aug 2003 12:18:52 -0300 (ADT) Received: from pns.mm.eutelsat.org (pns.mm.eutelsat.org [194.214.173.227]) by svr1.postgresql.org (Postfix) with ESMTP id AD4D2D1BB80 for ; Wed, 20 Aug 2003 12:18:51 -0300 (ADT) Received: from nts-03.mm.eutelsat.org (localhost [127.0.0.1]) by pns.mm.eutelsat.org (8.11.6/linuxconf) with ESMTP id h7KEKh010838; Wed, 20 Aug 2003 16:20:43 +0200 Received: from gmendola (gmendola.mm.eutelsat.org [194.214.173.50]) by nts-03.mm.eutelsat.org (8.11.6/linuxconf) with SMTP id h7KFDqR14346; Wed, 20 Aug 2003 17:13:52 +0200 Message-ID: <001b01c3672e$1664d7d0$32add6c2@mm.eutelsat.org> From: "Mendola Gaetano" To: Cc: "\"Somasekhar Bangalore\"" References: Subject: Re: Need Help on query tuning Date: Wed, 20 Aug 2003 17:16:53 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.5 tagged_above=0.0 required=5.0 tests=MSG_ID_ADDED_BY_MTA_3, QUOTED_EMAIL_TEXT, REFERENCES X-Spam-Level: X-Archive-Number: 200308/222 X-Sequence-Number: 9943 ""Somasekhar Bangalore"" wrote: >Hi, >I am having 7.2.3 version of postgres database. I have huge data in my database. I have a couple of views and >functions used in the application.if i run the views. The views take a long time to get the data. I am joining just 4 >tables namely roles,link_roles ,link_rights ,rights. >Records in the table are as follows. roles = 49, > link_roles =21399, > link_rights =371 > and rights =108. > create view view_chkACL1(usr_guid,ref_guid,rol_guid,OBJ_TYPE,scope,rol_name,rgt_guid,rgt _name) as >select b.rol_assignee_guid,b.ref_guid,a.rol_guid,a.OBJ_TYPE,a.scope,a.name,d.rgt_gu id,d.name >from roles a, link_roles b, link_rights c,rights d where a.rol_guid = b.rol_guid >and a.OBJ_TYPE = b.OBJ_TYPE and a.record_flag = '01' and b.record_flag = '01' >and c.rol_guid = b.rol_guid >and c.OBJ_TYPE = b.OBJ_TYPE >and c.record_flag ='01' >and d.rgt_guid = c.rgt_guid >and d.record_flag = '01'; May we see the explain analyze for your select and the defintion of your tables? Regards Gaetano Mendola